summaryrefslogtreecommitdiffstats
path: root/recipes-security
diff options
context:
space:
mode:
authorArmin Kuster <akuster808@gmail.com>2017-09-10 09:43:01 -0700
committerArmin Kuster <akuster808@gmail.com>2017-09-15 08:01:07 -0700
commit169a02dff0c2c0d7d5f02fd7e5b346c48159cce5 (patch)
tree08bf1f35a2480019fbd9bcd93209b8c1c7cd127f /recipes-security
parentf87b66d9083a71037d513ad5a2eb13f29e3f5f26 (diff)
downloadmeta-security-169a02dff0c2c0d7d5f02fd7e5b346c48159cce5.tar.gz
Apparmor: add apache2 to PACKAGECONF and check for webserver layer
Don't want to add layer depends for one package unless needed. Signed-off-by: Armin Kuster <akuster808@gmail.com>
Diffstat (limited to 'recipes-security')
-rw-r--r--recipes-security/AppArmor/apparmor_2.11.0.bb26
1 files changed, 22 insertions, 4 deletions
diff --git a/recipes-security/AppArmor/apparmor_2.11.0.bb b/recipes-security/AppArmor/apparmor_2.11.0.bb
index d9572e4..ae3391d 100644
--- a/recipes-security/AppArmor/apparmor_2.11.0.bb
+++ b/recipes-security/AppArmor/apparmor_2.11.0.bb
@@ -11,7 +11,7 @@ SECTION = "admin"
11LICENSE = "GPLv2 & GPLv2+ & BSD-3-Clause & LGPLv2.1+" 11LICENSE = "GPLv2 & GPLv2+ & BSD-3-Clause & LGPLv2.1+"
12LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=fd57a4b0bc782d7b80fd431f10bbf9d0" 12LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=fd57a4b0bc782d7b80fd431f10bbf9d0"
13 13
14DEPENDS = "bison-native apr apache2 gettext-native coreutils-native" 14DEPENDS = "bison-native apr 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 \
@@ -38,8 +38,18 @@ PACKAGECONFIG ?="man python perl"
38PACKAGECONFIG[man] = "--enable-man-pages, --disable-man-pages" 38PACKAGECONFIG[man] = "--enable-man-pages, --disable-man-pages"
39PACKAGECONFIG[python] = "--with-python, --without-python, python3 swig-native" 39PACKAGECONFIG[python] = "--with-python, --without-python, python3 swig-native"
40PACKAGECONFIG[perl] = "--with-perl, --without-perl, perl perl-native swig-native" 40PACKAGECONFIG[perl] = "--with-perl, --without-perl, perl perl-native swig-native"
41PACKAGECONFIG[apache2] = ",,apache2,"
41 42
42PAMLIB="${@bb.utils.contains('DISTRO_FEATURES', 'pam', '1', '0', d)}" 43PAMLIB="${@bb.utils.contains('DISTRO_FEATURES', 'pam', '1', '0', d)}"
44HTTPD="${@bb.utils.contains('PACKAGECONFIG', 'apache2', '1', '0', d)}"
45
46
47python() {
48 if 'apache2' in d.getVar('PACKAGECONFIG').split() and \
49 'webserver' not in d.getVar('BBFILE_COLLECTIONS').split():
50 raise bb.parse.SkipRecipe('Requires meta-webserver to be present.')
51}
52
43 53
44do_configure() { 54do_configure() {
45 cd ${S}/libraries/libapparmor 55 cd ${S}/libraries/libapparmor
@@ -57,7 +67,10 @@ do_compile () {
57 oe_runmake -C ${B}/utils 67 oe_runmake -C ${B}/utils
58 oe_runmake -C ${B}/parser 68 oe_runmake -C ${B}/parser
59 oe_runmake -C ${B}/profiles 69 oe_runmake -C ${B}/profiles
60 oe_runmake -C ${B}/changehat/mod_apparmor 70
71 if test -z "${HTTPD}" ; then
72 oe_runmake -C ${B}/changehat/mod_apparmor
73 fi
61 74
62 if test -z "${PAMLIB}" ; then 75 if test -z "${PAMLIB}" ; then
63 oe_runmake -C ${B}/changehat/pam_apparmor 76 oe_runmake -C ${B}/changehat/pam_apparmor
@@ -73,7 +86,10 @@ do_install () {
73 oe_runmake -C ${B}/utils DESTDIR="${D}" install 86 oe_runmake -C ${B}/utils DESTDIR="${D}" install
74 oe_runmake -C ${B}/parser DESTDIR="${D}" install 87 oe_runmake -C ${B}/parser DESTDIR="${D}" install
75 oe_runmake -C ${B}/profiles DESTDIR="${D}" install 88 oe_runmake -C ${B}/profiles DESTDIR="${D}" install
76 oe_runmake -C ${B}/changehat/mod_apparmor DESTDIR="${D}" install 89
90 if test -z "${HTTPD}" ; then
91 oe_runmake -C ${B}/changehat/mod_apparmor DESTDIR="${D}" install
92 fi
77 93
78 if test -z "${PAMLIB}" ; then 94 if test -z "${PAMLIB}" ; then
79 oe_runmake -C ${B}/changehat/pam_apparmor DESTDIR="${D}" install 95 oe_runmake -C ${B}/changehat/pam_apparmor DESTDIR="${D}" install
@@ -122,11 +138,13 @@ SYSTEMD_PACKAGES = "${PN}"
122SYSTEMD_SERVICE_${PN} = "apparmor.service" 138SYSTEMD_SERVICE_${PN} = "apparmor.service"
123SYSTEMD_AUTO_ENABLE = "disable" 139SYSTEMD_AUTO_ENABLE = "disable"
124 140
125PACKAGES += "mod-${PN}" 141PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'apache2', 'mod-${PN}', '', d)}"
126 142
127FILES_${PN} += "/lib/apparmor/ ${sysconfdir}/apparmor ${PYTHON_SITEPACKAGES_DIR}" 143FILES_${PN} += "/lib/apparmor/ ${sysconfdir}/apparmor ${PYTHON_SITEPACKAGES_DIR}"
128FILES_mod-${PN} = "${libdir}/apache2/modules/*" 144FILES_mod-${PN} = "${libdir}/apache2/modules/*"
129 145
146ALLOW_EMPTY_${PN} = "1"
147
130RDEPENDS_${PN} += "bash lsb" 148RDEPENDS_${PN} += "bash lsb"
131RDEPENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG','python','python3 python3-modules','', d)}" 149RDEPENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG','python','python3 python3-modules','', d)}"
132RDEPENDS_${PN}_remove += "${@bb.utils.contains('PACKAGECONFIG','perl','','perl', d)}" 150RDEPENDS_${PN}_remove += "${@bb.utils.contains('PACKAGECONFIG','perl','','perl', d)}"