aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArmin Kuster <akuster808@gmail.com>2016-10-25 12:21:15 -0700
committerArmin Kuster <akuster808@gmail.com>2016-11-02 09:06:39 -0700
commit742a99778b016f21e8f73a1b2ee013b265d9edd4 (patch)
tree6b84f2a978930296321ebf41a1015db5315f0a61
parentef20cdf6ea6131420a9b92d685372e311366fc82 (diff)
downloadmeta-security-742a99778b016f21e8f73a1b2ee013b265d9edd4.tar.gz
meta-security-742a99778b016f21e8f73a1b2ee013b265d9edd4.tar.bz2
meta-security-742a99778b016f21e8f73a1b2ee013b265d9edd4.zip
smack: Add new package
V2: Fix typo and add LDFLAG to makefile Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--recipes-security/smack/files/run-ptest3
-rw-r--r--recipes-security/smack/files/smack_generator_make_fixup.patch18
-rw-r--r--recipes-security/smack/smack_1.3.0.bb54
3 files changed, 75 insertions, 0 deletions
diff --git a/recipes-security/smack/files/run-ptest b/recipes-security/smack/files/run-ptest
new file mode 100644
index 0000000..049a9b4
--- /dev/null
+++ b/recipes-security/smack/files/run-ptest
@@ -0,0 +1,3 @@
+#!/bin/sh
+./tests/make_policies.bash ./tests/generator
+./tests/make_policies.bash ./tests/generator labels
diff --git a/recipes-security/smack/files/smack_generator_make_fixup.patch b/recipes-security/smack/files/smack_generator_make_fixup.patch
new file mode 100644
index 0000000..4d677e7
--- /dev/null
+++ b/recipes-security/smack/files/smack_generator_make_fixup.patch
@@ -0,0 +1,18 @@
+Upstream-Status: Pending
+
+Signed-off-by: Armin Kuster <akuster808@gmail.com>
+
+
+Index: git/tests/Makefile
+===================================================================
+--- git.orig/tests/Makefile
++++ git/tests/Makefile
+@@ -4,7 +4,7 @@ clean:
+ rm -rf ./out ./generator
+
+ generator: generator.c
+- gcc -Wall -O3 generator.c -o ./generator
++ ${CC} ${LDFLAGS} generator.c -o ./generator
+
+ policies: ./generator ./make_policies.bash
+ ./make_policies.bash ./generator
diff --git a/recipes-security/smack/smack_1.3.0.bb b/recipes-security/smack/smack_1.3.0.bb
new file mode 100644
index 0000000..4c41f6c
--- /dev/null
+++ b/recipes-security/smack/smack_1.3.0.bb
@@ -0,0 +1,54 @@
+DESCRIPTION = "Selection of tools for developers working with Smack"
+HOMEPAGE = "https://github.com/smack-team/smack"
+SECTION = "Security/Access Control"
+LICENSE = "LGPL-2.1"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
+
+SRCREV = "478f68d182c5070f510482194d3e097b11c21907"
+SRC_URI = " \
+ git://github.com/smack-team/smack.git;branch=v1.3.x \
+ file://smack_generator_make_fixup.patch \
+ file://run-ptest"
+
+PV = "1.3.0+git${SRCPV}"
+
+inherit autotools update-rc.d pkgconfig ptest ${@bb.utils.contains('VIRTUAL-RUNTIME_init_manager','systemd','systemd','', d)}
+
+S = "${WORKDIR}/git"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG_append = " ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}"
+
+PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_system_unitdir}, --without-systemdsystemunitdir, systemd"
+
+do_compile_append () {
+ oe_runmake -C ${S}/tests generator
+}
+
+do_install_append () {
+ install -d ${D}${sysconfdir}/init.d
+ install -d ${D}${sysconfdir}/smack
+ install -d ${D}${sysconfdir}/smack/accesses.d
+ install -d ${D}${sysconfdir}/smack/cipso.d
+ install ${S}/init/smack.rc ${D}/${sysconfdir}/init.d/smack
+}
+
+do_install_ptest () {
+ install -d ${D}${PTEST_PATH}/tests
+ install ${S}/tests/generator ${D}/${PTEST_PATH}/tests
+ install ${S}/tests/generate-rules.sh ${D}${PTEST_PATH}/tests
+ install ${S}/tests/make_policies.bash ${D}${PTEST_PATH}/tests
+}
+
+INITSCRIPT_PACKAGES = "${PN}"
+INITSCRIPT_NAME = "smack"
+INITSCRIPT_PARAMS = "start 16 2 3 4 5 . stop 35 0 1 6 ."
+
+FILES_${PN} += "${sysconfdir}/init.d/smack"
+FILES_${PN}-ptest += "generator"
+
+RDEPENDS_${PN} += "coreutils"
+RDEPENDS_${PN}-ptest += "make bash bc"
+
+BBCLASSEXTEND = "native"