# Macros for RPM by Ernesto Baschny # # These are useful for building the SuSE packages found at # http://www.baschny.de/linux/ # # "SuSE Linux x.x (i386)" %suse_distr %(cat /etc/SuSE-release | head -1) # "xx" (e.g. "80") %suse_release %(cat /etc/SuSE-release | grep '^VERSION' | sed -e 's/VERSION = //' -e 's/\\.//' -e 's/\n//' ) %_initrddir %{_sysconfdir}/init.d/ # Defaults: %distribution %suse_distr - own %vendor cron IT GmbH # "perl Makefile.PL" for Perl modules that works on all MakeMaker releases # (using hack from http://lists.freshrpms.net/pipermail/freshrpms-list/2003-January/002721.html) %perl_makefile() \ if perl -MExtUtils::MakeMaker -e 'exit ($ExtUtils::MakeMaker::VERSION >= 6.06 || $ExtUtils::MakeMaker::VERSION < 5.90)' \ then \ # MM 5.90 - 6.06 needs this for make install to work later \ echo "Found MakeMaker 5.90 - 6.06" \ %{__perl} Makefile.PL 'PREFIX=$(MYDESTDIR)'%{_prefix} %* \ else \ # MM < 5.90 or MM >= 6.06 \ echo "Found other MakeMaker" \ %{__perl} Makefile.PL PREFIX=%{_prefix} %* \ fi \ %{nil} # "make install" for Perl that works on all MakeMaker releases # tested on: # suse80: MM 5.45 # suse82: MM 6.03 # suse90: MM 6.17 %perl_makeinstall() \ if perl -MExtUtils::MakeMaker -e 'exit ($ExtUtils::MakeMaker::VERSION >= 6.06)' \ then \ if perl -MExtUtils::MakeMaker -e 'exit ($ExtUtils::MakeMaker::VERSION >= 5.90)' \ then \ # MM < 5.90 \ make \\\ PREFIX=%{buildroot}%{_prefix} \\\ INSTALLMAN1DIR=%{buildroot}%{_mandir}/man1 \\\ INSTALLMAN3DIR=%{buildroot}%{_mandir}/man3 \\\ INSTALLMAN5DIR=%{buildroot}%{_mandir}/man5 \\\ %* \\\ install \ else \ # MM 5.90 - 6.06 \ make \\\ MYDESTDIR=%{buildroot} \\\ INSTALLMAN1DIR=%{_mandir}/man1 \\\ INSTALLMAN3DIR=%{_mandir}/man3 \\\ INSTALLMAN5DIR=%{_mandir}/man5 \\\ %* \\\ install \ fi \ else \ # MM >= 6.06 \ make \\\ DESTDIR=%{buildroot} \\\ INSTALLMAN1DIR=%{_mandir}/man1 \\\ INSTALLMAN3DIR=%{_mandir}/man3 \\\ INSTALLMAN5DIR=%{_mandir}/man5 \\\ INSTALLSITEMAN1DIR=%{_mandir}/man1 \\\ INSTALLSITEMAN3DIR=%{_mandir}/man3 \\\ INSTALLSITEMAN5DIR=%{_mandir}/man5 \\\ INSTALLVENDORMAN1DIR=%{_mandir}/man1 \\\ INSTALLVENDORMAN3DIR=%{_mandir}/man3 \\\ INSTALLVENDORMAN5DIR=%{_mandir}/man5 \\\ %* \\\ install \ fi \ %{nil}