]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blame - pakfire/patches/0013-Enhance-perl-cleanup.patch
pakfire: Import latest patches from upstream.
[people/ms/ipfire-3.x.git] / pakfire / patches / 0013-Enhance-perl-cleanup.patch
CommitLineData
91d1c8a9
MT
1From 9cbc043da8bcbd52ab3ef9b710abcbcd3a72fb84 Mon Sep 17 00:00:00 2001
2From: Michael Tremer <michael.tremer@ipfire.org>
3Date: Sun, 10 Feb 2013 15:34:02 +0100
4Subject: [PATCH 13/17] Enhance perl cleanup.
5
6.bs files with size == 0 get removed.
7---
8 macros/build.macro | 13 +++----------
9 macros/perl.macro | 19 +++++++++++++++++++
10 2 files changed, 22 insertions(+), 10 deletions(-)
11
12diff --git a/macros/build.macro b/macros/build.macro
13index 4e4d830..0979653 100644
14--- a/macros/build.macro
15+++ b/macros/build.macro
16@@ -59,15 +59,6 @@ def MACRO_PYTHON_COMPILE
17 fi
18 end
19
20-MACRO_PERL_CLEANUP
21- # Remove perllocal.pod.
22- rm -f %{BUILDROOT}/usr/lib*/perl*/perllocal.pod
23-
24- # Remove all .packlist files.
25- find %{BUILDROOT}/usr/{lib,share}/perl* -name ".packlist" 2>/dev/null | \
26- xargs --no-run-if-empty rm -f
27-end
28-
29 MACRO_PATCHES = /usr/lib/pakfire/patch --search-path=%{DIR_PATCHES} "%{patches}"
30
31 # Pre-defined build scripts.
32@@ -145,7 +136,9 @@ build
33
34 %{MACRO_INSTALL_FILES}
35 %{MACRO_PYTHON_COMPILE}
36- %{MACRO_PERL_CLEANUP}
37+
38+ # Cleanup perl modules.
39+ %{perl_cleanup}
40
41 %{install_post}
42
43diff --git a/macros/perl.macro b/macros/perl.macro
44index c1be59f..b29e028 100644
45--- a/macros/perl.macro
46+++ b/macros/perl.macro
47@@ -7,3 +7,22 @@ perl_vendorarch = %(eval "$(%{perl} -V:installvendorarch)"; echo ${installvendor
48 perl_vendorlib = %(eval "$(%{perl} -V:installvendorlib)"; echo ${installvendorlib})
49 perl_archlib = %(eval "$(%{perl} -V:installarchlib)"; echo ${installarchlib})
50 perl_privlib = %(eval "$(%{perl} -V:installprivlib)"; echo ${installprivlib})
51+
52+perl_all_paths = {%{perl_vendorarch},%{perl_vendorlib},%{perl_archlib},%{perl_privlib}}
53+
54+# perl_cleanup: Removes unwanted perl files.
55+perl_cleanup
56+ # Remove perllocal.pod.
57+ rm -f %{BUILDROOT}%{perl_all_paths}/perllocal.pod
58+
59+ # Remove all .packlist files.
60+ find %{BUILDROOT}%{perl_all_paths} -name ".packlist" 2>/dev/null | \
61+ xargs --no-run-if-empty rm -f
62+
63+ # Remove all empty .bs files.
64+ find %{BUILDROOT}%{perl_all_paths} -name ".bs" -type f -empty 2>/dev/null | \
65+ xargs --no-run-if-empty rm -f
66+
67+ # Run user-defined stuff.
68+ %{perl_cleanup_cmds}
69+end
70--
711.8.1.2
72