summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--recipes-security/AppArmor/apparmor_2.11.0.bb17
-rw-r--r--recipes-security/AppArmor/files/crosscompile_perl_bindings.patch25
-rw-r--r--recipes-security/AppArmor/files/disable_perl_h_check.patch19
3 files changed, 54 insertions, 7 deletions
diff --git a/recipes-security/AppArmor/apparmor_2.11.0.bb b/recipes-security/AppArmor/apparmor_2.11.0.bb
index 591a673..647ab12 100644
--- a/recipes-security/AppArmor/apparmor_2.11.0.bb
+++ b/recipes-security/AppArmor/apparmor_2.11.0.bb
@@ -15,6 +15,8 @@ DEPENDS = "bison-native apr apache2 gettext-native coreutils-native"
15 15
16SRC_URI = " \ 16SRC_URI = " \
17 http://archive.ubuntu.com/ubuntu/pool/main/a/${BPN}/${BPN}_${PV}.orig.tar.gz \ 17 http://archive.ubuntu.com/ubuntu/pool/main/a/${BPN}/${BPN}_${PV}.orig.tar.gz \
18 file://disable_perl_h_check.patch \
19 file://crosscompile_perl_bindings.patch \
18 file://apparmor.rc \ 20 file://apparmor.rc \
19 file://functions \ 21 file://functions \
20 file://apparmor \ 22 file://apparmor \
@@ -27,15 +29,15 @@ SRC_URI[sha256sum] = "b1c489ea11e7771b8e6b181532cafbf9ebe6603e3cb00e2558f21b7a5b
27 29
28PARALLEL_MAKE = "" 30PARALLEL_MAKE = ""
29 31
30inherit pkgconfig autotools-brokensep update-rc.d python-dir perlnative ptest 32inherit pkgconfig autotools-brokensep update-rc.d python3native perlnative ptest cpan
31inherit ${@bb.utils.contains('VIRTUAL-RUNTIME_init_manager','systemd','systemd','', d)} 33inherit ${@bb.utils.contains('VIRTUAL-RUNTIME_init_manager','systemd','systemd','', d)}
32 34
33S = "${WORKDIR}/apparmor-${PV}" 35S = "${WORKDIR}/apparmor-${PV}"
34 36
35PACKAGECONFIG ?="man" 37PACKAGECONFIG ?="man python perl"
36PACKAGECONFIG[man] = "--enable-man-pages, --disable-man-pages" 38PACKAGECONFIG[man] = "--enable-man-pages, --disable-man-pages"
37PACKAGECONFIG[python] = "--with-python, --without-python, python swig-native" 39PACKAGECONFIG[python] = "--with-python, --without-python, python3 swig-native"
38PACKAGECONFIG[perl] = "--with-perl, --without-perl, perl perl-native" 40PACKAGECONFIG[perl] = "--with-perl, --without-perl, perl perl-native swig-native"
39 41
40PAMLIB="${@bb.utils.contains('DISTRO_FEATURES', 'pam', '1', '0', d)}" 42PAMLIB="${@bb.utils.contains('DISTRO_FEATURES', 'pam', '1', '0', d)}"
41 43
@@ -116,11 +118,12 @@ SYSTEMD_PACKAGES = "${PN}"
116SYSTEMD_SERVICE_${PN} = "apparmor.service" 118SYSTEMD_SERVICE_${PN} = "apparmor.service"
117SYSTEMD_AUTO_ENABLE = "disable" 119SYSTEMD_AUTO_ENABLE = "disable"
118 120
119PACKAGES += "python-${PN} mod-${PN}" 121PACKAGES += "mod-${PN}"
120 122
121FILES_${PN} += "/lib/apparmor/ ${sysconfdir}/apparmor" 123FILES_${PN} += "/lib/apparmor/ ${sysconfdir}/apparmor ${PYTHON_SITEPACKAGES_DIR}"
122FILES_mod-${PN} = "${libdir}/apache2/modules/*" 124FILES_mod-${PN} = "${libdir}/apache2/modules/*"
123FILES_python-${PN} = "${PYTHON_SITEPACKAGES_DIR}"
124 125
125RDEPENDS_${PN} += "bash lsb" 126RDEPENDS_${PN} += "bash lsb"
127RDEPENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG','python','python3 python3-argparse python3-json','', d)}"
128RDEPENDS_${PN}_remove += "${@bb.utils.contains('PACKAGECONFIG','perl','','perl', d)}"
126RDEPENDS_${PN}-ptest += "coreutils dbus-lib" 129RDEPENDS_${PN}-ptest += "coreutils dbus-lib"
diff --git a/recipes-security/AppArmor/files/crosscompile_perl_bindings.patch b/recipes-security/AppArmor/files/crosscompile_perl_bindings.patch
new file mode 100644
index 0000000..ef55de7
--- /dev/null
+++ b/recipes-security/AppArmor/files/crosscompile_perl_bindings.patch
@@ -0,0 +1,25 @@
1Upstream-Status: Inappropriate [configuration]
2
3As we're cross-compiling here we need to override CC/LD that MakeMaker has
4stuck in the generated Makefile with our cross tools. In this case, linking is
5done via the compiler rather than the linker directly so pass in CC not LD
6here.
7
8Signed-Off-By: Tom Rini <trini@konsulko.com>
9
10--- a/libraries/libapparmor/swig/perl/Makefile.am.orig 2017-06-13 19:04:43.296676212 -0400
11+++ b/libraries/libapparmor/swig/perl/Makefile.am 2017-06-13 19:05:03.488676693 -0400
12@@ -16,11 +16,11 @@
13
14 LibAppArmor.so: libapparmor_wrap.c Makefile.perl
15 if test ! -f libapparmor_wrap.c; then cp $(srcdir)/libapparmor_wrap.c . ; fi
16- $(MAKE) -fMakefile.perl
17+ $(MAKE) -fMakefile.perl CC='$(CC)' LD='$(CC)'
18 if test $(top_srcdir) != $(top_builddir) ; then rm -f libapparmor_wrap.c ; fi
19
20 install-exec-local: Makefile.perl
21- $(MAKE) -fMakefile.perl install_vendor
22+ $(MAKE) -fMakefile.perl install_vendor CC='$(CC)' LD='$(CC)'
23
24 # sadly there is no make uninstall for perl
25 #uninstall-local: Makefile.perl
diff --git a/recipes-security/AppArmor/files/disable_perl_h_check.patch b/recipes-security/AppArmor/files/disable_perl_h_check.patch
new file mode 100644
index 0000000..cf2640f
--- /dev/null
+++ b/recipes-security/AppArmor/files/disable_perl_h_check.patch
@@ -0,0 +1,19 @@
1Upstream-Status: Inappropriate [configuration]
2
3Remove file check for $perl_includedir/perl.h. AC_CHECK_FILE will fail on
4cross compilation. Rather than try and get a compile check to work here,
5we know that we have what's required via our metadata so remove only this
6check.
7
8Signed-Off-By: Tom Rini <trini@konsulko.com>
9
10--- a/libraries/libapparmor/configure.ac.orig 2017-06-13 16:41:38.668471495 -0400
11+++ b/libraries/libapparmor/configure.ac 2017-06-13 16:41:40.708471543 -0400
12@@ -58,7 +58,6 @@
13 AC_PATH_PROG(PERL, perl)
14 test -z "$PERL" && AC_MSG_ERROR([perl is required when enabling perl bindings])
15 perl_includedir="`$PERL -e 'use Config; print $Config{archlib}'`/CORE"
16- AC_CHECK_FILE($perl_includedir/perl.h, enable_perl=yes, enable_perl=no)
17 fi
18
19