lh | 758261d | 2023-07-13 05:52:04 -0700 | [diff] [blame^] | 1 | SUMMARY = "Daemon to translate SELinux MCS/MLS sensitivity labels" |
| 2 | DESCRIPTION = "\ |
| 3 | mcstrans provides an translation daemon to translate SELinux categories \ |
| 4 | from internal representations to user defined representation." |
| 5 | |
| 6 | SECTION = "base" |
| 7 | LICENSE = "GPLv2+" |
| 8 | |
| 9 | SRC_URI += "file://mcstrans-de-bashify.patch \ |
| 10 | file://mcstrans-fix-the-init-script.patch \ |
| 11 | " |
| 12 | |
| 13 | inherit systemd update-rc.d |
| 14 | |
| 15 | DEPENDS += "libsepol libselinux libcap" |
| 16 | |
| 17 | # We do not need "${D}/" as a prefix anymore. |
| 18 | EXTRA_OEMAKE += "SBINDIR=${base_sbindir} INITDIR=${sysconfdir}/init.d" |
| 19 | |
| 20 | do_install_append() { |
| 21 | install -d ${D}${sbindir} |
| 22 | install -m 755 utils/untranscon ${D}${sbindir}/ |
| 23 | install -m 755 utils/transcon ${D}${sbindir}/ |
| 24 | |
| 25 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then |
| 26 | install -d ${D}${sysconfdir}/tmpfiles.d |
| 27 | echo "d ${localstatedir}/run/setrans - - - -" \ |
| 28 | > ${D}${sysconfdir}/tmpfiles.d/setrans.conf |
| 29 | else |
| 30 | install -d ${D}${sysconfdir}/default/volatiles |
| 31 | echo "d root root 0755 /var/run/setrans none" \ |
| 32 | >${D}${sysconfdir}/default/volatiles/80_mcstrans |
| 33 | fi |
| 34 | install -d ${D}${datadir}/mcstrans |
| 35 | cp -r share/* ${D}${datadir}/mcstrans/. |
| 36 | } |
| 37 | |
| 38 | SYSTEMD_SERVICE_mcstrans = "mcstrans.service" |
| 39 | INITSCRIPT_PACKAGES = "mcstrans" |
| 40 | INITSCRIPT_NAME_mcstrans = "mcstrans" |
| 41 | INITSCRIPT_PARAMS_mcstrans = "defaults" |
| 42 | |
| 43 | pkg_postinst_mcstrans () { |
| 44 | if [ -z "$D" ]; then |
| 45 | if command -v systemd-tmpfiles >/dev/null; then |
| 46 | systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/setrans.conf |
| 47 | elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then |
| 48 | ${sysconfdir}/init.d/populate-volatile.sh update |
| 49 | fi |
| 50 | fi |
| 51 | } |