buildroot/package/policycoreutils/0001-Add-DESTDIR-to-all-paths-that-use-an-absolute-path.patch
Clayton Shotwell cb328f77f8 policycoreutils: new package
This package contains the core policy utilities that are required
for basic operation of an SELinux system.

Signed-off-by: Clayton Shotwell <clayton.shotwell@rockwellcollins.com>
Signed-off-by: Matt Weber <matthew.weber@rockwellcollins.com>
Signed-off-by: Niranjan Reddy <niranjan.reddy@rockwellcollins.com>
Tested-by: Bryce Ferguson <bryce.ferguson@rockwellcollins.com>
Signed-off-by: Bryce Ferguson <bryce.ferguson@rockwellcollins.com>
[Thomas:
 - Move the Config.in comment at the top of the Config.in file rather
   than between the main option and its sub-options, as this breaks
   menuconfig indentation.
 - Fix the propagation of the libsemanage dependencies. libsemanage
   depends on BR2_PACKAGE_AUDIT_ARCH_SUPPORTS and
   BR2_TOOLCHAIN_USES_GLIBC which were not accounted for. Since it
   depends on BR2_TOOLCHAIN_USES_GLIBC, then all the gettext related
   handling becomes useless and has been removed.
 - Rename the prompt of the restorecond sub-option to just
   "restorecond".
 - Use TARGET_CONFIGURE_OPTS and HOST_CONFIGURE_OPTS instead of
   passing LDFLAGS, CC, etc. manually.
 - Use make "foreach" function for loops instead of shell "for" loops.
 - Rework the explanation of why we're passing DESTDIR at build time.
 - Minor formatting tweaks here and there.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-12-10 15:55:31 +01:00

132 lines
5.3 KiB
Diff

The addition of this patch makes the use of DESTDIR
mandatory as there are conditional checks which would fail if it's not
defined.
This patch was updated from the patch provided by Niranjan Reddy to
accomodate version 2.5
Signed-off-by: Clayton Shotwell <clayton.shotwell@rockwellcollins.com>
Signed-off-by: Niranjan Reddy <niranjan.reddy@rockwellcollins.com>
Signed-off-by: Adam Duskett <AdamDuskett@outlook.com>
Signed-off-by: Adam Duskett <Aduskett@gmail.com>
---
policycoreutils/Makefile | 2 +-
policycoreutils/newrole/Makefile | 4 ++--
policycoreutils/restorecond/Makefile | 5 +++--
policycoreutils/run_init/Makefile | 4 ++--
policycoreutils/sepolicy/Makefile | 2 +-
policycoreutils/sestatus/Makefile | 2 +-
policycoreutils/setfiles/Makefile | 4 ++--
7 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/Makefile b/Makefile
index 962ac12..0634a2a 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
SUBDIRS = sepolicy setfiles semanage load_policy newrole run_init sandbox secon audit2allow sestatus semodule_package semodule semodule_link semodule_expand semodule_deps sepolgen-ifgen setsebool scripts po man gui hll
-INOTIFYH = $(shell ls /usr/include/sys/inotify.h 2>/dev/null)
+INOTIFYH = $(shell ls $(DESTDIR)/usr/include/sys/inotify.h 2>/dev/null)
ifeq (${INOTIFYH}, /usr/include/sys/inotify.h)
SUBDIRS += restorecond
diff --git a/newrole/Makefile b/newrole/Makefile
index 646cd4d..f124a6a 100644
--- a/newrole/Makefile
+++ b/newrole/Makefile
@@ -4,8 +4,8 @@ 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)
+PAMH = $(shell ls $(DESTDIR)/usr/include/security/pam_appl.h 2>/dev/null)
+AUDITH = $(shell ls $(DESTDIR)/usr/include/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.
diff --git a/restorecond/Makefile b/restorecond/Makefile
index f99e1e7..92a4a4d 100644
--- a/restorecond/Makefile
+++ b/restorecond/Makefile
@@ -11,11 +11,12 @@ autostart_DATA = sealertauto.desktop
INITDIR ?= $(DESTDIR)/etc/rc.d/init.d
SELINUXDIR = $(DESTDIR)/etc/selinux
-DBUSFLAGS = -DHAVE_DBUS -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/lib/dbus-1.0/include
+DBUSFLAGS = -DHAVE_DBUS -I$(DESTDIR)/usr/include/dbus-1.0 -I$(DESTDIR)/usr/lib64/dbus-1.0/include -I$(DESTDIR)/usr/lib/dbus-1.0/include
DBUSLIB = -ldbus-glib-1 -ldbus-1
CFLAGS ?= -g -Werror -Wall -W
-override CFLAGS += -I$(PREFIX)/include $(DBUSFLAGS) -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/lib/glib-2.0/include
+override CFLAGS += -I$(DESTDIR)/usr/include $(DBUSFLAGS) -I$(DESTDIR)/usr/include/glib-2.0 \
+-I$(DESTDIR)/usr/lib64/glib-2.0/include -I$(DESTDIR)/usr/lib/glib-2.0/include
LDLIBS += -lselinux $(DBUSLIB) -lglib-2.0 -L$(LIBDIR)
diff --git a/run_init/Makefile b/run_init/Makefile
index 5815a08..c81179b 100644
--- a/run_init/Makefile
+++ b/run_init/Makefile
@@ -5,8 +5,8 @@ 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)
+PAMH = $(shell ls $(DESTDIR)/usr/include/security/pam_appl.h 2>/dev/null)
+AUDITH = $(shell ls $(DESTDIR)/usr/include/libaudit.h 2>/dev/null)
CFLAGS ?= -Werror -Wall -W
override CFLAGS += -I$(PREFIX)/include -DUSE_NLS -DLOCALEDIR="\"$(LOCALEDIR)\"" -DPACKAGE="\"policycoreutils\""
diff --git a/sepolicy/Makefile b/sepolicy/Makefile
index 39d46e8..6624373 100644
--- a/sepolicy/Makefile
+++ b/sepolicy/Makefile
@@ -12,7 +12,7 @@ LOCALEDIR ?= /usr/share/locale
BASHCOMPLETIONDIR ?= $(DESTDIR)/usr/share/bash-completion/completions
SHAREDIR ?= $(PREFIX)/share/sandbox
CFLAGS ?= -Wall -Werror -Wextra -W
-override CFLAGS += -I$(PREFIX)/include -DPACKAGE="policycoreutils" -DSHARED -shared
+override CFLAGS = $(LDFLAGS) -I$(DESTDIR)/usr/include -DPACKAGE="policycoreutils" -Wall -Werror -Wextra -W -DSHARED -shared
BASHCOMPLETIONS=sepolicy-bash-completion.sh
diff --git a/sestatus/Makefile b/sestatus/Makefile
index c04ff00..e10c32c 100644
--- a/sestatus/Makefile
+++ b/sestatus/Makefile
@@ -6,7 +6,7 @@ ETCDIR ?= $(DESTDIR)/etc
LIBDIR ?= $(PREFIX)/lib
CFLAGS ?= -Werror -Wall -W
-override CFLAGS += -I$(PREFIX)/include -D_FILE_OFFSET_BITS=64
+override CFLAGS += -I$(DESTDIR)/usr/include -D_FILE_OFFSET_BITS=64
LDLIBS = -lselinux -L$(LIBDIR)
all: sestatus
diff --git a/setfiles/Makefile b/setfiles/Makefile
index 98f4f7d..eb26ed0 100644
--- a/setfiles/Makefile
+++ b/setfiles/Makefile
@@ -3,13 +3,13 @@ PREFIX ?= $(DESTDIR)/usr
SBINDIR ?= $(DESTDIR)/sbin
MANDIR = $(PREFIX)/share/man
LIBDIR ?= $(PREFIX)/lib
-AUDITH = $(shell ls /usr/include/libaudit.h 2>/dev/null)
+AUDITH = $(shell ls $(DESTDIR)/usr/include/libaudit.h 2>/dev/null)
PROGRESS_STEP=$(shell grep "^\#define STAR_COUNT" restore.h | awk -S '{ print $$3 }')
ABORT_ON_ERRORS=$(shell grep "^\#define ABORT_ON_ERRORS" setfiles.c | awk -S '{ print $$3 }')
CFLAGS ?= -g -Werror -Wall -W
-override CFLAGS += -I$(PREFIX)/include
+override CFLAGS += -I$(DESTDIR)/usr/include
LDLIBS = -lselinux -lsepol -L$(LIBDIR)
ifeq ($(AUDITH), /usr/include/libaudit.h)
--
2.7.4