]> git.ipfire.org Git - people/stevee/pakfire.git/commitdiff
Enhance perl cleanup.
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 10 Feb 2013 14:34:02 +0000 (15:34 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 10 Feb 2013 14:34:02 +0000 (15:34 +0100)
.bs files with size == 0 get removed.

macros/build.macro
macros/perl.macro

index 4e4d830bf7cef0bd6ef2969c9f519edc715170df..097965300328ce9a3b5120622072af2e9ec74b01 100644 (file)
@@ -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}
 
index c1be59f6cfc393d9cc0a6a2dc4ea09e655b6efab..b29e028e15f0d3aca8e26e1cd11c3032529c6613 100644 (file)
@@ -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