diff mbox

[v2,01/28] checkpolicy: new package

Message ID 1420650663-49350-2-git-send-email-matthew.weber@rockwellcollins.com
State Accepted
Headers show

Commit Message

Matt Weber Jan. 7, 2015, 5:10 p.m. UTC
From: Clayton Shotwell <clshotwe@rockwellcollins.com>

Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
Signed-off-by: Clayton Shotwell <clshotwe@rockwellcollins.com>
---
[Matt W:
  - Updated site to github
  - Added hash
  - Moved make install to have install at end of command

 package/Config.in.host               |  1 +
 package/checkpolicy/Config.in.host   | 10 ++++++++++
 package/checkpolicy/checkpolicy.hash |  2 ++
 package/checkpolicy/checkpolicy.mk   | 26 ++++++++++++++++++++++++++
 4 files changed, 39 insertions(+)
 create mode 100644 package/checkpolicy/Config.in.host
 create mode 100644 package/checkpolicy/checkpolicy.hash
 create mode 100644 package/checkpolicy/checkpolicy.mk

Comments

Thomas Petazzoni Jan. 8, 2015, 10:04 p.m. UTC | #1
Dear Matt Weber,

On Wed,  7 Jan 2015 11:10:36 -0600, Matt Weber wrote:
> From: Clayton Shotwell <clshotwe@rockwellcollins.com>
> 
> Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
> Signed-off-by: Clayton Shotwell <clshotwe@rockwellcollins.com>

Thanks, applied with minor tweaks:

    [Thomas:
     - Indicate in the Config.in help text that this policy compiler is
       SELinux related.
     - Rewrap Config.in help text and remove trailing white space.
     - Add a comment in the .mk file to indicate why we're passing
       DESTDIR= at build time.]

Thomas
diff mbox

Patch

diff --git a/package/Config.in.host b/package/Config.in.host
index 9b127c8..94981ad 100644
--- a/package/Config.in.host
+++ b/package/Config.in.host
@@ -1,5 +1,6 @@ 
 menu "Host utilities"
 
+	source "package/checkpolicy/Config.in.host"
 	source "package/cramfs/Config.in.host"
 	source "package/dfu-util/Config.in.host"
 	source "package/dos2unix/Config.in.host"
diff --git a/package/checkpolicy/Config.in.host b/package/checkpolicy/Config.in.host
new file mode 100644
index 0000000..75794be
--- /dev/null
+++ b/package/checkpolicy/Config.in.host
@@ -0,0 +1,10 @@ 
+config BR2_PACKAGE_HOST_CHECKPOLICY
+	bool "host checkpolicy"
+	help
+	  checkpolicy is the policy compiler. It uses libsepol to 
+	  generate the binary policy. checkpolicy uses the static 
+	  libsepol since it deals with low level details of the policy 
+	  that have not been encapsulated/abstracted by a proper 
+	  shared library interface. 
+	  
+	  http://selinuxproject.org/page/Main_Page
diff --git a/package/checkpolicy/checkpolicy.hash b/package/checkpolicy/checkpolicy.hash
new file mode 100644
index 0000000..32b5ff6
--- /dev/null
+++ b/package/checkpolicy/checkpolicy.hash
@@ -0,0 +1,2 @@ 
+# https://github.com/SELinuxProject/selinux/wiki/Releases
+sha256 e6a0ac539b74859b4262b317eb90d9914deb15e7aa509659f47724d50fe2ecc6  checkpolicy-2.1.12.tar.gz
diff --git a/package/checkpolicy/checkpolicy.mk b/package/checkpolicy/checkpolicy.mk
new file mode 100644
index 0000000..7f0b069
--- /dev/null
+++ b/package/checkpolicy/checkpolicy.mk
@@ -0,0 +1,26 @@ 
+################################################################################
+#
+# checkpolicy
+#
+################################################################################
+
+CHECKPOLICY_VERSION = 2.1.12
+CHECKPOLICY_SITE = https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20130423
+CHECKPOLICY_LICENSE = GPLv2
+CHECKPOLICY_LICENSE_FILES = COPYING
+
+HOST_CHECKPOLICY_DEPENDENCIES = host-libselinux host-flex host-bison
+
+HOST_CHECKPOLICY_MAKE_OPTS = $(HOST_CONFIGURE_OPTS) \
+	LEX="$(HOST_DIR)/usr/bin/flex" \
+	YACC="$(HOST_DIR)/usr/bin/bison -y"
+
+define HOST_CHECKPOLICY_BUILD_CMDS
+	$(MAKE) -C $(@D) $(HOST_CHECKPOLICY_MAKE_OPTS) DESTDIR=$(HOST_DIR)
+endef
+
+define HOST_CHECKPOLICY_INSTALL_CMDS
+	$(MAKE) -C $(@D) $(HOST_CHECKPOLICY_MAKE_OPTS) DESTDIR=$(HOST_DIR) install
+endef
+
+$(eval $(host-generic-package))