From: Paul Moore <pmoore@redhat.com>
To: serge@hallyn.com
Cc: selinux@tycho.nsa.gov
Subject: [selinux-testsuite RFC PATCH 3/4] test_policy: use RHEL instead of REDHAT in Makefile
Date: Tue, 24 Sep 2013 12:33:33 -0400 [thread overview]
Message-ID: <20130924163333.27393.21897.stgit@localhost> (raw)
In-Reply-To: <20130924162401.27393.70353.stgit@localhost>
We also rework some of the if statements to make it easier to add
additional distributions, e.g. Fedora.
Signed-off-by: Paul Moore <pmoore@redhat.com>
---
policy/Makefile | 34 ++++++++++++++++++++--------------
1 file changed, 20 insertions(+), 14 deletions(-)
diff --git a/policy/Makefile b/policy/Makefile
index 5dbb655..8763143 100644
--- a/policy/Makefile
+++ b/policy/Makefile
@@ -3,8 +3,8 @@ POLDEV = /usr/share/selinux/devel
SEMODULE = /usr/sbin/semodule
CHECKPOLICY = /usr/bin/checkpolicy
-REDHAT_RELEASE=$(shell rpm -q redhat-release)
-REDHAT_VERS=$(shell echo $(REDHAT_RELEASE) | cut -f3 -d"-" | sed -e "s/[^0-9]*//g")
+RHEL_REL=$(shell rpm -q redhat-release)
+RHEL_VERS=$(shell echo $(RHEL_REL) | cut -f3 -d"-" | sed -e "s/[^0-9]*//g")
POL_VERS := $(shell $(CHECKPOLICY) -V |cut -f 1 -d ' ')
@@ -26,9 +26,12 @@ TARGETS += test_bounds.te
endif
all: $(TARGETS)
-ifeq (x$(REDHAT_VERS),$(filter x$(REDHAT_VERS),x4 x5))
- $(MAKE) -C redhat/$(REDHAT_VERS) all
-else
+ifeq (x$(RHEL_VERS),$(filter x$(RHEL_VERS),x4 x5))
+ # RHEL specific policy build
+ $(MAKE) -C redhat/$(RHEL_VERS) all \
+ exit $$?
+endif
+ # General policy build
@if [ -d $(POLDEV) ]; then \
mkdir -p test_policy; \
cp test_policy.if test_policy; \
@@ -38,23 +41,26 @@ else
else \
echo "ERROR: You must have selinux-policy-devel installed."; \
fi
-endif
load: all
-ifeq (x$(REDHAT_VERS),$(filter x$(REDHAT_VERS),x4 x5))
- $(MAKE) -C redhat/$(REDHAT_VERS) load
-else
+ifeq (x$(RHEL_VERS),$(filter x$(RHEL_VERS),x4 x5))
+ # RHEL specific policy load
+ $(MAKE) -C redhat/$(RHEL_VERS) load \
+ exit $$?
+endif
+ # General policy load
/usr/sbin/setsebool allow_domain_fd_use=0
$(SEMODULE) -i test_policy/test_policy.pp
-endif
unload:
-ifeq (x$(REDHAT_VERS),$(filter x$(REDHAT_VERS),x4 x5))
- $(MAKE) -C redhat/$(REDHAT_VERS) unload
-else
+ifeq (x$(RHEL_VERS),$(filter x$(RHEL_VERS),x4 x5))
+ # RHEL specific policy unload
+ $(MAKE) -C redhat/$(RHEL_VERS) unload \
+ exit $$?
+endif
+ # General policy unload
/usr/sbin/setsebool allow_domain_fd_use=1
$(SEMODULE) -r test_policy
-endif
clean:
rm -rf test_policy tmp
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
next prev parent reply other threads:[~2013-09-24 16:33 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-24 16:33 [selinux-testsuite RFC PATCH 0/4] selinux-testsuite patches Paul Moore
2013-09-24 16:33 ` [selinux-testsuite RFC PATCH 1/4] test_policy: test_global.te fix for Fedora Rawhide (Sept 24th, 2013) Paul Moore
2013-09-24 16:49 ` Serge E. Hallyn
2013-09-24 19:39 ` Paul Moore
2013-09-25 21:31 ` Serge E. Hallyn
2013-09-25 22:19 ` Paul Moore
2013-09-27 18:15 ` Serge E. Hallyn
2013-09-27 18:27 ` Paul Moore
2013-09-26 18:48 ` Serge E. Hallyn
2013-09-24 16:33 ` [selinux-testsuite RFC PATCH 2/4] test_policy: general Makefile cleanup Paul Moore
2013-09-24 16:52 ` Serge E. Hallyn
2013-09-24 16:33 ` Paul Moore [this message]
2013-09-24 16:53 ` [selinux-testsuite RFC PATCH 3/4] test_policy: use RHEL instead of REDHAT in Makefile Serge E. Hallyn
2013-09-24 16:33 ` [selinux-testsuite RFC PATCH 4/4] test_policy: create a "build" target Paul Moore
2013-09-24 16:53 ` Serge E. Hallyn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130924163333.27393.21897.stgit@localhost \
--to=pmoore@redhat.com \
--cc=selinux@tycho.nsa.gov \
--cc=serge@hallyn.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.