From f7c408c0be5cd3ef9f0677c6825dea64824c50f4 Mon Sep 17 00:00:00 2001 From: Mark Hatle Date: Tue, 17 Jan 2012 16:51:19 -0600 Subject: policycoreutils: Add version 2.1.0 Signed-off-by: Mark Hatle --- .../selinux/policycoreutils-2.1.0/makefiles.patch | 505 +++++++++++++++++++++ recipes-security/selinux/policycoreutils_2.1.0.bb | 52 +++ 2 files changed, 557 insertions(+) create mode 100644 recipes-security/selinux/policycoreutils-2.1.0/makefiles.patch create mode 100644 recipes-security/selinux/policycoreutils_2.1.0.bb 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 @@ +Fix cross compilation issues in the Makefiles + +Update the makefiles to allow us to specify the appropriate paths +and cross compilation options. + +Signed-off-by: Mark Hatle + +diff -ur policycoreutils-2.1.0.orig/audit2allow/Makefile policycoreutils-2.1.0/audit2allow/Makefile +--- policycoreutils-2.1.0.orig/audit2allow/Makefile 2011-07-27 14:32:54.000000000 -0500 ++++ policycoreutils-2.1.0/audit2allow/Makefile 2012-01-17 13:24:12.998786954 -0600 +@@ -1,5 +1,5 @@ + # Installation directories. +-PREFIX ?= ${DESTDIR}/usr ++PREFIX ?= $(DESTDIR)/usr + BINDIR ?= $(PREFIX)/bin + LIBDIR ?= $(PREFIX)/lib + MANDIR ?= $(PREFIX)/share/man +diff -ur policycoreutils-2.1.0.orig/audit2why/Makefile policycoreutils-2.1.0/audit2why/Makefile +--- policycoreutils-2.1.0.orig/audit2why/Makefile 2011-07-27 14:32:54.000000000 -0500 ++++ policycoreutils-2.1.0/audit2why/Makefile 2012-01-17 13:24:12.998786954 -0600 +@@ -1,5 +1,5 @@ + # Installation directories. +-PREFIX ?= ${DESTDIR}/usr ++PREFIX ?= $(DESTDIR)/usr + BINDIR ?= $(PREFIX)/bin + MANDIR ?= $(PREFIX)/share/man + +diff -ur policycoreutils-2.1.0.orig/load_policy/Makefile policycoreutils-2.1.0/load_policy/Makefile +--- policycoreutils-2.1.0.orig/load_policy/Makefile 2011-07-27 14:32:54.000000000 -0500 ++++ policycoreutils-2.1.0/load_policy/Makefile 2012-01-17 13:31:54.708834556 -0600 +@@ -1,25 +1,27 @@ + # Installation directories. +-PREFIX ?= ${DESTDIR}/usr +-SBINDIR ?= $(DESTDIR)/sbin +-USRSBINDIR ?= $(PREFIX)/sbin ++PREFIX ?= $(DESTDIR)/usr ++BASE_SBINDIR ?= $(DESTDIR)/sbin ++SBINDIR ?= $(PREFIX)/sbin + MANDIR ?= $(PREFIX)/share/man + LOCALEDIR ?= /usr/share/locale ++LIBDIR ?= $(PREFIX)/lib ++INCLUDEDIR ?= $(PREFIX)/include + + CFLAGS ?= -Werror -Wall -W +-override CFLAGS += $(LDFLAGS) -I$(PREFIX)/include -DUSE_NLS -DLOCALEDIR="\"$(LOCALEDIR)\"" -DPACKAGE="\"policycoreutils\"" +-LDLIBS += -lsepol -lselinux -L$(PREFIX)/lib ++override CFLAGS += $(LDFLAGS) -I$(INCLUDEDIR) -DUSE_NLS -DLOCALEDIR="\"$(LOCALEDIR)\"" -DPACKAGE="\"policycoreutils\"" ++LDLIBS += -lsepol -lselinux -L$(LIBDIR) + + TARGETS=$(patsubst %.c,%,$(wildcard *.c)) + + all: $(TARGETS) + + install: all +- -mkdir -p $(SBINDIR) +- install -m 755 $(TARGETS) $(SBINDIR) ++ -mkdir -p $(BASE_SBINDIR) ++ install -m 755 $(TARGETS) $(BASE_SBINDIR) + test -d $(MANDIR)/man8 || install -m 755 -d $(MANDIR)/man8 + install -m 644 load_policy.8 $(MANDIR)/man8/ +- -mkdir -p $(USRSBINDIR) +- ln -sf /sbin/load_policy $(USRSBINDIR)/load_policy ++ -mkdir -p $(SBINDIR) ++ ln -sf /sbin/load_policy $(SBINDIR)/load_policy + + clean: + -rm -f $(TARGETS) *.o +@@ -28,4 +30,4 @@ + ../../scripts/Lindent $(wildcard *.[ch]) + + relabel: +- /sbin/restorecon $(SBINDIR)/load_policy ++ /sbin/restorecon $(BASE_SBINDIR)/load_policy +diff -ur policycoreutils-2.1.0.orig/Makefile policycoreutils-2.1.0/Makefile +--- policycoreutils-2.1.0.orig/Makefile 2011-07-27 14:32:54.000000000 -0500 ++++ policycoreutils-2.1.0/Makefile 2012-01-17 13:24:12.999792401 -0600 +@@ -1,8 +1,8 @@ + 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 + +-INOTIFYH = $(shell ls /usr/include/sys/inotify.h 2>/dev/null) ++INOTIFYH ?= $(shell ls /usr/include/sys/inotify.h 2>/dev/null) + +-ifeq (${INOTIFYH}, /usr/include/sys/inotify.h) ++ifneq ($(INOTIFYH),) + SUBDIRS += restorecond + endif + +diff -ur policycoreutils-2.1.0.orig/mcstrans/src/Makefile policycoreutils-2.1.0/mcstrans/src/Makefile +--- policycoreutils-2.1.0.orig/mcstrans/src/Makefile 2011-07-27 14:32:54.000000000 -0500 ++++ policycoreutils-2.1.0/mcstrans/src/Makefile 2012-01-17 13:24:13.000791906 -0600 +@@ -1,21 +1,7 @@ +-ARCH = $(shell uname -i) +-ifeq "$(ARCH)" "x86_64" +- # In case of 64 bit system, use these lines +- LIBDIR=/usr/lib64 +-else +-ifeq "$(ARCH)" "i686" +- # In case of 32 bit system, use these lines +- LIBDIR=/usr/lib +-else +-ifeq "$(ARCH)" "i386" +- # In case of 32 bit system, use these lines +- LIBDIR=/usr/lib +-endif +-endif +-endif + # Installation directories. + PREFIX ?= $(DESTDIR)/usr + SBINDIR ?= $(DESTDIR)/sbin ++LIBDIR ?= $(PREFIX)/lib + INITDIR ?= $(DESTDIR)/etc/rc.d/init.d + + PROG_SRC=mcstrans.c mcscolor.c mcstransd.c mls_level.c +diff -ur policycoreutils-2.1.0.orig/mcstrans/utils/Makefile policycoreutils-2.1.0/mcstrans/utils/Makefile +--- policycoreutils-2.1.0.orig/mcstrans/utils/Makefile 2011-07-27 14:32:54.000000000 -0500 ++++ policycoreutils-2.1.0/mcstrans/utils/Makefile 2012-01-17 13:24:13.000791906 -0600 +@@ -1,23 +1,7 @@ + # Installation directories. + PREFIX ?= $(DESTDIR)/usr + BINDIR ?= $(PREFIX)/sbin +- +-ARCH = $(shell uname -i) +-ifeq "$(ARCH)" "x86_64" +- # In case of 64 bit system, use these lines +- LIBDIR=/usr/lib64 +-else +-ifeq "$(ARCH)" "i686" +- # In case of 32 bit system, use these lines +- LIBDIR=/usr/lib +-else +-ifeq "$(ARCH)" "i386" +- # In case of 32 bit system, use these lines +- LIBDIR=/usr/lib +-endif +-endif +-endif +- ++LIBDIR ?= $(PREFIX)/lib + + CFLAGS ?= -Wall + override CFLAGS += -I../src -D_GNU_SOURCE +diff -ur policycoreutils-2.1.0.orig/newrole/Makefile policycoreutils-2.1.0/newrole/Makefile +--- policycoreutils-2.1.0.orig/newrole/Makefile 2011-07-27 14:32:54.000000000 -0500 ++++ policycoreutils-2.1.0/newrole/Makefile 2012-01-17 13:35:02.821834567 -0600 +@@ -1,11 +1,13 @@ + # Installation directories. +-PREFIX ?= ${DESTDIR}/usr ++PREFIX ?= $(DESTDIR)/usr + BINDIR ?= $(PREFIX)/bin + MANDIR ?= $(PREFIX)/share/man + ETCDIR ?= $(DESTDIR)/etc +-LOCALEDIR = /usr/share/locale +-PAMH = $(shell ls /usr/include/security/pam_appl.h 2>/dev/null) +-AUDITH = $(shell ls /usr/include/libaudit.h 2>/dev/null) ++LOCALEDIR ?= /usr/share/locale ++LIBDIR ?= $(PREFIX)/lib ++INCLUDEDIR ?= $(PREFIX)/include ++PAMH ?= $(shell ls $(INCLUDEDIR)/security/pam_appl.h 2>/dev/null) ++AUDITH ?= $(shell ls $(INCLUDEDIR)/libaudit.h 2>/dev/null) + # Enable capabilities to permit newrole to generate audit records. + # This will make newrole a setuid root program. + # The capabilities used are: CAP_AUDIT_WRITE. +@@ -22,9 +24,9 @@ + + CFLAGS ?= -Werror -Wall -W + EXTRA_OBJS = +-override CFLAGS += -DVERSION=\"$(VERSION)\" $(LDFLAGS) -I$(PREFIX)/include -DUSE_NLS -DLOCALEDIR="\"$(LOCALEDIR)\"" -DPACKAGE="\"policycoreutils\"" +-LDLIBS += -lselinux -L$(PREFIX)/lib +-ifeq (${PAMH}, /usr/include/security/pam_appl.h) ++override CFLAGS += -DVERSION=\"$(VERSION)\" $(LDFLAGS) -I$(INCLUDE_DIR) -DUSE_NLS -DLOCALEDIR="\"$(LOCALEDIR)\"" -DPACKAGE="\"policycoreutils\"" ++LDLIBS += -lselinux -L$(LIBDIR) ++ifneq ($(PAMH),) + override CFLAGS += -DUSE_PAM + EXTRA_OBJS += hashtab.o + LDLIBS += -lpam -lpam_misc +@@ -32,23 +34,23 @@ + override CFLAGS += -D_XOPEN_SOURCE=500 + LDLIBS += -lcrypt + endif +-ifeq (${AUDITH}, /usr/include/libaudit.h) ++ifneq ($(AUDITH),) + override CFLAGS += -DUSE_AUDIT + LDLIBS += -laudit + endif +-ifeq (${LSPP_PRIV},y) ++ifeq ($(LSPP_PRIV),y) + override AUDIT_LOG_PRIV=y + override NAMESPACE_PRIV=y + endif +-ifeq (${AUDIT_LOG_PRIV},y) ++ifeq ($(AUDIT_LOG_PRIV),y) + override CFLAGS += -DAUDIT_LOG_PRIV + IS_SUID=y + endif +-ifeq (${NAMESPACE_PRIV},y) ++ifeq ($(NAMESPACE_PRIV),y) + override CFLAGS += -DNAMESPACE_PRIV + IS_SUID=y + endif +-ifeq (${IS_SUID},y) ++ifeq ($(IS_SUID),y) + MODE := 4555 + LDLIBS += -lcap-ng + else +@@ -66,9 +68,9 @@ + test -d $(MANDIR)/man1 || install -m 755 -d $(MANDIR)/man1 + install -m $(MODE) newrole $(BINDIR) + install -m 644 newrole.1 $(MANDIR)/man1/ +-ifeq (${PAMH}, /usr/include/security/pam_appl.h) ++ifneq ($(PAMH),) + test -d $(ETCDIR)/pam.d || install -m 755 -d $(ETCDIR)/pam.d +-ifeq (${LSPP_PRIV},y) ++ifeq ($(LSPP_PRIV),y) + install -m 644 newrole-lspp.pamd $(ETCDIR)/pam.d/newrole + else + install -m 644 newrole.pamd $(ETCDIR)/pam.d/newrole +diff -ur policycoreutils-2.1.0.orig/po/Makefile policycoreutils-2.1.0/po/Makefile +--- policycoreutils-2.1.0.orig/po/Makefile 2011-07-27 14:32:54.000000000 -0500 ++++ policycoreutils-2.1.0/po/Makefile 2012-01-17 13:24:13.002788918 -0600 +@@ -7,7 +7,7 @@ + # What is this package? + NLSPACKAGE = policycoreutils + POTFILE = $(NLSPACKAGE).pot +-INSTALL = /usr/bin/install -c ++INSTALL = /usr/bin/install -c -p + INSTALL_DATA = $(INSTALL) -m 644 + INSTALL_DIR = /usr/bin/install -d + +diff -ur policycoreutils-2.1.0.orig/restorecond/Makefile policycoreutils-2.1.0/restorecond/Makefile +--- policycoreutils-2.1.0.orig/restorecond/Makefile 2011-07-27 14:32:54.000000000 -0500 ++++ policycoreutils-2.1.0/restorecond/Makefile 2012-01-17 13:32:29.759836181 -0600 +@@ -1,13 +1,15 @@ + # Installation directories. +-PREFIX ?= ${DESTDIR}/usr ++PREFIX ?= $(DESTDIR)/usr + SBINDIR ?= $(PREFIX)/sbin +-MANDIR = $(PREFIX)/share/man +-INITDIR = $(DESTDIR)/etc/rc.d/init.d +-SELINUXDIR = $(DESTDIR)/etc/selinux ++MANDIR ?= $(PREFIX)/share/man ++INITDIR ?= $(DESTDIR)/etc/rc.d/init.d ++LIBDIR ?= $(PREFIX)/lib ++INCLUDEDIR ?= $(PREFIX)/include ++SELINUXDIR ?= $(DESTDIR)/etc/selinux + + CFLAGS ?= -g -Werror -Wall -W +-override CFLAGS += -I$(PREFIX)/include -D_FILE_OFFSET_BITS=64 +-LDLIBS += -lselinux -L$(PREFIX)/lib ++override CFLAGS += -I$(INCLUDEDIR) -D_FILE_OFFSET_BITS=64 ++LDLIBS += -lselinux -L$(LIBDIR) + + all: restorecond + +diff -ur policycoreutils-2.1.0.orig/run_init/Makefile policycoreutils-2.1.0/run_init/Makefile +--- policycoreutils-2.1.0.orig/run_init/Makefile 2011-07-27 14:32:54.000000000 -0500 ++++ policycoreutils-2.1.0/run_init/Makefile 2012-01-17 13:35:26.647834661 -0600 +@@ -1,24 +1,26 @@ + + # Installation directories. +-PREFIX ?= ${DESTDIR}/usr ++PREFIX ?= $(DESTDIR)/usr + SBINDIR ?= $(PREFIX)/sbin + MANDIR ?= $(PREFIX)/share/man + ETCDIR ?= $(DESTDIR)/etc + LOCALEDIR ?= /usr/share/locale +-PAMH = $(shell ls /usr/include/security/pam_appl.h 2>/dev/null) +-AUDITH = $(shell ls /usr/include/libaudit.h 2>/dev/null) ++LIBDIR ?= $(PREFIX)/lib ++INCLUDEDIR ?= $(PREFIX)/include ++PAMH ?= $(shell ls $(INCLUDEDIR)/security/pam_appl.h 2>/dev/null) ++AUDITH ?= $(shell ls $(INCLUDEDIR)/libaudit.h 2>/dev/null) + + CFLAGS ?= -Werror -Wall -W +-override CFLAGS += -I$(PREFIX)/include -DUSE_NLS -DLOCALEDIR="\"$(LOCALEDIR)\"" -DPACKAGE="\"policycoreutils\"" +-LDLIBS += -lselinux -L$(PREFIX)/lib +-ifeq (${PAMH}, /usr/include/security/pam_appl.h) ++override CFLAGS += -I$(INCLUDEDIR) -DUSE_NLS -DLOCALEDIR="\"$(LOCALEDIR)\"" -DPACKAGE="\"policycoreutils\"" ++LDLIBS += -lselinux -L$(LIBDIR) ++ifneq ($(PAMH),) + override CFLAGS += -DUSE_PAM + LDLIBS += -lpam -lpam_misc + else + override CFLAGS += -D_XOPEN_SOURCE=500 + LDLIBS += -lcrypt + endif +-ifeq (${AUDITH}, /usr/include/libaudit.h) ++ifneq ($(AUDITH),) + override CFLAGS += -DUSE_AUDIT + LDLIBS += -laudit + endif +@@ -38,7 +40,7 @@ + install -m 755 open_init_pty $(SBINDIR) + install -m 644 run_init.8 $(MANDIR)/man8/ + install -m 644 open_init_pty.8 $(MANDIR)/man8/ +-ifeq (${PAMH}, /usr/include/security/pam_appl.h) ++ifneq ($(PAMH),) + install -m 644 run_init.pamd $(ETCDIR)/pam.d/run_init + endif + +diff -ur policycoreutils-2.1.0.orig/sandbox/Makefile policycoreutils-2.1.0/sandbox/Makefile +--- policycoreutils-2.1.0.orig/sandbox/Makefile 2011-07-27 14:32:54.000000000 -0500 ++++ policycoreutils-2.1.0/sandbox/Makefile 2012-01-17 13:26:41.147959182 -0600 +@@ -1,13 +1,14 @@ + # Installation directories. +-PREFIX ?= ${DESTDIR}/usr +-INITDIR ?= ${DESTDIR}/etc/rc.d/init.d/ +-SYSCONFDIR ?= ${DESTDIR}/etc/sysconfig ++PREFIX ?= $(DESTDIR)/usr ++INITDIR ?= $(DESTDIR)/etc/rc.d/init.d/ ++SYSCONFDIR ?= $(DESTDIR)/etc/sysconfig + BINDIR ?= $(PREFIX)/bin + SBINDIR ?= $(PREFIX)/sbin + MANDIR ?= $(PREFIX)/share/man + LOCALEDIR ?= /usr/share/locale + SHAREDIR ?= $(PREFIX)/share/sandbox +-override CFLAGS += $(LDFLAGS) -I$(PREFIX)/include -DPACKAGE="\"policycoreutils\"" ++INCLUDEDIR ?= $(PREFIX)/include ++override CFLAGS += $(LDFLAGS) -I$(INCLUDEDIR) -DPACKAGE="\"policycoreutils\"" + LDLIBS += -lselinux -lcap-ng + + all: sandbox seunshare sandboxX.sh +diff -ur policycoreutils-2.1.0.orig/scripts/Makefile policycoreutils-2.1.0/scripts/Makefile +--- policycoreutils-2.1.0.orig/scripts/Makefile 2011-07-27 14:32:54.000000000 -0500 ++++ policycoreutils-2.1.0/scripts/Makefile 2012-01-17 13:24:13.004789319 -0600 +@@ -1,5 +1,5 @@ + # Installation directories. +-PREFIX ?= ${DESTDIR}/usr ++PREFIX ?= $(DESTDIR)/usr + BINDIR ?= $(PREFIX)/bin + SBINDIR ?= $(PREFIX)/sbin + MANDIR ?= $(PREFIX)/share/man +diff -ur policycoreutils-2.1.0.orig/secon/Makefile policycoreutils-2.1.0/secon/Makefile +--- policycoreutils-2.1.0.orig/secon/Makefile 2011-07-27 14:32:54.000000000 -0500 ++++ policycoreutils-2.1.0/secon/Makefile 2012-01-17 13:24:13.004789319 -0600 +@@ -1,9 +1,9 @@ + # secon tool - command-line context +-PREFIX ?= ${DESTDIR}/usr ++PREFIX ?= $(DESTDIR)/usr + INCLUDEDIR ?= $(PREFIX)/include + BINDIR ?= $(PREFIX)/bin + MANDIR ?= $(PREFIX)/share/man +-LIBDIR ?= ${PREFIX}/lib ++LIBDIR ?= $(PREFIX)/lib + + 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 + VERSION = $(shell cat ../VERSION) +diff -ur policycoreutils-2.1.0.orig/semanage/Makefile policycoreutils-2.1.0/semanage/Makefile +--- policycoreutils-2.1.0.orig/semanage/Makefile 2011-07-27 14:32:54.000000000 -0500 ++++ policycoreutils-2.1.0/semanage/Makefile 2012-01-17 13:24:13.005752372 -0600 +@@ -1,5 +1,5 @@ + # Installation directories. +-PREFIX ?= ${DESTDIR}/usr ++PREFIX ?= $(DESTDIR)/usr + LIBDIR ?= $(PREFIX)/lib + SBINDIR ?= $(PREFIX)/sbin + MANDIR = $(PREFIX)/share/man +diff -ur policycoreutils-2.1.0.orig/semodule/Makefile policycoreutils-2.1.0/semodule/Makefile +--- policycoreutils-2.1.0.orig/semodule/Makefile 2011-07-27 14:32:54.000000000 -0500 ++++ policycoreutils-2.1.0/semodule/Makefile 2012-01-17 13:24:13.005752372 -0600 +@@ -3,7 +3,7 @@ + INCLUDEDIR ?= $(PREFIX)/include + SBINDIR ?= $(PREFIX)/sbin + MANDIR = $(PREFIX)/share/man +-LIBDIR ?= ${PREFIX}/lib ++LIBDIR ?= $(PREFIX)/lib + + CFLAGS ?= -Werror -Wall -W + override CFLAGS += -I$(INCLUDEDIR) +diff -ur policycoreutils-2.1.0.orig/semodule_deps/Makefile policycoreutils-2.1.0/semodule_deps/Makefile +--- policycoreutils-2.1.0.orig/semodule_deps/Makefile 2011-07-27 14:32:54.000000000 -0500 ++++ policycoreutils-2.1.0/semodule_deps/Makefile 2012-01-17 13:24:13.006808131 -0600 +@@ -1,8 +1,8 @@ + # Installation directories. +-PREFIX ?= ${DESTDIR}/usr ++PREFIX ?= $(DESTDIR)/usr + INCLUDEDIR ?= $(PREFIX)/include + BINDIR ?= $(PREFIX)/bin +-LIBDIR ?= ${PREFIX}/lib ++LIBDIR ?= $(PREFIX)/lib + MANDIR ?= $(PREFIX)/share/man + + CFLAGS ?= -Werror -Wall -W +diff -ur policycoreutils-2.1.0.orig/semodule_expand/Makefile policycoreutils-2.1.0/semodule_expand/Makefile +--- policycoreutils-2.1.0.orig/semodule_expand/Makefile 2011-07-27 14:32:54.000000000 -0500 ++++ policycoreutils-2.1.0/semodule_expand/Makefile 2012-01-17 13:24:13.006808131 -0600 +@@ -1,8 +1,8 @@ + # Installation directories. +-PREFIX ?= ${DESTDIR}/usr ++PREFIX ?= $(DESTDIR)/usr + INCLUDEDIR ?= $(PREFIX)/include + BINDIR ?= $(PREFIX)/bin +-LIBDIR ?= ${PREFIX}/lib ++LIBDIR ?= $(PREFIX)/lib + MANDIR ?= $(PREFIX)/share/man + + CFLAGS ?= -Werror -Wall -W +diff -ur policycoreutils-2.1.0.orig/semodule_link/Makefile policycoreutils-2.1.0/semodule_link/Makefile +--- policycoreutils-2.1.0.orig/semodule_link/Makefile 2011-07-27 14:32:54.000000000 -0500 ++++ policycoreutils-2.1.0/semodule_link/Makefile 2012-01-17 13:24:13.008837145 -0600 +@@ -1,9 +1,9 @@ + # Installation directories. +-PREFIX ?= ${DESTDIR}/usr ++PREFIX ?= $(DESTDIR)/usr + INCLUDEDIR ?= $(PREFIX)/include + BINDIR ?= $(PREFIX)/bin + MANDIR ?= $(PREFIX)/share/man +-LIBDIR ?= ${PREFIX}/lib ++LIBDIR ?= $(PREFIX)/lib + + CFLAGS ?= -Werror -Wall -W + override CFLAGS += -I$(INCLUDEDIR) +diff -ur policycoreutils-2.1.0.orig/semodule_package/Makefile policycoreutils-2.1.0/semodule_package/Makefile +--- policycoreutils-2.1.0.orig/semodule_package/Makefile 2011-07-27 14:32:54.000000000 -0500 ++++ policycoreutils-2.1.0/semodule_package/Makefile 2012-01-17 13:24:13.009746277 -0600 +@@ -1,8 +1,8 @@ + # Installation directories. +-PREFIX ?= ${DESTDIR}/usr ++PREFIX ?= $(DESTDIR)/usr + INCLUDEDIR ?= $(PREFIX)/include + BINDIR ?= $(PREFIX)/bin +-LIBDIR ?= ${PREFIX}/lib ++LIBDIR ?= $(PREFIX)/lib + MANDIR ?= $(PREFIX)/share/man + + CFLAGS ?= -Werror -Wall -W +diff -ur policycoreutils-2.1.0.orig/sestatus/Makefile policycoreutils-2.1.0/sestatus/Makefile +--- policycoreutils-2.1.0.orig/sestatus/Makefile 2011-07-27 14:32:54.000000000 -0500 ++++ policycoreutils-2.1.0/sestatus/Makefile 2012-01-17 13:25:58.418959420 -0600 +@@ -1,12 +1,13 @@ + # Installation directories. +-PREFIX ?= ${DESTDIR}/usr ++PREFIX ?= $(DESTDIR)/usr + SBINDIR ?= $(PREFIX)/sbin +-MANDIR = $(PREFIX)/share/man ++MANDIR ?= $(PREFIX)/share/man + ETCDIR ?= $(DESTDIR)/etc +-LIBDIR ?= ${PREFIX}/lib ++LIBDIR ?= $(PREFIX)/lib ++INCLUDEDIR ?= $(PREFIX)/include + + CFLAGS = -Werror -Wall -W +-override CFLAGS += -I$(PREFIX)/include -D_FILE_OFFSET_BITS=64 ++override CFLAGS += -I$(INCLUDEDIR) -D_FILE_OFFSET_BITS=64 + LDLIBS = -lselinux -L$(LIBDIR) + + all: sestatus +diff -ur policycoreutils-2.1.0.orig/setfiles/Makefile policycoreutils-2.1.0/setfiles/Makefile +--- policycoreutils-2.1.0.orig/setfiles/Makefile 2011-07-27 14:32:54.000000000 -0500 ++++ policycoreutils-2.1.0/setfiles/Makefile 2012-01-17 13:34:38.168834084 -0600 +@@ -1,15 +1,16 @@ + # Installation directories. +-PREFIX ?= ${DESTDIR}/usr +-SBINDIR ?= $(DESTDIR)/sbin +-MANDIR = $(PREFIX)/share/man ++PREFIX ?= $(DESTDIR)/usr ++BASE_SBINDIR ?= $(DESTDIR)/sbin ++MANDIR ?= $(PREFIX)/share/man + LIBDIR ?= $(PREFIX)/lib +-AUDITH = $(shell ls /usr/include/libaudit.h 2>/dev/null) ++INCLUDEDIR ?= $(PREFIX)/include ++AUDITH ?= $(shell ls $(INCLUDEDIR)/libaudit.h 2>/dev/null) + + CFLAGS = -g -Werror -Wall -W +-override CFLAGS += -I$(PREFIX)/include ++override CFLAGS += -I$(INCLUDEDIR) + LDLIBS = -lselinux -lsepol -L$(LIBDIR) + +-ifeq (${AUDITH}, /usr/include/libaudit.h) ++ifneq ($(AUDITH),) + override CFLAGS += -DUSE_AUDIT + LDLIBS += -laudit + endif +@@ -23,9 +24,9 @@ + + install: all + [ -d $(MANDIR)/man8 ] || mkdir -p $(MANDIR)/man8 +- -mkdir -p $(SBINDIR) +- install -m 755 setfiles $(SBINDIR) +- (cd $(SBINDIR) && ln -sf setfiles restorecon) ++ -mkdir -p $(BASE_SBINDIR) ++ install -m 755 setfiles $(BASE_SBINDIR) ++ (cd $(BASE_SBINDIR) && ln -sf setfiles restorecon) + install -m 644 setfiles.8 restorecon.8 $(MANDIR)/man8 + + clean: +@@ -35,4 +36,4 @@ + ../../scripts/Lindent $(wildcard *.[ch]) + + relabel: install +- /sbin/restorecon $(SBINDIR)/setfiles ++ /sbin/restorecon $(BASE_SBINDIR)/setfiles +diff -ur policycoreutils-2.1.0.orig/setsebool/Makefile policycoreutils-2.1.0/setsebool/Makefile +--- policycoreutils-2.1.0.orig/setsebool/Makefile 2011-07-27 14:32:54.000000000 -0500 ++++ policycoreutils-2.1.0/setsebool/Makefile 2012-01-17 13:24:59.267961760 -0600 +@@ -2,8 +2,8 @@ + PREFIX ?= $(DESTDIR)/usr + INCLUDEDIR ?= $(PREFIX)/include + SBINDIR ?= $(PREFIX)/sbin +-MANDIR = $(PREFIX)/share/man +-LIBDIR ?= ${PREFIX}/lib ++MANDIR ?= $(PREFIX)/share/man ++LIBDIR ?= $(PREFIX)/lib + + CFLAGS ?= -Werror -Wall -W + 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 @@ +SUMMARY = "SELinux policy core utilities" +DESCRIPTION = "policycoreutils contains the policy core utilities that are required \ +for basic operation of a SELinux system. These utilities include \ +load_policy to load policies, setfiles to label filesystems, newrole \ +to switch roles, and run_init to run /etc/init.d scripts in the proper \ +context." +SECTION = "base" +PR = "r1" +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833" + +include selinux.inc + +SRC_URI += "file://makefiles.patch" + +SRC_URI[md5sum] = "f418384ea5bc57080a6ace843646aba9" +SRC_URI[sha256sum] = "6199b07fd4280e455ea05933cee510b5e09ad3f60b0544382231fe05b787d3f3" + +DEPENDS += "libsepol libselinux libsemanage libcap-ng" +DEPENDS += "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam audit', '', d)}" + +RDEPENDS_${PN} += "sepolgen" + +EXTRA_OEMAKE += "PREFIX='$(DESTDIR)${prefix}' BASE_SBINDIR='$(DESTDIR)${base_sbindir}' SBINDIR='$(DESTDIR)${sbindir}'" +EXTRA_OEMAKE += "BINDIR='$(DESTDIR)${bindir}' MANDIR='$(DESTDIR)/${mandir}' LOCALEDIR='$(DESTDIR)/${datadir}/locale'" +EXTRA_OEMAKE += "ETCDIR='$(DESTDIR)${sysconfdir}' SHAREDIR='$(DESTDIR)${datadir}'" +EXTRA_OEMAKE += "INITDIR='$(DESTDIR)${sysconfdir}/init.d'" +EXTRA_OEMAKE += "INCLUDEDIR='${STAGING_INCDIR}' LIBDIR='${STAGING_LIBDIR}'" +# Main Makefile +EXTRA_OEMAKE += "INOTIFYH=y" +# newrole/Makefile +# Options: PAMH, AUDITH, AUDIT_LOG_PRIV, NAMESPACE_PRIV, LSPP_PRIV +EXTRA_OEMAKE += "${@base_contains('DISTRO_FEATURES', 'pam', 'PAMH=y AUDITH=y', '', d)}" +# restorecond/Makefile +# AUTOSTARTDIR ?= $(DESTDIR)/etc/xdg/autostart DBUSSERVICEDIR ?= $(DESTDIR)/usr/share/dbus-1/services +# SELINUXDIR ?= $(DESTDIR)/etc/selinux +# semanage/Makefile +EXTRA_OEMAKE += "PYLIBVER='python${PYTHON_BASEVERSION}'" + +do_compile() { + oe_runmake all +} + +do_install() { + oe_runmake DESTDIR=${D} install + + if [ "${base_sbindir}" != "${sbindir}" ]; then + mv ${D}${base_sbindir}/fixfiles ${D}${sbindir}/fixfiles + fi + + rm ${D}${datadir}/sandboxX.sh +} -- cgit v1.2.3-54-g00ecf