1 DESCRIPTION = "Security manager and utilities"
3 LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327;beginline=3"
7 # Out-of-tree build is broken ("sqlite3 .security-manager.db <db.sql" where db.sql is in $S/db).
23 PACKAGECONFIG[debug] = "-DCMAKE_BUILD_TYPE=DEBUG,-DCMAKE_BUILD_TYPE=RELEASE"
25 TZ_SYS_DB = "/var/db/security-manager"
28 -DCMAKE_VERBOSE_MAKEFILE=ON \
30 -DSYSTEMD_INSTALL_DIR=${systemd_unitdir}/system \
31 -DBIN_INSTALL_DIR=${bindir} \
32 -DDB_INSTALL_DIR=${TZ_SYS_DB} \
33 -DLIB_INSTALL_DIR=${libdir} \
34 -DSHARE_INSTALL_PREFIX=${datadir} \
35 -DINCLUDE_INSTALL_DIR=${includedir} \
39 SYSTEMD_SERVICE_${PN} = "security-manager.service"
41 inherit distro_features_check
42 REQUIRED_DISTRO_FEATURES += "smack"
44 # The upstream source code contains the Tizen-specific policy configuration files.
45 # To replace them, create a security-manager.bbappend and set the following variable to a
46 # space-separated list of policy file names (not URIs!), for example:
47 # SECURITY_MANAGER_POLICY = "privilege-group.list usertype-system.profile"
49 # Leave it empty to use the upstream Tizen policy.
50 SECURITY_MANAGER_POLICY ?= ""
51 SRC_URI_append = " ${@' '.join(['file://' + x for x in d.getVar('SECURITY_MANAGER_POLICY', True).split()])}"
52 python do_patch_append () {
56 files = d.getVar('SECURITY_MANAGER_POLICY', True).split()
58 s = d.getVar('S', True)
59 workdir = d.getVar('WORKDIR', True)
60 for pattern in ['*.profile', '*.list']:
61 for old_file in glob.glob(s + '/policy/' + pattern):
64 shutil.copy(file, s + '/policy')
67 do_install_append () {
68 install -d ${D}/${systemd_unitdir}/system/multi-user.target.wants
69 ln -s ../security-manager.service ${D}/${systemd_unitdir}/system/multi-user.target.wants/security-manager.service
70 install -d ${D}/${systemd_unitdir}/system/sockets.target.wants
71 ln -s ../security-manager.socket ${D}/${systemd_unitdir}/system/sockets.target.wants/security-manager.socket
74 RDEPENDS_${PN} += "smack"
75 pkg_postinst_${PN} () {
77 chsmack -a System $D${TZ_SYS_DB}/.security-manager.db
78 chsmack -a System $D${TZ_SYS_DB}/.security-manager.db-journal
86 PACKAGES =+ "${PN}-policy"
87 FILES_${PN}-policy = " \
89 ${bindir}/security-manager-policy-reload \
91 RDEPENDS_${PN}-policy += "sqlite3 cynara"
92 pkg_postinst_${PN}-policy () {
93 if [ x"$D" = "x" ] && ${bindir}/security-manager-policy-reload; then