diff options
Diffstat (limited to 'recipes-security/selinux/mcstrans_3.6.bb')
-rw-r--r-- | recipes-security/selinux/mcstrans_3.6.bb | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/recipes-security/selinux/mcstrans_3.6.bb b/recipes-security/selinux/mcstrans_3.6.bb new file mode 100644 index 0000000..4a8482f --- /dev/null +++ b/recipes-security/selinux/mcstrans_3.6.bb | |||
@@ -0,0 +1,58 @@ | |||
1 | |||
2 | SUMMARY = "Daemon to translate SELinux MCS/MLS sensitivity labels" | ||
3 | DESCRIPTION = "\ | ||
4 | mcstrans provides an translation daemon to translate SELinux categories \ | ||
5 | from internal representations to user defined representation." | ||
6 | SECTION = "base" | ||
7 | LICENSE = "GPL-2.0-or-later" | ||
8 | LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=94d55d512a9ba36caa9b7df079bae19f" | ||
9 | |||
10 | require selinux_common.inc | ||
11 | |||
12 | inherit pkgconfig systemd update-rc.d | ||
13 | |||
14 | SRC_URI += "file://mcstrans-de-bashify.patch \ | ||
15 | file://mcstrans-fix-the-init-script.patch \ | ||
16 | " | ||
17 | |||
18 | DEPENDS = "libsepol libselinux libcap" | ||
19 | |||
20 | EXTRA_OEMAKE = "SBINDIR=${base_sbindir} \ | ||
21 | INITDIR=${sysconfdir}/init.d \ | ||
22 | SYSTEMDDIR=${systemd_unitdir} \ | ||
23 | " | ||
24 | |||
25 | S = "${WORKDIR}/git/mcstrans" | ||
26 | |||
27 | do_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 | |||
45 | SYSTEMD_SERVICE:mcstrans = "mcstrans.service" | ||
46 | INITSCRIPT_PACKAGES = "mcstrans" | ||
47 | INITSCRIPT_NAME:mcstrans = "mcstrans" | ||
48 | INITSCRIPT_PARAMS:mcstrans = "defaults" | ||
49 | |||
50 | pkg_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 | } | ||