summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Julien Pivotto <roidelapluie@inuits.eu> 2016-05-17 21:39:21 +0200
committerAvatar Wulf C. Krueger <philantrop@exherbo.org> 2016-05-21 09:23:21 +0200
commitd23fb47a7366319e1bbddf753d6fe00787584304 (patch)
treebd41070d7f830753a223ae5aaee60d0de5179fcf
parent77582ef1a6425caa53288dfc1c0071db89923fa5 (diff)
downloadselinux-d23fb47a7366319e1bbddf753d6fe00787584304.tar.gz
selinux-d23fb47a7366319e1bbddf753d6fe00787584304.tar.xz
Add checkpolicy
Change-Id: I8324245c3359396875100d07b9b48a5066835ffa Reviewed-on: https://galileo.mailstation.de/gerrit/5973 Retest: Julien Pivotto <roidelapluie@inuits.eu> Reviewed-by: Jenkins <wk@mailstation.de> Reviewed-by: Wulf C. Krueger <philantrop@exherbo.org>
-rw-r--r--packages/security/checkpolicy/checkpolicy-2.5.exheres-032
-rw-r--r--packages/security/checkpolicy/files/checkpolicy-Allow-to-override-LEX.patch27
-rw-r--r--packages/security/checkpolicy/files/checkpolicy-Do-not-link-against-libfl.patch48
3 files changed, 107 insertions, 0 deletions
diff --git a/packages/security/checkpolicy/checkpolicy-2.5.exheres-0 b/packages/security/checkpolicy/checkpolicy-2.5.exheres-0
new file mode 100644
index 0000000..f56083c
--- /dev/null
+++ b/packages/security/checkpolicy/checkpolicy-2.5.exheres-0
@@ -0,0 +1,32 @@
+# Copyright 2016 Julien Pivotto <roidelapluie@inuits.eu>
+# Distributed under the terms of the GNU General Public License v2
+
+require github [ user=SELinuxProject tag="${PNV}" pn=selinux ]
+
+SUMMARY="SELinux policy compiler"
+DESCRIPTION="Checks and compiles a SELinux security policy configuration into a binary
+representation that can be loaded into the kernel."
+
+BUGS_TO="roidelapluie@inuits.eu"
+
+LICENCES="GPL-2"
+SLOT="0"
+PLATFORMS="~amd64"
+
+DEPENDENCIES="
+ build+run:
+ security/libsepol[~${PV}]
+"
+
+DEFAULT_SRC_PREPARE_PATCHES=(
+ "${FILES}/${PN}-Do-not-link-against-libfl.patch"
+ "${FILES}/${PN}-Allow-to-override-LEX.patch"
+)
+
+DEFAULT_SRC_INSTALL_PARAMS=(
+ PREFIX="${IMAGE}/usr/$(exhost --target)"
+ MANDIR="${IMAGE}/usr/share/man"
+)
+
+WORK="${WORKBASE}/selinux-${PNV}/${PN}"
+
diff --git a/packages/security/checkpolicy/files/checkpolicy-Allow-to-override-LEX.patch b/packages/security/checkpolicy/files/checkpolicy-Allow-to-override-LEX.patch
new file mode 100644
index 0000000..19dac4e
--- /dev/null
+++ b/packages/security/checkpolicy/files/checkpolicy-Allow-to-override-LEX.patch
@@ -0,0 +1,27 @@
+From 656232ced7ed92f340fe08b0ad6d5931e6715500 Mon Sep 17 00:00:00 2001
+From: Julien Pivotto <roidelapluie@inuits.eu>
+Date: Mon, 16 May 2016 23:41:31 +0200
+Subject: [PATCH 2/2] checkpolicy, libsemanage, libsepol: Allow to override
+ Makefile LEX
+Source: Exherbo
+Upstream: Pending
+
+---
+ checkpolicy/Makefile | 1 +
+ 1 files changed, 1 insertions(+)
+
+diff --git a/Makefile b/Makefile
+index e5fae3d..ff75adf 100644
+--- a/Makefile
++++ b/Makefile
+@@ -9,6 +9,7 @@ INCLUDEDIR ?= $(PREFIX)/include
+ TARGETS = checkpolicy checkmodule
+
+ YACC = bison -y
++LEX = flex
+
+ CFLAGS ?= -g -Wall -Werror -Wshadow -O2 -pipe -fno-strict-aliasing
+
+--
+2.6.1
+
diff --git a/packages/security/checkpolicy/files/checkpolicy-Do-not-link-against-libfl.patch b/packages/security/checkpolicy/files/checkpolicy-Do-not-link-against-libfl.patch
new file mode 100644
index 0000000..2ee37c8
--- /dev/null
+++ b/packages/security/checkpolicy/files/checkpolicy-Do-not-link-against-libfl.patch
@@ -0,0 +1,48 @@
+From: Chong Lu <Chong.Lu at windriver.com>
+Subject: checkpolicy: Don't link against libfl
+Upstream: no
+Source: yoctoproject
+Reason: Fix compilation error
+
+
+In policy_scan.l file, we have already removed all references to yywrap by
+adding "%option noyywrap" statements to each flex source file that doesn't
+override yywrap. After this, we no longer need to link against libfl and so
+no longer get errors about undefined references to yylex.
+
+Upstream-status: Pending
+
+Signed-off-by: Chong Lu <Chong.Lu at windriver.com>
+---
+ Makefile | 2 +-
+ test/Makefile | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index e5fae3d..14ac70e 100644
+--- a/Makefile
++++ b/Makefile
+@@ -19,7 +19,7 @@ CHECKOBJS = y.tab.o lex.yy.o queue.o module_compiler.o parse_util.o \
+ CHECKPOLOBJS = $(CHECKOBJS) checkpolicy.o
+ CHECKMODOBJS = $(CHECKOBJS) checkmodule.o
+
+-LDLIBS=$(LIBDIR)/libsepol.a -lfl
++LDLIBS=$(LIBDIR)/libsepol.a
+
+ GENERATED=lex.yy.c y.tab.c y.tab.h
+
+diff --git a/test/Makefile b/test/Makefile
+index 63b4d24..0f19a8a 100644
+--- a/test/Makefile
++++ b/test/Makefile
+@@ -9,7 +9,7 @@ INCLUDEDIR ?= $(PREFIX)/include
+ CFLAGS ?= -g -Wall -W -Werror -O2 -pipe
+ override CFLAGS += -I$(INCLUDEDIR)
+
+-LDLIBS=-lfl $(LIBDIR)/libsepol.a -L$(LIBDIR)
++LDLIBS=$(LIBDIR)/libsepol.a -L$(LIBDIR)
+
+ all: dispol dismod
+
+--
+1.7.9.5