summaryrefslogtreecommitdiffstats
path: root/recipes-security/selinux/mcstrans_3.5.bb
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-security/selinux/mcstrans_3.5.bb')
-rw-r--r--recipes-security/selinux/mcstrans_3.5.bb58
1 files changed, 58 insertions, 0 deletions
diff --git a/recipes-security/selinux/mcstrans_3.5.bb b/recipes-security/selinux/mcstrans_3.5.bb
new file mode 100644
index 0000000..4a8482f
--- /dev/null
+++ b/recipes-security/selinux/mcstrans_3.5.bb
@@ -0,0 +1,58 @@
1
2SUMMARY = "Daemon to translate SELinux MCS/MLS sensitivity labels"
3DESCRIPTION = "\
4mcstrans provides an translation daemon to translate SELinux categories \
5from internal representations to user defined representation."
6SECTION = "base"
7LICENSE = "GPL-2.0-or-later"
8LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=94d55d512a9ba36caa9b7df079bae19f"
9
10require selinux_common.inc
11
12inherit pkgconfig systemd update-rc.d
13
14SRC_URI += "file://mcstrans-de-bashify.patch \
15 file://mcstrans-fix-the-init-script.patch \
16 "
17
18DEPENDS = "libsepol libselinux libcap"
19
20EXTRA_OEMAKE = "SBINDIR=${base_sbindir} \
21 INITDIR=${sysconfdir}/init.d \
22 SYSTEMDDIR=${systemd_unitdir} \
23 "
24
25S = "${WORKDIR}/git/mcstrans"
26
27do_install:append() {
28 install -d ${D}${sbindir}
29 install -m 755 utils/untranscon ${D}${sbindir}/
30 install -m 755 utils/transcon ${D}${sbindir}/
31
32 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
33 install -d ${D}${sysconfdir}/tmpfiles.d
34 echo "d ${localstatedir}/run/setrans - - - -" \
35 > ${D}${sysconfdir}/tmpfiles.d/setrans.conf
36 else
37 install -d ${D}${sysconfdir}/default/volatiles
38 echo "d root root 0755 /var/run/setrans none" \
39 >${D}${sysconfdir}/default/volatiles/80_mcstrans
40 fi
41 install -d ${D}${datadir}/mcstrans
42 cp -r share/* ${D}${datadir}/mcstrans/.
43}
44
45SYSTEMD_SERVICE:mcstrans = "mcstrans.service"
46INITSCRIPT_PACKAGES = "mcstrans"
47INITSCRIPT_NAME:mcstrans = "mcstrans"
48INITSCRIPT_PARAMS:mcstrans = "defaults"
49
50pkg_postinst:mcstrans () {
51 if [ -z "$D" ]; then
52 if command -v systemd-tmpfiles >/dev/null; then
53 systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/setrans.conf
54 elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then
55 ${sysconfdir}/init.d/populate-volatile.sh update
56 fi
57 fi
58}