aboutsummaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorDominick Grift <dominick.grift@defensec.nl>2020-09-30 12:21:19 +0200
committerDaniel Golle <daniel@makrotopia.org>2020-10-09 02:10:05 +0100
commitbf12f05bbfd50ba6f8f9c49a8980239efcc29930 (patch)
tree3a920547d05401a20e4ef552097930c52cb27408 /package
parent9ee7c1ec60e23f25f5d275c6439ce93aec914e1c (diff)
downloadupstream-bf12f05bbfd50ba6f8f9c49a8980239efcc29930.tar.gz
upstream-bf12f05bbfd50ba6f8f9c49a8980239efcc29930.tar.bz2
upstream-bf12f05bbfd50ba6f8f9c49a8980239efcc29930.zip
selinux-policy: adds new package
Signed-off-by: Dominick Grift <dominick.grift@defensec.nl>
Diffstat (limited to 'package')
-rw-r--r--package/system/selinux-policy/Makefile53
-rw-r--r--package/system/selinux-policy/files/selinux-config2
2 files changed, 55 insertions, 0 deletions
diff --git a/package/system/selinux-policy/Makefile b/package/system/selinux-policy/Makefile
new file mode 100644
index 0000000000..3b887ff8d6
--- /dev/null
+++ b/package/system/selinux-policy/Makefile
@@ -0,0 +1,53 @@
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=selinux-policy
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://git.defensec.nl/selinux-policy.git
+PKG_SOURCE_DATE:=2020-10-08
+PKG_SOURCE_VERSION:=cdedea73ecbb8968f9736c35c143b586c8371467
+PKG_MIRROR_HASH:=3d5a6d60b496b51ae272f7cb495a409c724ee193792f78652a2040b57fab56fe
+PKG_BUILD_DEPENDS:=secilc/host policycoreutils/host
+
+PKG_MAINTAINER:=Dominick Grift <dominick.grift@defensec.nl>
+PKG_CPE_ID:=cpe:/a:defensec:selinux-policy
+PKG_LICENSE:=Unlicense
+PKG_LICENSE_FILES:=LICENSE
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/selinux-policy
+ SECTION:=system
+ CATEGORY:=Base system
+ TITLE:=SELinux security policy for OpenWrt
+ URL:=https://git.defensec.nl/?p=selinux-policy.git;a=summary
+ PKGARCH:=all
+endef
+
+define Package/selinux-policy/description
+ Basic SELinux Security Policy designed specifically for
+ OpenWrt and written in Common Intermediate Language.
+endef
+
+define Build/Compile
+ $(call Build/Compile/Default,policy)
+endef
+
+define Package/selinux-policy/conffiles
+/etc/selinux/config
+endef
+
+define Package/selinux-policy/install
+ $(INSTALL_DIR) $(1)/etc/selinux/$(PKG_NAME)/contexts/files/
+ $(INSTALL_DIR) $(1)/etc/selinux/$(PKG_NAME)/policy/
+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/file_contexts.subs_dist $(1)/etc/selinux/$(PKG_NAME)/contexts/files/
+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/file_contexts $(1)/etc/selinux/$(PKG_NAME)/contexts/files/
+ $(INSTALL_CONF) $(PKG_BUILD_DIR)/policy.* $(1)/etc/selinux/$(PKG_NAME)/policy/
+ $(INSTALL_DATA) ./files/selinux-config $(1)/etc/selinux/config
+endef
+
+$(eval $(call BuildPackage,selinux-policy))
diff --git a/package/system/selinux-policy/files/selinux-config b/package/system/selinux-policy/files/selinux-config
new file mode 100644
index 0000000000..ae5188a839
--- /dev/null
+++ b/package/system/selinux-policy/files/selinux-config
@@ -0,0 +1,2 @@
+SELINUX=enforcing
+SELINUXTYPE=selinux-policy