From d6cf05b3e45306a637933dc9310ae9e5044d587e Mon Sep 17 00:00:00 2001 From: Chris PeBenito Date: Wed, 15 Feb 2006 18:27:23 +0000 Subject: [PATCH] fix headers install path problem, segenxml.py variable problem, change set_tunables into a standalone awk script. --- refpolicy/Makefile | 7 +++---- refpolicy/Rules.modular | 2 +- refpolicy/Rules.monolithic | 2 +- refpolicy/support/set_bools_tuns.awk | 11 +++++++++++ refpolicy/support/set_tunables | 8 -------- 5 files changed, 16 insertions(+), 14 deletions(-) create mode 100644 refpolicy/support/set_bools_tuns.awk delete mode 100755 refpolicy/support/set_tunables diff --git a/refpolicy/Makefile b/refpolicy/Makefile index 75018700..2fe65e1e 100644 --- a/refpolicy/Makefile +++ b/refpolicy/Makefile @@ -67,7 +67,6 @@ GREP ?= egrep M4 ?= m4 PYTHON ?= python SED ?= sed -SH ?= sh CFLAGS += -Wall @@ -91,7 +90,7 @@ GENXML := $(PYTHON) $(SUPPORT)/segenxml.py GENDOC := $(PYTHON) $(SUPPORT)/sedoctool.py GENPERM := $(PYTHON) $(SUPPORT)/genclassperms.py FCSORT := $(TMPDIR)/fc_sort -SETTUN := $(SH) $(SUPPORT)/set_tunables +SETBOOLS := $(AWK) -f $(SUPPORT)/set_bools_tuns.awk # documentation paths DOCS = $(ROOT)/doc @@ -134,7 +133,7 @@ CONTEXTPATH = $(INSTALLDIR)/contexts FCPATH = $(CONTEXTPATH)/files/file_contexts SHAREDIR = $(PREFIX)/share/selinux MODPKGDIR = $(SHAREDIR)/$(NAME) -HEADERDIR = $(SHAREDIR)/refpolicy/include +HEADERDIR = $(MODPKGDIR)/include DOCSDIR = $(PREFIX)/share/doc/$(PKGNAME) # compile strict policy if requested. @@ -433,7 +432,7 @@ install-headers: $(POLXML) $(verbose) install -m 644 $(TMPDIR)/global_{tunables,booleans}.xml $(HEADERDIR) $(verbose) m4 $(M4PARAM) $(ROLEMAP) > $(HEADERDIR)/$(notdir $(ROLEMAP)) $(verbose) mkdir -p $(HEADERDIR)/support - $(verbose) install -m 644 $(M4SUPPORT) $(GENXML) $(XMLDTD) $(HEADERDIR)/support + $(verbose) install -m 644 $(M4SUPPORT) $(word $(words $(GENXML)),$(GENXML)) $(XMLDTD) $(HEADERDIR)/support $(verbose) $(GENPERM) $(AVS) $(SECCLASS) > $(HEADERDIR)/support/all_perms.spt $(verbose) for i in $(notdir $(ALL_LAYERS)); do \ mkdir -p $(HEADERDIR)/$$i ;\ diff --git a/refpolicy/Rules.modular b/refpolicy/Rules.modular index 5ac2fe41..f534a955 100644 --- a/refpolicy/Rules.modular +++ b/refpolicy/Rules.modular @@ -130,7 +130,7 @@ $(TMPDIR)/generated_definitions.conf: $(BASE_TE_FILES) $(verbose) for i in $(notdir $(BASE_TE_FILES)); do \ echo "define(\`$$i')" >> $@ ;\ done - $(verbose) $(SETTUN) $(BOOLEANS) >> $@ + $(verbose) test -f $(BOOLEANS) && $(SETBOOLS) $(BOOLEANS) >> $@ $(TMPDIR)/all_interfaces.conf: $(M4SUPPORT) $(ALL_INTERFACES) ifeq ($(ALL_INTERFACES),) diff --git a/refpolicy/Rules.monolithic b/refpolicy/Rules.monolithic index b345ed4f..b04723fc 100644 --- a/refpolicy/Rules.monolithic +++ b/refpolicy/Rules.monolithic @@ -118,7 +118,7 @@ $(TMPDIR)/generated_definitions.conf: $(ALL_LAYERS) $(ALL_TE_FILES) $(verbose) for i in $(notdir $(ALL_MODULES)); do \ echo "define(\`$$i')" >> $@ ;\ done - $(verbose) $(SETTUN) $(BOOLEANS) >> $@ + $(verbose) test -f $(BOOLEANS) && $(SETBOOLS) $(BOOLEANS) >> $@ $(TMPDIR)/all_interfaces.conf: $(M4SUPPORT) $(ALL_INTERFACES) ifeq ($(ALL_INTERFACES),) diff --git a/refpolicy/support/set_bools_tuns.awk b/refpolicy/support/set_bools_tuns.awk new file mode 100644 index 00000000..cedc19b7 --- /dev/null +++ b/refpolicy/support/set_bools_tuns.awk @@ -0,0 +1,11 @@ +# Read booleans.conf and output M4 directives to +# override default settings in global_booleans + +BEGIN { + FS="=" +} + +/^[[:blank:]]*[[:alpha:]]+/{ + gsub(/[[:blank:]]*/,"") + print "define(`"$1"_conf',`"$2"')" +} diff --git a/refpolicy/support/set_tunables b/refpolicy/support/set_tunables deleted file mode 100755 index 0adbc1a5..00000000 --- a/refpolicy/support/set_tunables +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -# this file exists because this line is -# too hard to escape correctly in a makefile - -if test -f $1; then - awk -F = '/^[[:blank:]]*[[:alpha:]]+/{ gsub(/[[:blank:]]*/,"") ; print "define(`"$1"_conf'\'',`"$2"'\'')" }' $1 -fi