summaryrefslogtreecommitdiffstats
path: root/recipes-security/selinux/restorecond_3.2.bb
blob: 75e65a834cd0eefb5f8c0792c68c5d124b5182ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
SUMMARY = "Daemon to watch for file creation and set default file context"
DESCRIPTION = "\
The restorecond daemon uses inotify to watch files listed in the \
/etc/selinux/restorecond.conf, when they are created, this daemon \
will make sure they have the correct file context associated with \
the policy."
SECTION = "base"
LICENSE = "GPLv2+"
LIC_FILES_CHKSUM = "file://${S}/COPYING;md5=393a5ca445f6965873eca0259a17f833"

require selinux_common.inc

inherit systemd update-rc.d

DEPENDS += "libsepol libselinux libpcre dbus-glib glib-2.0 pkgconfig-native"

EXTRA_OEMAKE += "SYSTEMDSYSTEMUNITDIR=${systemd_system_unitdir} \
                 SYSTEMDUSERUNITDIR=${systemd_user_unitdir} \
                "

S = "${WORKDIR}/git/restorecond"

FILES:${PN} += "${datadir}/dbus-1/services/org.selinux.Restorecond.service \
                ${systemd_user_unitdir}/* \
               "

SYSTEMD_SERVICE:restorecond = "restorecond.service"
INITSCRIPT_PACKAGES = "restorecond"
INITSCRIPT_NAME:restorecond = "restorecond"
INITSCRIPT_PARAMS:restorecond = "defaults"

do_install:append() {
    if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'false', 'true', d)}; then
        # remove /usr/lib/systemd/user
        rm -rf ${D}${nonarch_libdir}
    fi
}