From: Michael Tremer Date: Sun, 10 Feb 2013 14:34:02 +0000 (+0100) Subject: Enhance perl cleanup. X-Git-Tag: 0.9.25~16^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9cbc043da8bcbd52ab3ef9b710abcbcd3a72fb84;p=pakfire.git Enhance perl cleanup. .bs files with size == 0 get removed. --- diff --git a/macros/build.macro b/macros/build.macro index 4e4d830bf..097965300 100644 --- a/macros/build.macro +++ b/macros/build.macro @@ -59,15 +59,6 @@ def MACRO_PYTHON_COMPILE fi end -MACRO_PERL_CLEANUP - # Remove perllocal.pod. - rm -f %{BUILDROOT}/usr/lib*/perl*/perllocal.pod - - # Remove all .packlist files. - find %{BUILDROOT}/usr/{lib,share}/perl* -name ".packlist" 2>/dev/null | \ - xargs --no-run-if-empty rm -f -end - MACRO_PATCHES = /usr/lib/pakfire/patch --search-path=%{DIR_PATCHES} "%{patches}" # Pre-defined build scripts. @@ -145,7 +136,9 @@ build %{MACRO_INSTALL_FILES} %{MACRO_PYTHON_COMPILE} - %{MACRO_PERL_CLEANUP} + + # Cleanup perl modules. + %{perl_cleanup} %{install_post} diff --git a/macros/perl.macro b/macros/perl.macro index c1be59f6c..b29e028e1 100644 --- a/macros/perl.macro +++ b/macros/perl.macro @@ -7,3 +7,22 @@ perl_vendorarch = %(eval "$(%{perl} -V:installvendorarch)"; echo ${installvendor perl_vendorlib = %(eval "$(%{perl} -V:installvendorlib)"; echo ${installvendorlib}) perl_archlib = %(eval "$(%{perl} -V:installarchlib)"; echo ${installarchlib}) perl_privlib = %(eval "$(%{perl} -V:installprivlib)"; echo ${installprivlib}) + +perl_all_paths = {%{perl_vendorarch},%{perl_vendorlib},%{perl_archlib},%{perl_privlib}} + +# perl_cleanup: Removes unwanted perl files. +perl_cleanup + # Remove perllocal.pod. + rm -f %{BUILDROOT}%{perl_all_paths}/perllocal.pod + + # Remove all .packlist files. + find %{BUILDROOT}%{perl_all_paths} -name ".packlist" 2>/dev/null | \ + xargs --no-run-if-empty rm -f + + # Remove all empty .bs files. + find %{BUILDROOT}%{perl_all_paths} -name ".bs" -type f -empty 2>/dev/null | \ + xargs --no-run-if-empty rm -f + + # Run user-defined stuff. + %{perl_cleanup_cmds} +end