# # Plugin for Perl package # # vi:syntax=sh # # # output dependency # OutputDependency() { cat >> ${SPECFILE} << 'EOL' # Dependency Requires: perl Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) BuildRequires: perl EOL } # # Output build section # OutputBuild() { echo '%build' >> ${SPECFILE} echo '%{__perl} Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}"' >> ${SPECFILE} echo '%{__make} %{?_smp_mflags}' >> ${SPECFILE} echo '' >> ${SPECFILE} } # # Output install section # OutputInstall() { cat >> ${SPECFILE} << 'EOL' %install %{__rm} -rf ${RPM_BUILD_ROOT} %{__make} pure_install DESTDIR=${RPM_BUILD_ROOT} # remove unnecessary files. find ${RPM_BUILD_ROOT} -type f -name perllocal.pod -exec %{__rm} -f {} ';' find ${RPM_BUILD_ROOT} -type f -name .packlist -exec %{__rm} -f {} ';' find ${RPM_BUILD_ROOT}%{_mandir} -type f -exec %{__rm} -f {} ';' find %{buildroot} -depth -type d -exec rmdir {} 2>/dev/null \; # generate file list find $RPM_BUILD_ROOT%{_prefix} -type f -print | sed "s@^$RPM_BUILD_ROOT@@g" > %{name}.files if [ "$(cat %{name}.files)X" = "X" ] ; then echo "ERROR: EMPTY FILE LIST" exit -1 fi EOL }