[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#750128: src:apparmor: hardcodes /usr/lib/perl5



Package: src:apparmor
Version: 2.8.0
Severity: important
Tags: patch
User: debian-perl@lists.debian.org
Usertags: perl-5.20-transition

>From version 5.20.0 Debian packaged perl intents to use vendor library
paths specific to the architecture and the perl version. See #748380 for 
details. For this to work, packages containing information related to bunary 
perl modules need to migrate from hardcoded /usr/lib/perl5 to the value of the 
$Config{vendorarch} variable, as defined in the 'Config' module.

The attached module does that, plus replacing /usr/lib/perl5 in 
/etc/apparmor/{logprof.conf,severity.db}.

With that patch building with perl 5.20.0 (pending NEW to enter experimental) 
causes the libapparmod-perl module to use /usr/lib/<triplet>/perl5/5.20 
directory. Building with perl 5.18 from sid uses /usr/lib/perl5 as before.

Thanks for considering,
    dam
    Debian Perl Group
>From 632aa1da97b1fd4d42d284457152bc78ab32d831 Mon Sep 17 00:00:00 2001
From: Damyan Ivanov <dmn@debian.org>
Date: Sun, 1 Jun 2014 19:25:45 +0000
Subject: [PATCH] Avoid using hardcoded /usr/lib/perl5

>From version 5.20.0 Debian packaged perl intents to use vendor library
patchs specific to the architecture and the perl version. For this to
work, packages containing information related to bunary perl modules
need to migrate from hardcoded /usr/lib/perl5 to the value of the
$Config{vendorarch} variable, as defined in the 'Config' module.

Signed-off-by: Damyan Ivanov <dmn@debian.org>
---
 debian/libapparmor-perl.install    |  1 -
 debian/libapparmor-perl.install.in |  1 +
 debian/rules                       | 11 ++++++++++-
 3 files changed, 11 insertions(+), 2 deletions(-)
 delete mode 100644 debian/libapparmor-perl.install
 create mode 100644 debian/libapparmor-perl.install.in

diff --git a/debian/libapparmor-perl.install b/debian/libapparmor-perl.install
deleted file mode 100644
index c1a78d7..0000000
--- a/debian/libapparmor-perl.install
+++ /dev/null
@@ -1 +0,0 @@
-usr/lib/perl5/*
diff --git a/debian/libapparmor-perl.install.in b/debian/libapparmor-perl.install.in
new file mode 100644
index 0000000..5645365
--- /dev/null
+++ b/debian/libapparmor-perl.install.in
@@ -0,0 +1 @@
+${perl:vendorarch}/*
diff --git a/debian/rules b/debian/rules
index 1c4319b..db2a5bd 100755
--- a/debian/rules
+++ b/debian/rules
@@ -2,6 +2,8 @@
 
 export DEB_HOST_ARCH_OS   ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
 
+PERL_LIB := $(shell perl -MConfig -e 'print substr($$Config{vendorarch},1)' )
+
 %:
 	dh $@ --with=python2,python3,apache2
 
@@ -56,6 +58,7 @@ override_dh_auto_clean:
 	rm -f $(CURDIR)/debian/debhelper/dh_apparmor.1
 	# Remove autoconf build cruft.
 	rm -f $(CURDIR)/libraries/libapparmor/test-driver
+	rm -f debian/libapparmor-perl.install
 
 override_dh_auto_install:
 	# Utils
@@ -82,7 +85,7 @@ endif
 	    DESTDIR=$(CURDIR)/debian/tmp \
 	    install
 	# fixup rpath for libapparmor-perl
-	find $(CURDIR)/debian/tmp/usr/lib/perl5 -name '*.so' | xargs chrpath --delete
+	find $(CURDIR)/debian/tmp/$(PERL_LIB) -name '*.so' | xargs chrpath --delete
 
 	# Install python swig modules
 	for py in $(shell pyversions -s) $(shell py3versions -s); do \
@@ -136,6 +139,12 @@ override_dh_install:
 	        dh_apparmor --profile-name=$$profile -papparmor-profiles; \
 	    fi; \
 	done
+	sed 's,\$${perl:vendorarch},$(PERL_LIB),g' \
+	    debian/libapparmor-perl.install.in \
+	    > debian/libapparmor-perl.install
+	sed -i -e 's,usr/lib/perl5,$(PERL_LIB),g' \
+	    $(CURDIR)/debian/tmp/etc/apparmor/logprof.conf \
+	    $(CURDIR)/debian/tmp/etc/apparmor/severity.db
 	dh_install
 
 
-- 
2.0.0


Reply to: