diff options
author | Armin Kuster <akuster808@gmail.com> | 2017-09-10 09:43:01 -0700 |
---|---|---|
committer | Armin Kuster <akuster808@gmail.com> | 2017-09-15 08:01:07 -0700 |
commit | 169a02dff0c2c0d7d5f02fd7e5b346c48159cce5 (patch) | |
tree | 08bf1f35a2480019fbd9bcd93209b8c1c7cd127f /recipes-security | |
parent | f87b66d9083a71037d513ad5a2eb13f29e3f5f26 (diff) | |
download | meta-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.bb | 26 |
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" | |||
11 | LICENSE = "GPLv2 & GPLv2+ & BSD-3-Clause & LGPLv2.1+" | 11 | LICENSE = "GPLv2 & GPLv2+ & BSD-3-Clause & LGPLv2.1+" |
12 | LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=fd57a4b0bc782d7b80fd431f10bbf9d0" | 12 | LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=fd57a4b0bc782d7b80fd431f10bbf9d0" |
13 | 13 | ||
14 | DEPENDS = "bison-native apr apache2 gettext-native coreutils-native" | 14 | DEPENDS = "bison-native apr gettext-native coreutils-native" |
15 | 15 | ||
16 | SRC_URI = " \ | 16 | SRC_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" | |||
38 | PACKAGECONFIG[man] = "--enable-man-pages, --disable-man-pages" | 38 | PACKAGECONFIG[man] = "--enable-man-pages, --disable-man-pages" |
39 | PACKAGECONFIG[python] = "--with-python, --without-python, python3 swig-native" | 39 | PACKAGECONFIG[python] = "--with-python, --without-python, python3 swig-native" |
40 | PACKAGECONFIG[perl] = "--with-perl, --without-perl, perl perl-native swig-native" | 40 | PACKAGECONFIG[perl] = "--with-perl, --without-perl, perl perl-native swig-native" |
41 | PACKAGECONFIG[apache2] = ",,apache2," | ||
41 | 42 | ||
42 | PAMLIB="${@bb.utils.contains('DISTRO_FEATURES', 'pam', '1', '0', d)}" | 43 | PAMLIB="${@bb.utils.contains('DISTRO_FEATURES', 'pam', '1', '0', d)}" |
44 | HTTPD="${@bb.utils.contains('PACKAGECONFIG', 'apache2', '1', '0', d)}" | ||
45 | |||
46 | |||
47 | python() { | ||
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 | ||
44 | do_configure() { | 54 | do_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}" | |||
122 | SYSTEMD_SERVICE_${PN} = "apparmor.service" | 138 | SYSTEMD_SERVICE_${PN} = "apparmor.service" |
123 | SYSTEMD_AUTO_ENABLE = "disable" | 139 | SYSTEMD_AUTO_ENABLE = "disable" |
124 | 140 | ||
125 | PACKAGES += "mod-${PN}" | 141 | PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'apache2', 'mod-${PN}', '', d)}" |
126 | 142 | ||
127 | FILES_${PN} += "/lib/apparmor/ ${sysconfdir}/apparmor ${PYTHON_SITEPACKAGES_DIR}" | 143 | FILES_${PN} += "/lib/apparmor/ ${sysconfdir}/apparmor ${PYTHON_SITEPACKAGES_DIR}" |
128 | FILES_mod-${PN} = "${libdir}/apache2/modules/*" | 144 | FILES_mod-${PN} = "${libdir}/apache2/modules/*" |
129 | 145 | ||
146 | ALLOW_EMPTY_${PN} = "1" | ||
147 | |||
130 | RDEPENDS_${PN} += "bash lsb" | 148 | RDEPENDS_${PN} += "bash lsb" |
131 | RDEPENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG','python','python3 python3-modules','', d)}" | 149 | RDEPENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG','python','python3 python3-modules','', d)}" |
132 | RDEPENDS_${PN}_remove += "${@bb.utils.contains('PACKAGECONFIG','perl','','perl', d)}" | 150 | RDEPENDS_${PN}_remove += "${@bb.utils.contains('PACKAGECONFIG','perl','','perl', d)}" |