From 45e06de91f71020cebdad19dc0337315127da3e0 Mon Sep 17 00:00:00 2001 From: Yi Zhao Date: Sat, 13 Mar 2021 13:50:37 +0800 Subject: mcstrans: update to 3.2 Merge inc file into bb file. Signed-off-by: Yi Zhao Signed-off-by: Joe MacDonald --- recipes-security/selinux/mcstrans.inc | 53 ----------------------------- recipes-security/selinux/mcstrans_3.1.bb | 7 ---- recipes-security/selinux/mcstrans_3.2.bb | 58 ++++++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+), 60 deletions(-) delete mode 100644 recipes-security/selinux/mcstrans.inc delete mode 100644 recipes-security/selinux/mcstrans_3.1.bb create mode 100644 recipes-security/selinux/mcstrans_3.2.bb diff --git a/recipes-security/selinux/mcstrans.inc b/recipes-security/selinux/mcstrans.inc deleted file mode 100644 index 52b95c6..0000000 --- a/recipes-security/selinux/mcstrans.inc +++ /dev/null @@ -1,53 +0,0 @@ -SUMMARY = "Daemon to translate SELinux MCS/MLS sensitivity labels" -DESCRIPTION = "\ -mcstrans provides an translation daemon to translate SELinux categories \ -from internal representations to user defined representation." - -SECTION = "base" -LICENSE = "GPLv2+" - -SRC_URI += "file://mcstrans-de-bashify.patch \ - file://mcstrans-fix-the-init-script.patch \ -" - -inherit systemd update-rc.d - -DEPENDS += "libsepol libselinux libcap" - -EXTRA_OEMAKE += "SBINDIR=${base_sbindir} \ - INITDIR=${sysconfdir}/init.d \ - SYSTEMDDIR=${systemd_unitdir} \ - " - -do_install_append() { - install -d ${D}${sbindir} - install -m 755 utils/untranscon ${D}${sbindir}/ - install -m 755 utils/transcon ${D}${sbindir}/ - - if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then - install -d ${D}${sysconfdir}/tmpfiles.d - echo "d ${localstatedir}/run/setrans - - - -" \ - > ${D}${sysconfdir}/tmpfiles.d/setrans.conf - else - install -d ${D}${sysconfdir}/default/volatiles - echo "d root root 0755 /var/run/setrans none" \ - >${D}${sysconfdir}/default/volatiles/80_mcstrans - fi - install -d ${D}${datadir}/mcstrans - cp -r share/* ${D}${datadir}/mcstrans/. -} - -SYSTEMD_SERVICE_mcstrans = "mcstrans.service" -INITSCRIPT_PACKAGES = "mcstrans" -INITSCRIPT_NAME_mcstrans = "mcstrans" -INITSCRIPT_PARAMS_mcstrans = "defaults" - -pkg_postinst_mcstrans () { - if [ -z "$D" ]; then - if command -v systemd-tmpfiles >/dev/null; then - systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/setrans.conf - elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then - ${sysconfdir}/init.d/populate-volatile.sh update - fi - fi -} diff --git a/recipes-security/selinux/mcstrans_3.1.bb b/recipes-security/selinux/mcstrans_3.1.bb deleted file mode 100644 index 26bb299..0000000 --- a/recipes-security/selinux/mcstrans_3.1.bb +++ /dev/null @@ -1,7 +0,0 @@ -require selinux_20200710.inc -require ${BPN}.inc - -LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" - -SRC_URI[md5sum] = "18b7bf8193dd2360bc60f0e2639009ab" -SRC_URI[sha256sum] = "cc918576c17340fc944849d785e2a7400b269ef079a36b871c140504164d6a45" diff --git a/recipes-security/selinux/mcstrans_3.2.bb b/recipes-security/selinux/mcstrans_3.2.bb new file mode 100644 index 0000000..0cece17 --- /dev/null +++ b/recipes-security/selinux/mcstrans_3.2.bb @@ -0,0 +1,58 @@ + +SUMMARY = "Daemon to translate SELinux MCS/MLS sensitivity labels" +DESCRIPTION = "\ +mcstrans provides an translation daemon to translate SELinux categories \ +from internal representations to user defined representation." +SECTION = "base" +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://${S}/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" + +require selinux_common.inc + +inherit systemd update-rc.d + +SRC_URI += "file://mcstrans-de-bashify.patch \ + file://mcstrans-fix-the-init-script.patch \ + " + +DEPENDS += "libsepol libselinux libcap" + +EXTRA_OEMAKE += "SBINDIR=${base_sbindir} \ + INITDIR=${sysconfdir}/init.d \ + SYSTEMDDIR=${systemd_unitdir} \ + " + +S = "${WORKDIR}/git/mcstrans" + +do_install_append() { + install -d ${D}${sbindir} + install -m 755 utils/untranscon ${D}${sbindir}/ + install -m 755 utils/transcon ${D}${sbindir}/ + + if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then + install -d ${D}${sysconfdir}/tmpfiles.d + echo "d ${localstatedir}/run/setrans - - - -" \ + > ${D}${sysconfdir}/tmpfiles.d/setrans.conf + else + install -d ${D}${sysconfdir}/default/volatiles + echo "d root root 0755 /var/run/setrans none" \ + >${D}${sysconfdir}/default/volatiles/80_mcstrans + fi + install -d ${D}${datadir}/mcstrans + cp -r share/* ${D}${datadir}/mcstrans/. +} + +SYSTEMD_SERVICE_mcstrans = "mcstrans.service" +INITSCRIPT_PACKAGES = "mcstrans" +INITSCRIPT_NAME_mcstrans = "mcstrans" +INITSCRIPT_PARAMS_mcstrans = "defaults" + +pkg_postinst_mcstrans () { + if [ -z "$D" ]; then + if command -v systemd-tmpfiles >/dev/null; then + systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/setrans.conf + elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then + ${sysconfdir}/init.d/populate-volatile.sh update + fi + fi +} -- cgit v1.2.3-54-g00ecf