dbus-cynara: Simplifies build recipe 53/22153/4
authorJosé Bollo <jose.bollo@iot.bzh>
Tue, 13 Aug 2019 12:39:15 +0000 (14:39 +0200)
committerJosé Bollo <jose.bollo@iot.bzh>
Fri, 16 Aug 2019 07:47:57 +0000 (09:47 +0200)
Simplifies the way of building dbus-cynara by removing
the specific recipes in favour of a recipe for dbus that
handles the class-target build feature.

It requires to remove fake dependencies of cynara.

This is a suggestion of Tom Rini.

Bug-AGL: SPEC-1839

Change-Id: Id7a736eb4b73cdb679fa9dde30e9ad8e56c2894e
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
meta-agl-profile-core/recipes-core/dbus/dbus-cynara_%.bbappend [deleted symlink]
meta-agl-profile-core/recipes-core/dbus/dbus_%.bbappend
meta-app-framework/conf/include/agl-appfw-smack.inc
meta-security/recipes-core/dbus-cynara/dbus-cynara_1.12.10.bb [deleted file]
meta-security/recipes-core/dbus-cynara/dbus_%.bbappend [deleted file]
meta-security/recipes-core/dbus-cynara/dbus_1.12.10.bbappend [new file with mode: 0644]
meta-security/recipes-security/cynara/cynara_0.14.10.bb

diff --git a/meta-agl-profile-core/recipes-core/dbus/dbus-cynara_%.bbappend b/meta-agl-profile-core/recipes-core/dbus/dbus-cynara_%.bbappend
deleted file mode 120000 (symlink)
index fcdfb17..0000000
+++ /dev/null
@@ -1 +0,0 @@
-dbus_%.bbappend
\ No newline at end of file
index e63ea0f..379c543 100644 (file)
@@ -1,9 +1,9 @@
 FILESEXTRAPATHS_append := ":${THISDIR}/dbus"
 
-SRC_URI_append = "file://dbus.service \
-                  file://dbus.socket \
-                  file://dbus_env.conf \
-                 "
+SRC_URI += "file://dbus.service \
+            file://dbus.socket \
+            file://dbus_env.conf \
+            "
 
 inherit systemd
 
index 95092a9..b6b998a 100644 (file)
@@ -1,6 +1,6 @@
 # enable security features (smack, cynara) - required by Application Framework
 OVERRIDES .= ":with-lsm-smack"
-DISTRO_FEATURES_append = " smack dbus-cynara xattr"
+DISTRO_FEATURES_append = " smack xattr"
 
 # use tar-native to support SMACK extended attributes independently of host config
 IMAGE_CMD_TAR = "tar --xattrs --xattrs-include='*'"
