summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2012-01-17 16:51:19 -0600
committerMark Hatle <mark.hatle@windriver.com>2012-01-17 16:51:19 -0600
commitf7c408c0be5cd3ef9f0677c6825dea64824c50f4 (patch)
treef3a3ca170f92f05479a9f642ae9b892047090522
parent75e7b4ffe8d82470e8eb26fee39d26d0a5573220 (diff)
downloadmeta-selinux-f7c408c0be5cd3ef9f0677c6825dea64824c50f4.tar.gz
policycoreutils: Add version 2.1.0
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-rw-r--r--recipes-security/selinux/policycoreutils-2.1.0/makefiles.patch505
-rw-r--r--recipes-security/selinux/policycoreutils_2.1.0.bb52
2 files changed, 557 insertions, 0 deletions
diff --git a/recipes-security/selinux/policycoreutils-2.1.0/makefiles.patch b/recipes-security/selinux/policycoreutils-2.1.0/makefiles.patch
new file mode 100644
index 0000000..7197f16
--- /dev/null
+++ b/recipes-security/selinux/policycoreutils-2.1.0/makefiles.patch
@@ -0,0 +1,505 @@
1Fix cross compilation issues in the Makefiles
2
3Update the makefiles to allow us to specify the appropriate paths
4and cross compilation options.
5
6Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
7
8diff -ur policycoreutils-2.1.0.orig/audit2allow/Makefile policycoreutils-2.1.0/audit2allow/Makefile
9--- policycoreutils-2.1.0.orig/audit2allow/Makefile 2011-07-27 14:32:54.000000000 -0500
10+++ policycoreutils-2.1.0/audit2allow/Makefile 2012-01-17 13:24:12.998786954 -0600
11@@ -1,5 +1,5 @@
12 # Installation directories.
13-PREFIX ?= ${DESTDIR}/usr
14+PREFIX ?= $(DESTDIR)/usr
15 BINDIR ?= $(PREFIX)/bin
16 LIBDIR ?= $(PREFIX)/lib
17 MANDIR ?= $(PREFIX)/share/man
18diff -ur policycoreutils-2.1.0.orig/audit2why/Makefile policycoreutils-2.1.0/audit2why/Makefile
19--- policycoreutils-2.1.0.orig/audit2why/Makefile 2011-07-27 14:32:54.000000000 -0500
20+++ policycoreutils-2.1.0/audit2why/Makefile 2012-01-17 13:24:12.998786954 -0600
21@@ -1,5 +1,5 @@
22 # Installation directories.
23-PREFIX ?= ${DESTDIR}/usr
24+PREFIX ?= $(DESTDIR)/usr
25 BINDIR ?= $(PREFIX)/bin
26 MANDIR ?= $(PREFIX)/share/man
27
28diff -ur policycoreutils-2.1.0.orig/load_policy/Makefile policycoreutils-2.1.0/load_policy/Makefile
29--- policycoreutils-2.1.0.orig/load_policy/Makefile 2011-07-27 14:32:54.000000000 -0500
30+++ policycoreutils-2.1.0/load_policy/Makefile 2012-01-17 13:31:54.708834556 -0600
31@@ -1,25 +1,27 @@
32 # Installation directories.
33-PREFIX ?= ${DESTDIR}/usr
34-SBINDIR ?= $(DESTDIR)/sbin
35-USRSBINDIR ?= $(PREFIX)/sbin
36+PREFIX ?= $(DESTDIR)/usr
37+BASE_SBINDIR ?= $(DESTDIR)/sbin
38+SBINDIR ?= $(PREFIX)/sbin
39 MANDIR ?= $(PREFIX)/share/man
40 LOCALEDIR ?= /usr/share/locale
41+LIBDIR ?= $(PREFIX)/lib
42+INCLUDEDIR ?= $(PREFIX)/include
43
44 CFLAGS ?= -Werror -Wall -W
45-override CFLAGS += $(LDFLAGS) -I$(PREFIX)/include -DUSE_NLS -DLOCALEDIR="\"$(LOCALEDIR)\"" -DPACKAGE="\"policycoreutils\""
46-LDLIBS += -lsepol -lselinux -L$(PREFIX)/lib
47+override CFLAGS += $(LDFLAGS) -I$(INCLUDEDIR) -DUSE_NLS -DLOCALEDIR="\"$(LOCALEDIR)\"" -DPACKAGE="\"policycoreutils\""
48+LDLIBS += -lsepol -lselinux -L$(LIBDIR)
49
50 TARGETS=$(patsubst %.c,%,$(wildcard *.c))
51
52 all: $(TARGETS)
53
54 install: all
55- -mkdir -p $(SBINDIR)
56- install -m 755 $(TARGETS) $(SBINDIR)
57+ -mkdir -p $(BASE_SBINDIR)
58+ install -m 755 $(TARGETS) $(BASE_SBINDIR)
59 test -d $(MANDIR)/man8 || install -m 755 -d $(MANDIR)/man8
60 install -m 644 load_policy.8 $(MANDIR)/man8/
61- -mkdir -p $(USRSBINDIR)
62- ln -sf /sbin/load_policy $(USRSBINDIR)/load_policy
63+ -mkdir -p $(SBINDIR)
64+ ln -sf /sbin/load_policy $(SBINDIR)/load_policy
65
66 clean:
67 -rm -f $(TARGETS) *.o
68@@ -28,4 +30,4 @@
69 ../../scripts/Lindent $(wildcard *.[ch])
70
71 relabel:
72- /sbin/restorecon $(SBINDIR)/load_policy
73+ /sbin/restorecon $(BASE_SBINDIR)/load_policy
74diff -ur policycoreutils-2.1.0.orig/Makefile policycoreutils-2.1.0/Makefile
75--- policycoreutils-2.1.0.orig/Makefile 2011-07-27 14:32:54.000000000 -0500
76+++ policycoreutils-2.1.0/Makefile 2012-01-17 13:24:12.999792401 -0600
77@@ -1,8 +1,8 @@
78 SUBDIRS = setfiles semanage load_policy newrole run_init sandbox secon audit2allow audit2why scripts sestatus semodule_package semodule semodule_link semodule_expand semodule_deps setsebool po
79
80-INOTIFYH = $(shell ls /usr/include/sys/inotify.h 2>/dev/null)
81+INOTIFYH ?= $(shell ls /usr/include/sys/inotify.h 2>/dev/null)
82
83-ifeq (${INOTIFYH}, /usr/include/sys/inotify.h)
84+ifneq ($(INOTIFYH),)
85 SUBDIRS += restorecond
86 endif
87
88diff -ur policycoreutils-2.1.0.orig/mcstrans/src/Makefile policycoreutils-2.1.0/mcstrans/src/Makefile
89--- policycoreutils-2.1.0.orig/mcstrans/src/Makefile 2011-07-27 14:32:54.000000000 -0500
90+++ policycoreutils-2.1.0/mcstrans/src/Makefile 2012-01-17 13:24:13.000791906 -0600
91@@ -1,21 +1,7 @@
92-ARCH = $(shell uname -i)
93-ifeq "$(ARCH)" "x86_64"
94- # In case of 64 bit system, use these lines
95- LIBDIR=/usr/lib64
96-else
97-ifeq "$(ARCH)" "i686"
98- # In case of 32 bit system, use these lines
99- LIBDIR=/usr/lib
100-else
101-ifeq "$(ARCH)" "i386"
102- # In case of 32 bit system, use these lines
103- LIBDIR=/usr/lib
104-endif
105-endif
106-endif
107 # Installation directories.
108 PREFIX ?= $(DESTDIR)/usr
109 SBINDIR ?= $(DESTDIR)/sbin
110+LIBDIR ?= $(PREFIX)/lib
111 INITDIR ?= $(DESTDIR)/etc/rc.d/init.d
112
113 PROG_SRC=mcstrans.c mcscolor.c mcstransd.c mls_level.c
114diff -ur policycoreutils-2.1.0.orig/mcstrans/utils/Makefile policycoreutils-2.1.0/mcstrans/utils/Makefile
115--- policycoreutils-2.1.0.orig/mcstrans/utils/Makefile 2011-07-27 14:32:54.000000000 -0500
116+++ policycoreutils-2.1.0/mcstrans/utils/Makefile 2012-01-17 13:24:13.000791906 -0600
117@@ -1,23 +1,7 @@
118 # Installation directories.
119 PREFIX ?= $(DESTDIR)/usr
120 BINDIR ?= $(PREFIX)/sbin
121-
122-ARCH = $(shell uname -i)
123-ifeq "$(ARCH)" "x86_64"
124- # In case of 64 bit system, use these lines
125- LIBDIR=/usr/lib64
126-else
127-ifeq "$(ARCH)" "i686"
128- # In case of 32 bit system, use these lines
129- LIBDIR=/usr/lib
130-else
131-ifeq "$(ARCH)" "i386"
132- # In case of 32 bit system, use these lines
133- LIBDIR=/usr/lib
134-endif
135-endif
136-endif
137-
138+LIBDIR ?= $(PREFIX)/lib
139
140 CFLAGS ?= -Wall
141 override CFLAGS += -I../src -D_GNU_SOURCE
142diff -ur policycoreutils-2.1.0.orig/newrole/Makefile policycoreutils-2.1.0/newrole/Makefile
143--- policycoreutils-2.1.0.orig/newrole/Makefile 2011-07-27 14:32:54.000000000 -0500
144+++ policycoreutils-2.1.0/newrole/Makefile 2012-01-17 13:35:02.821834567 -0600
145@@ -1,11 +1,13 @@
146 # Installation directories.
147-PREFIX ?= ${DESTDIR}/usr
148+PREFIX ?= $(DESTDIR)/usr
149 BINDIR ?= $(PREFIX)/bin
150 MANDIR ?= $(PREFIX)/share/man
151 ETCDIR ?= $(DESTDIR)/etc
152-LOCALEDIR = /usr/share/locale
153-PAMH = $(shell ls /usr/include/security/pam_appl.h 2>/dev/null)
154-AUDITH = $(shell ls /usr/include/libaudit.h 2>/dev/null)
155+LOCALEDIR ?= /usr/share/locale
156+LIBDIR ?= $(PREFIX)/lib
157+INCLUDEDIR ?= $(PREFIX)/include
158+PAMH ?= $(shell ls $(INCLUDEDIR)/security/pam_appl.h 2>/dev/null)
159+AUDITH ?= $(shell ls $(INCLUDEDIR)/libaudit.h 2>/dev/null)
160 # Enable capabilities to permit newrole to generate audit records.
161 # This will make newrole a setuid root program.
162 # The capabilities used are: CAP_AUDIT_WRITE.
163@@ -22,9 +24,9 @@
164
165 CFLAGS ?= -Werror -Wall -W
166 EXTRA_OBJS =
167-override CFLAGS += -DVERSION=\"$(VERSION)\" $(LDFLAGS) -I$(PREFIX)/include -DUSE_NLS -DLOCALEDIR="\"$(LOCALEDIR)\"" -DPACKAGE="\"policycoreutils\""
168-LDLIBS += -lselinux -L$(PREFIX)/lib
169-ifeq (${PAMH}, /usr/include/security/pam_appl.h)
170+override CFLAGS += -DVERSION=\"$(VERSION)\" $(LDFLAGS) -I$(INCLUDE_DIR) -DUSE_NLS -DLOCALEDIR="\"$(LOCALEDIR)\"" -DPACKAGE="\"policycoreutils\""
171+LDLIBS += -lselinux -L$(LIBDIR)
172+ifneq ($(PAMH),)
173 override CFLAGS += -DUSE_PAM
174 EXTRA_OBJS += hashtab.o
175 LDLIBS += -lpam -lpam_misc
176@@ -32,23 +34,23 @@
177 override CFLAGS += -D_XOPEN_SOURCE=500
178 LDLIBS += -lcrypt
179 endif
180-ifeq (${AUDITH}, /usr/include/libaudit.h)
181+ifneq ($(AUDITH),)
182 override CFLAGS += -DUSE_AUDIT
183 LDLIBS += -laudit
184 endif
185-ifeq (${LSPP_PRIV},y)
186+ifeq ($(LSPP_PRIV),y)
187 override AUDIT_LOG_PRIV=y
188 override NAMESPACE_PRIV=y
189 endif
190-ifeq (${AUDIT_LOG_PRIV},y)
191+ifeq ($(AUDIT_LOG_PRIV),y)
192 override CFLAGS += -DAUDIT_LOG_PRIV
193 IS_SUID=y
194 endif
195-ifeq (${NAMESPACE_PRIV},y)
196+ifeq ($(NAMESPACE_PRIV),y)
197 override CFLAGS += -DNAMESPACE_PRIV
198 IS_SUID=y
199 endif
200-ifeq (${IS_SUID},y)
201+ifeq ($(IS_SUID),y)
202 MODE := 4555
203 LDLIBS += -lcap-ng
204 else
205@@ -66,9 +68,9 @@
206 test -d $(MANDIR)/man1 || install -m 755 -d $(MANDIR)/man1
207 install -m $(MODE) newrole $(BINDIR)
208 install -m 644 newrole.1 $(MANDIR)/man1/
209-ifeq (${PAMH}, /usr/include/security/pam_appl.h)
210+ifneq ($(PAMH),)
211 test -d $(ETCDIR)/pam.d || install -m 755 -d $(ETCDIR)/pam.d
212-ifeq (${LSPP_PRIV},y)
213+ifeq ($(LSPP_PRIV),y)
214 install -m 644 newrole-lspp.pamd $(ETCDIR)/pam.d/newrole
215 else
216 install -m 644 newrole.pamd $(ETCDIR)/pam.d/newrole
217diff -ur policycoreutils-2.1.0.orig/po/Makefile policycoreutils-2.1.0/po/Makefile
218--- policycoreutils-2.1.0.orig/po/Makefile 2011-07-27 14:32:54.000000000 -0500
219+++ policycoreutils-2.1.0/po/Makefile 2012-01-17 13:24:13.002788918 -0600
220@@ -7,7 +7,7 @@
221 # What is this package?
222 NLSPACKAGE = policycoreutils
223 POTFILE = $(NLSPACKAGE).pot
224-INSTALL = /usr/bin/install -c
225+INSTALL = /usr/bin/install -c -p
226 INSTALL_DATA = $(INSTALL) -m 644
227 INSTALL_DIR = /usr/bin/install -d
228
229diff -ur policycoreutils-2.1.0.orig/restorecond/Makefile policycoreutils-2.1.0/restorecond/Makefile
230--- policycoreutils-2.1.0.orig/restorecond/Makefile 2011-07-27 14:32:54.000000000 -0500
231+++ policycoreutils-2.1.0/restorecond/Makefile 2012-01-17 13:32:29.759836181 -0600
232@@ -1,13 +1,15 @@
233 # Installation directories.
234-PREFIX ?= ${DESTDIR}/usr
235+PREFIX ?= $(DESTDIR)/usr
236 SBINDIR ?= $(PREFIX)/sbin
237-MANDIR = $(PREFIX)/share/man
238-INITDIR = $(DESTDIR)/etc/rc.d/init.d
239-SELINUXDIR = $(DESTDIR)/etc/selinux
240+MANDIR ?= $(PREFIX)/share/man
241+INITDIR ?= $(DESTDIR)/etc/rc.d/init.d
242+LIBDIR ?= $(PREFIX)/lib
243+INCLUDEDIR ?= $(PREFIX)/include
244+SELINUXDIR ?= $(DESTDIR)/etc/selinux
245
246 CFLAGS ?= -g -Werror -Wall -W
247-override CFLAGS += -I$(PREFIX)/include -D_FILE_OFFSET_BITS=64
248-LDLIBS += -lselinux -L$(PREFIX)/lib
249+override CFLAGS += -I$(INCLUDEDIR) -D_FILE_OFFSET_BITS=64
250+LDLIBS += -lselinux -L$(LIBDIR)
251
252 all: restorecond
253
254diff -ur policycoreutils-2.1.0.orig/run_init/Makefile policycoreutils-2.1.0/run_init/Makefile
255--- policycoreutils-2.1.0.orig/run_init/Makefile 2011-07-27 14:32:54.000000000 -0500
256+++ policycoreutils-2.1.0/run_init/Makefile 2012-01-17 13:35:26.647834661 -0600
257@@ -1,24 +1,26 @@
258
259 # Installation directories.
260-PREFIX ?= ${DESTDIR}/usr
261+PREFIX ?= $(DESTDIR)/usr
262 SBINDIR ?= $(PREFIX)/sbin
263 MANDIR ?= $(PREFIX)/share/man
264 ETCDIR ?= $(DESTDIR)/etc
265 LOCALEDIR ?= /usr/share/locale
266-PAMH = $(shell ls /usr/include/security/pam_appl.h 2>/dev/null)
267-AUDITH = $(shell ls /usr/include/libaudit.h 2>/dev/null)
268+LIBDIR ?= $(PREFIX)/lib
269+INCLUDEDIR ?= $(PREFIX)/include
270+PAMH ?= $(shell ls $(INCLUDEDIR)/security/pam_appl.h 2>/dev/null)
271+AUDITH ?= $(shell ls $(INCLUDEDIR)/libaudit.h 2>/dev/null)
272
273 CFLAGS ?= -Werror -Wall -W
274-override CFLAGS += -I$(PREFIX)/include -DUSE_NLS -DLOCALEDIR="\"$(LOCALEDIR)\"" -DPACKAGE="\"policycoreutils\""
275-LDLIBS += -lselinux -L$(PREFIX)/lib
276-ifeq (${PAMH}, /usr/include/security/pam_appl.h)
277+override CFLAGS += -I$(INCLUDEDIR) -DUSE_NLS -DLOCALEDIR="\"$(LOCALEDIR)\"" -DPACKAGE="\"policycoreutils\""
278+LDLIBS += -lselinux -L$(LIBDIR)
279+ifneq ($(PAMH),)
280 override CFLAGS += -DUSE_PAM
281 LDLIBS += -lpam -lpam_misc
282 else
283 override CFLAGS += -D_XOPEN_SOURCE=500
284 LDLIBS += -lcrypt
285 endif
286-ifeq (${AUDITH}, /usr/include/libaudit.h)
287+ifneq ($(AUDITH),)
288 override CFLAGS += -DUSE_AUDIT
289 LDLIBS += -laudit
290 endif
291@@ -38,7 +40,7 @@
292 install -m 755 open_init_pty $(SBINDIR)
293 install -m 644 run_init.8 $(MANDIR)/man8/
294 install -m 644 open_init_pty.8 $(MANDIR)/man8/
295-ifeq (${PAMH}, /usr/include/security/pam_appl.h)
296+ifneq ($(PAMH),)
297 install -m 644 run_init.pamd $(ETCDIR)/pam.d/run_init
298 endif
299
300diff -ur policycoreutils-2.1.0.orig/sandbox/Makefile policycoreutils-2.1.0/sandbox/Makefile
301--- policycoreutils-2.1.0.orig/sandbox/Makefile 2011-07-27 14:32:54.000000000 -0500
302+++ policycoreutils-2.1.0/sandbox/Makefile 2012-01-17 13:26:41.147959182 -0600
303@@ -1,13 +1,14 @@
304 # Installation directories.
305-PREFIX ?= ${DESTDIR}/usr
306-INITDIR ?= ${DESTDIR}/etc/rc.d/init.d/
307-SYSCONFDIR ?= ${DESTDIR}/etc/sysconfig
308+PREFIX ?= $(DESTDIR)/usr
309+INITDIR ?= $(DESTDIR)/etc/rc.d/init.d/
310+SYSCONFDIR ?= $(DESTDIR)/etc/sysconfig
311 BINDIR ?= $(PREFIX)/bin
312 SBINDIR ?= $(PREFIX)/sbin
313 MANDIR ?= $(PREFIX)/share/man
314 LOCALEDIR ?= /usr/share/locale
315 SHAREDIR ?= $(PREFIX)/share/sandbox
316-override CFLAGS += $(LDFLAGS) -I$(PREFIX)/include -DPACKAGE="\"policycoreutils\""
317+INCLUDEDIR ?= $(PREFIX)/include
318+override CFLAGS += $(LDFLAGS) -I$(INCLUDEDIR) -DPACKAGE="\"policycoreutils\""
319 LDLIBS += -lselinux -lcap-ng
320
321 all: sandbox seunshare sandboxX.sh
322diff -ur policycoreutils-2.1.0.orig/scripts/Makefile policycoreutils-2.1.0/scripts/Makefile
323--- policycoreutils-2.1.0.orig/scripts/Makefile 2011-07-27 14:32:54.000000000 -0500
324+++ policycoreutils-2.1.0/scripts/Makefile 2012-01-17 13:24:13.004789319 -0600
325@@ -1,5 +1,5 @@
326 # Installation directories.
327-PREFIX ?= ${DESTDIR}/usr
328+PREFIX ?= $(DESTDIR)/usr
329 BINDIR ?= $(PREFIX)/bin
330 SBINDIR ?= $(PREFIX)/sbin
331 MANDIR ?= $(PREFIX)/share/man
332diff -ur policycoreutils-2.1.0.orig/secon/Makefile policycoreutils-2.1.0/secon/Makefile
333--- policycoreutils-2.1.0.orig/secon/Makefile 2011-07-27 14:32:54.000000000 -0500
334+++ policycoreutils-2.1.0/secon/Makefile 2012-01-17 13:24:13.004789319 -0600
335@@ -1,9 +1,9 @@
336 # secon tool - command-line context
337-PREFIX ?= ${DESTDIR}/usr
338+PREFIX ?= $(DESTDIR)/usr
339 INCLUDEDIR ?= $(PREFIX)/include
340 BINDIR ?= $(PREFIX)/bin
341 MANDIR ?= $(PREFIX)/share/man
342-LIBDIR ?= ${PREFIX}/lib
343+LIBDIR ?= $(PREFIX)/lib
344
345 WARNS=-Werror -W -Wall -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wno-format-zero-length -Wformat-nonliteral -Wformat-security -Wfloat-equal
346 VERSION = $(shell cat ../VERSION)
347diff -ur policycoreutils-2.1.0.orig/semanage/Makefile policycoreutils-2.1.0/semanage/Makefile
348--- policycoreutils-2.1.0.orig/semanage/Makefile 2011-07-27 14:32:54.000000000 -0500
349+++ policycoreutils-2.1.0/semanage/Makefile 2012-01-17 13:24:13.005752372 -0600
350@@ -1,5 +1,5 @@
351 # Installation directories.
352-PREFIX ?= ${DESTDIR}/usr
353+PREFIX ?= $(DESTDIR)/usr
354 LIBDIR ?= $(PREFIX)/lib
355 SBINDIR ?= $(PREFIX)/sbin
356 MANDIR = $(PREFIX)/share/man
357diff -ur policycoreutils-2.1.0.orig/semodule/Makefile policycoreutils-2.1.0/semodule/Makefile
358--- policycoreutils-2.1.0.orig/semodule/Makefile 2011-07-27 14:32:54.000000000 -0500
359+++ policycoreutils-2.1.0/semodule/Makefile 2012-01-17 13:24:13.005752372 -0600
360@@ -3,7 +3,7 @@
361 INCLUDEDIR ?= $(PREFIX)/include
362 SBINDIR ?= $(PREFIX)/sbin
363 MANDIR = $(PREFIX)/share/man
364-LIBDIR ?= ${PREFIX}/lib
365+LIBDIR ?= $(PREFIX)/lib
366
367 CFLAGS ?= -Werror -Wall -W
368 override CFLAGS += -I$(INCLUDEDIR)
369diff -ur policycoreutils-2.1.0.orig/semodule_deps/Makefile policycoreutils-2.1.0/semodule_deps/Makefile
370--- policycoreutils-2.1.0.orig/semodule_deps/Makefile 2011-07-27 14:32:54.000000000 -0500
371+++ policycoreutils-2.1.0/semodule_deps/Makefile 2012-01-17 13:24:13.006808131 -0600
372@@ -1,8 +1,8 @@
373 # Installation directories.
374-PREFIX ?= ${DESTDIR}/usr
375+PREFIX ?= $(DESTDIR)/usr
376 INCLUDEDIR ?= $(PREFIX)/include
377 BINDIR ?= $(PREFIX)/bin
378-LIBDIR ?= ${PREFIX}/lib
379+LIBDIR ?= $(PREFIX)/lib
380 MANDIR ?= $(PREFIX)/share/man
381
382 CFLAGS ?= -Werror -Wall -W
383diff -ur policycoreutils-2.1.0.orig/semodule_expand/Makefile policycoreutils-2.1.0/semodule_expand/Makefile
384--- policycoreutils-2.1.0.orig/semodule_expand/Makefile 2011-07-27 14:32:54.000000000 -0500
385+++ policycoreutils-2.1.0/semodule_expand/Makefile 2012-01-17 13:24:13.006808131 -0600
386@@ -1,8 +1,8 @@
387 # Installation directories.
388-PREFIX ?= ${DESTDIR}/usr
389+PREFIX ?= $(DESTDIR)/usr
390 INCLUDEDIR ?= $(PREFIX)/include
391 BINDIR ?= $(PREFIX)/bin
392-LIBDIR ?= ${PREFIX}/lib
393+LIBDIR ?= $(PREFIX)/lib
394 MANDIR ?= $(PREFIX)/share/man
395
396 CFLAGS ?= -Werror -Wall -W
397diff -ur policycoreutils-2.1.0.orig/semodule_link/Makefile policycoreutils-2.1.0/semodule_link/Makefile
398--- policycoreutils-2.1.0.orig/semodule_link/Makefile 2011-07-27 14:32:54.000000000 -0500
399+++ policycoreutils-2.1.0/semodule_link/Makefile 2012-01-17 13:24:13.008837145 -0600
400@@ -1,9 +1,9 @@
401 # Installation directories.
402-PREFIX ?= ${DESTDIR}/usr
403+PREFIX ?= $(DESTDIR)/usr
404 INCLUDEDIR ?= $(PREFIX)/include
405 BINDIR ?= $(PREFIX)/bin
406 MANDIR ?= $(PREFIX)/share/man
407-LIBDIR ?= ${PREFIX}/lib
408+LIBDIR ?= $(PREFIX)/lib
409
410 CFLAGS ?= -Werror -Wall -W
411 override CFLAGS += -I$(INCLUDEDIR)
412diff -ur policycoreutils-2.1.0.orig/semodule_package/Makefile policycoreutils-2.1.0/semodule_package/Makefile
413--- policycoreutils-2.1.0.orig/semodule_package/Makefile 2011-07-27 14:32:54.000000000 -0500
414+++ policycoreutils-2.1.0/semodule_package/Makefile 2012-01-17 13:24:13.009746277 -0600
415@@ -1,8 +1,8 @@
416 # Installation directories.
417-PREFIX ?= ${DESTDIR}/usr
418+PREFIX ?= $(DESTDIR)/usr
419 INCLUDEDIR ?= $(PREFIX)/include
420 BINDIR ?= $(PREFIX)/bin
421-LIBDIR ?= ${PREFIX}/lib
422+LIBDIR ?= $(PREFIX)/lib
423 MANDIR ?= $(PREFIX)/share/man
424
425 CFLAGS ?= -Werror -Wall -W
426diff -ur policycoreutils-2.1.0.orig/sestatus/Makefile policycoreutils-2.1.0/sestatus/Makefile
427--- policycoreutils-2.1.0.orig/sestatus/Makefile 2011-07-27 14:32:54.000000000 -0500
428+++ policycoreutils-2.1.0/sestatus/Makefile 2012-01-17 13:25:58.418959420 -0600
429@@ -1,12 +1,13 @@
430 # Installation directories.
431-PREFIX ?= ${DESTDIR}/usr
432+PREFIX ?= $(DESTDIR)/usr
433 SBINDIR ?= $(PREFIX)/sbin
434-MANDIR = $(PREFIX)/share/man
435+MANDIR ?= $(PREFIX)/share/man
436 ETCDIR ?= $(DESTDIR)/etc
437-LIBDIR ?= ${PREFIX}/lib
438+LIBDIR ?= $(PREFIX)/lib
439+INCLUDEDIR ?= $(PREFIX)/include
440
441 CFLAGS = -Werror -Wall -W
442-override CFLAGS += -I$(PREFIX)/include -D_FILE_OFFSET_BITS=64
443+override CFLAGS += -I$(INCLUDEDIR) -D_FILE_OFFSET_BITS=64
444 LDLIBS = -lselinux -L$(LIBDIR)
445
446 all: sestatus
447diff -ur policycoreutils-2.1.0.orig/setfiles/Makefile policycoreutils-2.1.0/setfiles/Makefile
448--- policycoreutils-2.1.0.orig/setfiles/Makefile 2011-07-27 14:32:54.000000000 -0500
449+++ policycoreutils-2.1.0/setfiles/Makefile 2012-01-17 13:34:38.168834084 -0600
450@@ -1,15 +1,16 @@
451 # Installation directories.
452-PREFIX ?= ${DESTDIR}/usr
453-SBINDIR ?= $(DESTDIR)/sbin
454-MANDIR = $(PREFIX)/share/man
455+PREFIX ?= $(DESTDIR)/usr
456+BASE_SBINDIR ?= $(DESTDIR)/sbin
457+MANDIR ?= $(PREFIX)/share/man
458 LIBDIR ?= $(PREFIX)/lib
459-AUDITH = $(shell ls /usr/include/libaudit.h 2>/dev/null)
460+INCLUDEDIR ?= $(PREFIX)/include
461+AUDITH ?= $(shell ls $(INCLUDEDIR)/libaudit.h 2>/dev/null)
462
463 CFLAGS = -g -Werror -Wall -W
464-override CFLAGS += -I$(PREFIX)/include
465+override CFLAGS += -I$(INCLUDEDIR)
466 LDLIBS = -lselinux -lsepol -L$(LIBDIR)
467
468-ifeq (${AUDITH}, /usr/include/libaudit.h)
469+ifneq ($(AUDITH),)
470 override CFLAGS += -DUSE_AUDIT
471 LDLIBS += -laudit
472 endif
473@@ -23,9 +24,9 @@
474
475 install: all
476 [ -d $(MANDIR)/man8 ] || mkdir -p $(MANDIR)/man8
477- -mkdir -p $(SBINDIR)
478- install -m 755 setfiles $(SBINDIR)
479- (cd $(SBINDIR) && ln -sf setfiles restorecon)
480+ -mkdir -p $(BASE_SBINDIR)
481+ install -m 755 setfiles $(BASE_SBINDIR)
482+ (cd $(BASE_SBINDIR) && ln -sf setfiles restorecon)
483 install -m 644 setfiles.8 restorecon.8 $(MANDIR)/man8
484
485 clean:
486@@ -35,4 +36,4 @@
487 ../../scripts/Lindent $(wildcard *.[ch])
488
489 relabel: install
490- /sbin/restorecon $(SBINDIR)/setfiles
491+ /sbin/restorecon $(BASE_SBINDIR)/setfiles
492diff -ur policycoreutils-2.1.0.orig/setsebool/Makefile policycoreutils-2.1.0/setsebool/Makefile
493--- policycoreutils-2.1.0.orig/setsebool/Makefile 2011-07-27 14:32:54.000000000 -0500
494+++ policycoreutils-2.1.0/setsebool/Makefile 2012-01-17 13:24:59.267961760 -0600
495@@ -2,8 +2,8 @@
496 PREFIX ?= $(DESTDIR)/usr
497 INCLUDEDIR ?= $(PREFIX)/include
498 SBINDIR ?= $(PREFIX)/sbin
499-MANDIR = $(PREFIX)/share/man
500-LIBDIR ?= ${PREFIX}/lib
501+MANDIR ?= $(PREFIX)/share/man
502+LIBDIR ?= $(PREFIX)/lib
503
504 CFLAGS ?= -Werror -Wall -W
505 override CFLAGS += -I$(INCLUDEDIR)
diff --git a/recipes-security/selinux/policycoreutils_2.1.0.bb b/recipes-security/selinux/policycoreutils_2.1.0.bb
new file mode 100644
index 0000000..5cdd8c2
--- /dev/null
+++ b/recipes-security/selinux/policycoreutils_2.1.0.bb
@@ -0,0 +1,52 @@
1SUMMARY = "SELinux policy core utilities"
2DESCRIPTION = "policycoreutils contains the policy core utilities that are required \
3for basic operation of a SELinux system. These utilities include \
4load_policy to load policies, setfiles to label filesystems, newrole \
5to switch roles, and run_init to run /etc/init.d scripts in the proper \
6context."
7SECTION = "base"
8PR = "r1"
9LICENSE = "GPLv2+"
10LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833"
11
12include selinux.inc
13
14SRC_URI += "file://makefiles.patch"
15
16SRC_URI[md5sum] = "f418384ea5bc57080a6ace843646aba9"
17SRC_URI[sha256sum] = "6199b07fd4280e455ea05933cee510b5e09ad3f60b0544382231fe05b787d3f3"
18
19DEPENDS += "libsepol libselinux libsemanage libcap-ng"
20DEPENDS += "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam audit', '', d)}"
21
22RDEPENDS_${PN} += "sepolgen"
23
24EXTRA_OEMAKE += "PREFIX='$(DESTDIR)${prefix}' BASE_SBINDIR='$(DESTDIR)${base_sbindir}' SBINDIR='$(DESTDIR)${sbindir}'"
25EXTRA_OEMAKE += "BINDIR='$(DESTDIR)${bindir}' MANDIR='$(DESTDIR)/${mandir}' LOCALEDIR='$(DESTDIR)/${datadir}/locale'"
26EXTRA_OEMAKE += "ETCDIR='$(DESTDIR)${sysconfdir}' SHAREDIR='$(DESTDIR)${datadir}'"
27EXTRA_OEMAKE += "INITDIR='$(DESTDIR)${sysconfdir}/init.d'"
28EXTRA_OEMAKE += "INCLUDEDIR='${STAGING_INCDIR}' LIBDIR='${STAGING_LIBDIR}'"
29# Main Makefile
30EXTRA_OEMAKE += "INOTIFYH=y"
31# newrole/Makefile
32# Options: PAMH, AUDITH, AUDIT_LOG_PRIV, NAMESPACE_PRIV, LSPP_PRIV
33EXTRA_OEMAKE += "${@base_contains('DISTRO_FEATURES', 'pam', 'PAMH=y AUDITH=y', '', d)}"
34# restorecond/Makefile
35# AUTOSTARTDIR ?= $(DESTDIR)/etc/xdg/autostart DBUSSERVICEDIR ?= $(DESTDIR)/usr/share/dbus-1/services
36# SELINUXDIR ?= $(DESTDIR)/etc/selinux
37# semanage/Makefile
38EXTRA_OEMAKE += "PYLIBVER='python${PYTHON_BASEVERSION}'"
39
40do_compile() {
41 oe_runmake all
42}
43
44do_install() {
45 oe_runmake DESTDIR=${D} install
46
47 if [ "${base_sbindir}" != "${sbindir}" ]; then
48 mv ${D}${base_sbindir}/fixfiles ${D}${sbindir}/fixfiles
49 fi
50
51 rm ${D}${datadir}/sandboxX.sh
52}