diff --git a/meta-security/recipes-core/dbus-cynara/dbus-cynara_1.12.10.bb b/meta-security/recipes-core/dbus-cynara/dbus-cynara_1.12.10.bb
deleted file mode 100644 (file)
index c54c594..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-require ${COREBASE}/meta/recipes-core/dbus/dbus_1.12.10.bb
-
-FILESEXTRAPATHS_prepend := "${COREBASE}/meta/recipes-core/dbus/dbus:${THISDIR}/dbus-cynara:"
-S = "${WORKDIR}/dbus-${PV}"
-
-SRC_URI_append = "\
-   file://0001-Integration-of-Cynara-asynchronous-security-checks.patch \
-   file://0002-Disable-message-dispatching-when-send-rule-result-is.patch \
-   file://0003-Handle-unavailability-of-policy-results-for-broadcas.patch \
-   file://0004-Add-own-rule-result-unavailability-handling.patch \
-   file://0005-Perform-Cynara-runtime-policy-checks-by-default.patch \
-   file://0006-Fix-gcc-8-warnings.patch \
-"
-
-DEPENDS += "cynara smack"
-RDEPENDS_${PN} += "dbus"
-
-EXTRA_OECONF += "--enable-cynara --disable-selinux"
-
-inherit distro_features_check
-REQUIRED_DISTRO_FEATURES += "smack"
-
-# Only the main package gets created here, everything else remains in the
-# normal dbus recipe.
-do_install_append () {
-    for i in ${@' '.join([d.getVar('D', True) + x for x in (' '.join([d.getVar('FILES_${PN}-' + p, True) or '' for p in ['lib', 'dev', 'staticdev', 'doc', 'locale', 'ptest']])).split()])}; do
-        rm -rf $i
-    done
-
-    # Try to remove empty directories, starting with the
-    # longest path (= deepest directory) first.
-    # Find needs a valid current directory. Somehow the directory
-    # we get called in is gone by the time that we get invoked.
-    ( cd ${D}
-      for i in `find . -type d | sort -r`; do
-        rmdir $i || true
-      done
-    )
-}
-
-# Avoid warning about dbus and dbus-cynara providing dbus-x11.
-RPROVIDES_${PN}_remove = "${OLDPKGNAME}"
diff --git a/meta-security/recipes-core/dbus-cynara/dbus_%.bbappend b/meta-security/recipes-core/dbus-cynara/dbus_%.bbappend
deleted file mode 100644 (file)
index 2923c5c..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/dbus-cynara:"
-
-SRC_URI_append = "\
-   file://0001-Integration-of-Cynara-asynchronous-security-checks.patch \
-   file://0002-Disable-message-dispatching-when-send-rule-result-is.patch \
-   file://0003-Handle-unavailability-of-policy-results-for-broadcas.patch \
-   file://0004-Add-own-rule-result-unavailability-handling.patch \
-   file://0005-Perform-Cynara-runtime-policy-checks-by-default.patch \
-"
-
-# Optionally, compilation of the main package with the daemon gets moved into
-# dbus-cynara. That is necessary to break a dependency cycle once the
-# daemon gets compiled with Cynara support (dbus -> cynara -> systemd
-# -> dbus).
-do_install_append_class-target () {
-    if ${@bb.utils.contains('DISTRO_FEATURES', 'dbus-cynara', 'true', 'false', d)}; then
-        for i in ${@' '.join([d.getVar('D', True) + x for x in (d.getVar('FILES_${PN}', True) or '').split()])}; do
-            rm -rf $i
-        done
-
-        # Try to remove empty directories, starting with the
-        # longest path (= deepest directory) first.
-        # Find needs a valid current directory. Somehow the directory
-        # we get called in is gone by the time that we get invoked.
-        ( cd ${D}
-          for i in `find . -type d | sort -r`; do
-            rmdir $i || true
-          done
-        )
-    fi
-}
-
-# The main package will be empty, but we want to have it created
-# anyway because of the dependencies on it. Installing it will pull in
-# the replacement dbus-cynara package.
-ALLOW_EMPTY_${PN}_class-target = "1"
-RDEPENDS_${PN}_append_class-target = "${@bb.utils.contains('DISTRO_FEATURES', 'dbus-cynara', ' dbus-cynara', '', d)}"
diff --git a/meta-security/recipes-core/dbus-cynara/dbus_1.12.10.bbappend b/meta-security/recipes-core/dbus-cynara/dbus_1.12.10.bbappend
new file mode 100644 (file)
index 0000000..c8f7b5d
--- /dev/null
@@ -0,0 +1,13 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/dbus-cynara:"
+
+SRC_URI_append_class-target = "\
+   file://0001-Integration-of-Cynara-asynchronous-security-checks.patch \
+   file://0002-Disable-message-dispatching-when-send-rule-result-is.patch \
+   file://0003-Handle-unavailability-of-policy-results-for-broadcas.patch \
+   file://0004-Add-own-rule-result-unavailability-handling.patch \
+   file://0005-Perform-Cynara-runtime-policy-checks-by-default.patch \
+"
+
+DEPENDS_append_class-target = " cynara smack"
+EXTRA_OECONF_append_class-target = " ${@bb.utils.contains('DISTRO_FEATURES','smack','--enable-cynara --disable-selinux','',d)}"
+
index d2a09c6..765c17b 100644 (file)
@@ -19,9 +19,7 @@ SRC_URI += " \
 "
 
 DEPENDS = " \
-glib-2.0 \
 systemd \
-zip \
 "
 
 PACKAGECONFIG ??= ""