]> git.ipfire.org Git - people/stevee/selinux-policy.git/blame_incremental - refpolicy/Makefile
fix copyright years
[people/stevee/selinux-policy.git] / refpolicy / Makefile
... / ...
CommitLineData
1#
2# Makefile for the security policy.
3#
4# Targets:
5#
6# install - compile and install the policy configuration, and context files.
7# load - compile, install, and load the policy configuration.
8# reload - compile, install, and load/reload the policy configuration.
9# relabel - relabel filesystems based on the file contexts configuration.
10# checklabels - check filesystems against the file context configuration
11# restorelabels - check filesystems against the file context configuration
12# and restore the label of files with incorrect labels
13# policy - compile the policy configuration locally for testing/development.
14#
15# The default target is 'policy'.
16#
17#
18# Please see build.conf for policy build options.
19#
20
21########################################
22#
23# NO OPTIONS BELOW HERE
24#
25
26# Include the local build.conf if it exists, otherwise
27# include the configuration of the root directory.
28include build.conf
29
30ifdef LOCAL_ROOT
31 -include $(LOCAL_ROOT)/build.conf
32endif
33
34# refpolicy version
35VERSION = $(shell cat VERSION)
36
37ifdef LOCAL_ROOT
38BUILDDIR := $(LOCAL_ROOT)/
39TMPDIR := $(LOCAL_ROOT)/tmp
40TAGS := $(LOCAL_ROOT)/tags
41else
42TMPDIR := tmp
43TAGS := tags
44endif
45
46# executable paths
47BINDIR := /usr/bin
48SBINDIR := /usr/sbin
49CHECKPOLICY := $(BINDIR)/checkpolicy
50CHECKMODULE := $(BINDIR)/checkmodule
51SEMODULE := $(SBINDIR)/semodule
52SEMOD_PKG := $(BINDIR)/semodule_package
53SEMOD_LNK := $(BINDIR)/semodule_link
54SEMOD_EXP := $(BINDIR)/semodule_expand
55LOADPOLICY := $(SBINDIR)/load_policy
56SETFILES := $(SBINDIR)/setfiles
57XMLLINT := $(BINDIR)/xmllint
58SECHECK := $(BINDIR)/sechecker
59
60# interpreters and aux tools
61AWK ?= gawk
62GREP ?= egrep
63M4 ?= m4
64PYTHON ?= python
65SED ?= sed
66SORT ?= LC_ALL=C sort
67
68CFLAGS += -Wall
69
70# policy source layout
71POLDIR := policy
72MODDIR := $(POLDIR)/modules
73FLASKDIR := $(POLDIR)/flask
74SECCLASS := $(FLASKDIR)/security_classes
75ISIDS := $(FLASKDIR)/initial_sids
76AVS := $(FLASKDIR)/access_vectors
77
78# local source layout
79ifdef LOCAL_ROOT
80LOCAL_POLDIR := $(LOCAL_ROOT)/policy
81LOCAL_MODDIR := $(LOCAL_POLDIR)/modules
82endif
83
84# policy building support tools
85SUPPORT := support
86GENXML := $(PYTHON) $(SUPPORT)/segenxml.py
87GENDOC := $(PYTHON) $(SUPPORT)/sedoctool.py
88GENPERM := $(PYTHON) $(SUPPORT)/genclassperms.py
89FCSORT := $(TMPDIR)/fc_sort
90SETBOOLS := $(AWK) -f $(SUPPORT)/set_bools_tuns.awk
91get_type_attr_decl := $(SED) -r -f $(SUPPORT)/get_type_attr_decl.sed
92comment_move_decl := $(SED) -r -f $(SUPPORT)/comment_move_decl.sed
93# use our own genhomedircon to make sure we have a known usable one,
94# so policycoreutils updates are not required (RHEL4)
95genhomedircon := $(PYTHON) $(SUPPORT)/genhomedircon
96
97# documentation paths
98DOCS := doc
99XMLDTD = $(DOCS)/policy.dtd
100LAYERXML = metadata.xml
101DOCTEMPLATE = $(DOCS)/templates
102DOCFILES = $(DOCS)/Makefile.example $(addprefix $(DOCS)/,example.te example.if example.fc)
103
104ifndef LOCAL_ROOT
105POLXML = $(DOCS)/policy.xml
106TUNXML = $(DOCS)/global_tunables.xml
107BOOLXML = $(DOCS)/global_booleans.xml
108HTMLDIR = $(DOCS)/html
109else
110POLXML = $(LOCAL_ROOT)/doc/policy.xml
111TUNXML = $(LOCAL_ROOT)/doc/global_tunables.xml
112BOOLXML = $(LOCAL_ROOT)/doc/global_booleans.xml
113HTMLDIR = $(LOCAL_ROOT)/doc/html
114endif
115
116# config file paths
117GLOBALTUN = $(POLDIR)/global_tunables
118GLOBALBOOL = $(POLDIR)/global_booleans
119TUNABLES = $(POLDIR)/tunables.conf
120ROLEMAP = $(POLDIR)/rolemap
121USER_FILES := $(POLDIR)/users
122
123# local config file paths
124ifndef LOCAL_ROOT
125MOD_CONF = $(POLDIR)/modules.conf
126BOOLEANS = $(POLDIR)/booleans.conf
127else
128MOD_CONF = $(LOCAL_POLDIR)/modules.conf
129BOOLEANS = $(LOCAL_POLDIR)/booleans.conf
130endif
131
132# install paths
133PKGNAME ?= refpolicy-$(VERSION)
134PREFIX = $(DESTDIR)/usr
135TOPDIR = $(DESTDIR)/etc/selinux
136INSTALLDIR = $(TOPDIR)/$(NAME)
137SRCPATH = $(INSTALLDIR)/src
138USERPATH = $(INSTALLDIR)/users
139CONTEXTPATH = $(INSTALLDIR)/contexts
140FCPATH = $(CONTEXTPATH)/files/file_contexts
141SHAREDIR = $(PREFIX)/share/selinux
142MODPKGDIR = $(SHAREDIR)/$(NAME)
143HEADERDIR = $(MODPKGDIR)/include
144DOCSDIR = $(PREFIX)/share/doc/$(PKGNAME)
145
146# compile strict policy if requested.
147ifneq ($(findstring strict,$(TYPE)),)
148 M4PARAM += -D strict_policy
149endif
150
151# compile targeted policy if requested.
152ifneq ($(findstring targeted,$(TYPE)),)
153 M4PARAM += -D targeted_policy
154endif
155
156# enable MLS if requested.
157ifneq ($(findstring -mls,$(TYPE)),)
158 M4PARAM += -D enable_mls
159 CHECKPOLICY += -M
160 CHECKMODULE += -M
161endif
162
163# enable MLS if MCS requested.
164ifneq ($(findstring -mcs,$(TYPE)),)
165 M4PARAM += -D enable_mcs
166 CHECKPOLICY += -M
167 CHECKMODULE += -M
168endif
169
170# enable distribution-specific policy
171ifneq ($(DISTRO),)
172 M4PARAM += -D distro_$(DISTRO)
173endif
174
175# rhel4 also implies redhat
176ifeq "$(DISTRO)" "rhel4"
177 M4PARAM += -D distro_redhat
178endif
179
180# enable polyinstantiation
181ifeq ($(POLY),y)
182 M4PARAM += -D enable_polyinstantiation
183endif
184
185ifneq ($(OUTPUT_POLICY),)
186 CHECKPOLICY += -c $(OUTPUT_POLICY)
187endif
188
189# if not set, use the type as the name.
190NAME ?= $(TYPE)
191
192ifeq ($(DIRECT_INITRC),y)
193 M4PARAM += -D direct_sysadm_daemon
194endif
195
196ifeq ($(QUIET),y)
197 verbose = @
198endif
199
200M4PARAM += -D hide_broken_symptoms
201
202# we need exuberant ctags; unfortunately it is named
203# differently on different distros
204ifeq ($(DISTRO),debian)
205 CTAGS := ctags-exuberant
206endif
207
208ifeq ($(DISTRO),gentoo)
209 CTAGS := exuberant-ctags
210endif
211
212CTAGS ?= ctags
213
214# determine the policy version and current kernel version if possible
215PV := $(shell $(CHECKPOLICY) -V |cut -f 1 -d ' ')
216KV := $(shell cat /selinux/policyvers)
217
218# dont print version warnings if we are unable to determine
219# the currently running kernel's policy version
220ifeq ($(KV),)
221 KV := $(PV)
222endif
223
224M4SUPPORT := $(wildcard $(POLDIR)/support/*.spt)
225ifdef LOCAL_ROOT
226M4SUPPORT += $(wildcard $(LOCAL_POLDIR)/support/*.spt)
227endif
228
229APPCONF := config/appconfig-$(TYPE)
230SEUSERS := $(APPCONF)/seusers
231APPDIR := $(CONTEXTPATH)
232APPFILES := $(addprefix $(APPDIR)/,default_contexts default_type initrc_context failsafe_context userhelper_context removable_context dbus_contexts customizable_types) $(CONTEXTPATH)/files/media
233CONTEXTFILES += $(wildcard $(APPCONF)/*_context*) $(APPCONF)/media
234
235ALL_LAYERS := $(filter-out $(MODDIR)/CVS,$(shell find $(wildcard $(MODDIR)/*) -maxdepth 0 -type d))
236ifdef LOCAL_ROOT
237ALL_LAYERS += $(filter-out $(LOCAL_MODDIR)/CVS,$(shell find $(wildcard $(LOCAL_MODDIR)/*) -maxdepth 0 -type d))
238endif
239
240GENERATED_TE := $(basename $(foreach dir,$(ALL_LAYERS),$(wildcard $(dir)/*.te.in)))
241GENERATED_IF := $(basename $(foreach dir,$(ALL_LAYERS),$(wildcard $(dir)/*.if.in)))
242GENERATED_FC := $(basename $(foreach dir,$(ALL_LAYERS),$(wildcard $(dir)/*.fc.in)))
243
244# sort here since it removes duplicates, which can happen
245# when a generated file is already generated
246DETECTED_MODS := $(sort $(foreach dir,$(ALL_LAYERS),$(wildcard $(dir)/*.te)) $(GENERATED_TE))
247
248# modules.conf setting for base module
249MODBASE := base
250
251# modules.conf setting for loadable module
252MODMOD := module
253
254# modules.conf setting for unused module
255MODUNUSED := off
256
257# test for module overrides from command line
258MOD_TEST = $(filter $(APPS_OFF), $(APPS_BASE) $(APPS_MODS))
259MOD_TEST += $(filter $(APPS_MODS), $(APPS_BASE))
260ifneq ($(strip $(MOD_TEST)),)
261 $(error Applications must be base, module, or off, and not in more than one list! $(strip $(MOD_TEST)) found in multiple lists!)
262endif
263
264# add on suffix to modules specified on command line
265CMDLINE_BASE := $(addsuffix .te,$(APPS_BASE))
266CMDLINE_MODS := $(addsuffix .te,$(APPS_MODS))
267CMDLINE_OFF := $(addsuffix .te,$(APPS_OFF))
268
269# extract settings from modules.conf
270MOD_CONF_BASE := $(addsuffix .te,$(sort $(shell awk '/^[[:blank:]]*[[:alpha:]]/{ if ($$3 == "$(MODBASE)") print $$1 }' $(MOD_CONF) 2> /dev/null)))
271MOD_CONF_MODS := $(addsuffix .te,$(sort $(shell awk '/^[[:blank:]]*[[:alpha:]]/{ if ($$3 == "$(MODMOD)") print $$1 }' $(MOD_CONF) 2> /dev/null)))
272MOD_CONF_OFF := $(addsuffix .te,$(sort $(shell awk '/^[[:blank:]]*[[:alpha:]]/{ if ($$3 == "$(MODUNUSED)") print $$1 }' $(MOD_CONF) 2> /dev/null)))
273
274BASE_MODS := $(CMDLINE_BASE)
275MOD_MODS := $(CMDLINE_MODS)
276OFF_MODS := $(CMDLINE_OFF)
277
278BASE_MODS += $(filter-out $(CMDLINE_OFF) $(CMDLINE_BASE) $(CMDLINE_MODS), $(MOD_CONF_BASE))
279MOD_MODS += $(filter-out $(CMDLINE_OFF) $(CMDLINE_BASE) $(CMDLINE_MODS), $(MOD_CONF_MODS))
280OFF_MODS += $(filter-out $(CMDLINE_OFF) $(CMDLINE_BASE) $(CMDLINE_MODS), $(MOD_CONF_OFF))
281
282# add modules not in modules.conf to the off list
283OFF_MODS += $(filter-out $(BASE_MODS) $(MOD_MODS) $(OFF_MODS),$(notdir $(DETECTED_MODS)))
284
285# filesystems to be used in labeling targets
286FILESYSTEMS = $(shell mount | grep -v "context=" | egrep -v '\((|.*,)bind(,.*|)\)' | awk '/(ext[23]| xfs| jfs).*rw/{print $$3}';)
287
288########################################
289#
290# Functions
291#
292
293# parse-rolemap modulename,outputfile
294define parse-rolemap
295 $(verbose) m4 $(M4PARAM) $(ROLEMAP) | \
296 awk '/^[[:blank:]]*[A-Za-z]/{ print "gen_require(type " $$3 "; role " $$1 ";)\n$1_per_userdomain_template(" $$2 "," $$3 "," $$1 ")" }' >> $2
297endef
298
299# peruser-expansion modulename,outputfile
300define peruser-expansion
301 $(verbose) echo "ifdef(\`""$1""_per_userdomain_template',\`" > $2
302 $(call parse-rolemap,$1,$2)
303 $(verbose) echo "')" >> $2
304endef
305
306########################################
307#
308# Load appropriate rules
309#
310
311ifeq ($(MONOLITHIC),y)
312 include Rules.monolithic
313else
314 include Rules.modular
315endif
316
317########################################
318#
319# Generated files
320#
321# NOTE: There is no "local" version of these files.
322#
323generate: $(GENERATED_TE) $(GENERATED_IF) $(GENERATED_FC)
324
325$(MODDIR)/kernel/corenetwork.if: $(MODDIR)/kernel/corenetwork.if.m4 $(MODDIR)/kernel/corenetwork.if.in
326 @echo "#" > $@
327 @echo "# This is a generated file! Instead of modifying this file, the" >> $@
328 @echo "# $(notdir $@).in or $(notdir $@).m4 file should be modified." >> $@
329 @echo "#" >> $@
330 $(verbose) cat $(MODDIR)/kernel/corenetwork.if.in >> $@
331 $(verbose) egrep "^[[:blank:]]*network_(interface|node|port|packet)\(.*\)" $(@:.if=.te).in \
332 | m4 -D self_contained_policy $(M4PARAM) $(MODDIR)/kernel/corenetwork.if.m4 - \
333 | sed -e 's/dollarsone/\$$1/g' -e 's/dollarszero/\$$0/g' >> $@
334
335$(MODDIR)/kernel/corenetwork.te: $(MODDIR)/kernel/corenetwork.te.m4 $(MODDIR)/kernel/corenetwork.te.in
336 @echo "#" > $@
337 @echo "# This is a generated file! Instead of modifying this file, the" >> $@
338 @echo "# $(notdir $@).in or $(notdir $@).m4 file should be modified." >> $@
339 @echo "#" >> $@
340 $(verbose) m4 -D self_contained_policy $(M4PARAM) $^ \
341 | sed -e 's/dollarsone/\$$1/g' -e 's/dollarszero/\$$0/g' >> $@
342
343########################################
344#
345# Create config files
346#
347conf: $(MOD_CONF) $(BOOLEANS) $(GENERATED_TE) $(GENERATED_IF) $(GENERATED_FC)
348
349$(MOD_CONF) $(BOOLEANS): $(POLXML)
350 @echo "Updating $(MOD_CONF) and $(BOOLEANS)"
351 $(verbose) $(GENDOC) -b $(BOOLEANS) -m $(MOD_CONF) -x $(POLXML)
352
353########################################
354#
355# Generate the fc_sort program
356#
357$(FCSORT) : $(SUPPORT)/fc_sort.c
358 $(verbose) $(CC) $(CFLAGS) $(SUPPORT)/fc_sort.c -o $(FCSORT)
359
360########################################
361#
362# Documentation generation
363#
364
365# minimal dependencies here, because we don't want to rebuild
366# this and its dependents every time the dependencies
367# change. Also use all .if files here, rather then just the
368# enabled modules.
369xml: $(POLXML)
370$(POLXML): $(DETECTED_MODS:.te=.if) $(foreach dir,$(ALL_LAYERS),$(dir)/$(LAYERXML))
371 @echo "Creating $(@F)"
372 @test -d $(dir $(POLXML)) || mkdir -p $(dir $(POLXML))
373 @test -d $(TMPDIR) || mkdir -p $(TMPDIR)
374 $(verbose) echo '<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>' > $@
375 $(verbose) echo '<!DOCTYPE policy SYSTEM "$(notdir $(XMLDTD))">' >> $@
376 $(verbose) $(GENXML) -w -m $(LAYERXML) -t $(GLOBALTUN) -b $(GLOBALBOOL) -o $(DOCS) $(ALL_LAYERS) >> $@
377 $(verbose) if test -x $(XMLLINT) && test -f $(XMLDTD); then \
378 $(XMLLINT) --noout --path $(dir $(XMLDTD)) --dtdvalid $(XMLDTD) $@ ;\
379 fi
380
381$(TUNXML) $(BOOLXML): $(POLXML)
382
383html $(TMPDIR)/html: $(POLXML)
384 @echo "Building html interface reference documentation in $(HTMLDIR)"
385 @test -d $(HTMLDIR) || mkdir -p $(HTMLDIR)
386 @test -d $(TMPDIR) || mkdir -p $(TMPDIR)
387 $(verbose) $(GENDOC) -d $(HTMLDIR) -T $(DOCTEMPLATE) -x $(POLXML)
388 $(verbose) cp $(DOCTEMPLATE)/*.css $(HTMLDIR)
389 @touch $(TMPDIR)/html
390
391########################################
392#
393# Runtime binary policy patching of users
394#
395$(USERPATH)/system.users: $(M4SUPPORT) $(TMPDIR)/generated_definitions.conf $(USER_FILES)
396 @mkdir -p $(TMPDIR)
397 @mkdir -p $(USERPATH)
398 @echo "Installing system.users"
399 @echo "# " > $(TMPDIR)/system.users
400 @echo "# Do not edit this file. " >> $(TMPDIR)/system.users
401 @echo "# This file is replaced on reinstalls of this policy." >> $(TMPDIR)/system.users
402 @echo "# Please edit local.users to make local changes." >> $(TMPDIR)/system.users
403 @echo "#" >> $(TMPDIR)/system.users
404 $(verbose) m4 -D self_contained_policy $(M4PARAM) $^ | sed -r -e 's/^[[:blank:]]+//' \
405 -e '/^[[:blank:]]*($$|#)/d' >> $(TMPDIR)/system.users
406 $(verbose) install -m 644 $(TMPDIR)/system.users $@
407
408$(USERPATH)/local.users: config/local.users
409 @mkdir -p $(USERPATH)
410 @echo "Installing local.users"
411 $(verbose) install -b -m 644 $< $@
412
413########################################
414#
415# Appconfig files
416#
417install-appconfig: $(APPFILES)
418
419$(INSTALLDIR)/booleans: $(BOOLEANS)
420 @mkdir -p $(TMPDIR)
421 @mkdir -p $(INSTALLDIR)
422 $(verbose) sed -r -e 's/false/0/g' -e 's/true/1/g' \
423 -e '/^[[:blank:]]*($$|#)/d' $(BOOLEANS) | sort > $(TMPDIR)/booleans
424 $(verbose) install -m 644 $(TMPDIR)/booleans $@
425
426$(CONTEXTPATH)/files/media: $(APPCONF)/media
427 @mkdir -p $(CONTEXTPATH)/files/
428 $(verbose) install -m 644 $< $@
429
430$(APPDIR)/default_contexts: $(APPCONF)/default_contexts
431 @mkdir -p $(APPDIR)
432 $(verbose) install -m 644 $< $@
433
434$(APPDIR)/removable_context: $(APPCONF)/removable_context
435 @mkdir -p $(APPDIR)
436 $(verbose) install -m 644 $< $@
437
438$(APPDIR)/default_type: $(APPCONF)/default_type
439 @mkdir -p $(APPDIR)
440 $(verbose) install -m 644 $< $@
441
442$(APPDIR)/userhelper_context: $(APPCONF)/userhelper_context
443 @mkdir -p $(APPDIR)
444 $(verbose) install -m 644 $< $@
445
446$(APPDIR)/initrc_context: $(APPCONF)/initrc_context
447 @mkdir -p $(APPDIR)
448 $(verbose) install -m 644 $< $@
449
450$(APPDIR)/failsafe_context: $(APPCONF)/failsafe_context
451 @mkdir -p $(APPDIR)
452 $(verbose) install -m 644 $< $@
453
454$(APPDIR)/dbus_contexts: $(APPCONF)/dbus_contexts
455 @mkdir -p $(APPDIR)
456 $(verbose) install -m 644 $< $@
457
458$(APPDIR)/users/root: $(APPCONF)/root_default_contexts
459 @mkdir -p $(APPDIR)/users
460 $(verbose) install -m 644 $< $@
461
462########################################
463#
464# Install policy headers
465#
466install-headers: $(TUNXML) $(BOOLXML)
467 @mkdir -p $(HEADERDIR)
468 @echo "Installing $(TYPE) policy headers."
469 $(verbose) install -m 644 $(TUNXML) $(BOOLXML) $(HEADERDIR)
470 $(verbose) m4 $(M4PARAM) $(ROLEMAP) > $(HEADERDIR)/$(notdir $(ROLEMAP))
471 $(verbose) mkdir -p $(HEADERDIR)/support
472 $(verbose) install -m 644 $(M4SUPPORT) $(word $(words $(GENXML)),$(GENXML)) $(XMLDTD) $(HEADERDIR)/support
473 $(verbose) $(GENPERM) $(AVS) $(SECCLASS) > $(HEADERDIR)/support/all_perms.spt
474 $(verbose) for i in $(notdir $(ALL_LAYERS)); do \
475 mkdir -p $(HEADERDIR)/$$i ;\
476 install -m 644 $(MODDIR)/$$i/*.if \
477 $(MODDIR)/$$i/metadata.xml \
478 $(HEADERDIR)/$$i ;\
479 done
480 $(verbose) echo "TYPE ?= $(TYPE)" > $(HEADERDIR)/build.conf
481 $(verbose) echo "NAME ?= $(NAME)" >> $(HEADERDIR)/build.conf
482ifneq "$(DISTRO)" ""
483 $(verbose) echo "DISTRO ?= $(DISTRO)" >> $(HEADERDIR)/build.conf
484endif
485 $(verbose) echo "MONOLITHIC ?= n" >> $(HEADERDIR)/build.conf
486 $(verbose) echo "DIRECT_INITRC ?= $(DIRECT_INITRC)" >> $(HEADERDIR)/build.conf
487 $(verbose) echo "POLY ?= $(POLY)" >> $(HEADERDIR)/build.conf
488 $(verbose) install -m 644 $(SUPPORT)/Makefile.devel $(HEADERDIR)/Makefile
489
490########################################
491#
492# Install policy documentation
493#
494install-docs: $(TMPDIR)/html
495 @mkdir -p $(DOCSDIR)/html
496 @echo "Installing policy documentation"
497 $(verbose) install -m 644 $(DOCFILES) $(DOCSDIR)
498 $(verbose) install -m 644 $(wildcard $(HTMLDIR)/*) $(DOCSDIR)/html
499
500########################################
501#
502# Install policy sources
503#
504install-src:
505 rm -rf $(SRCPATH)/policy.old
506 -mv $(SRCPATH)/policy $(SRCPATH)/policy.old
507 mkdir -p $(SRCPATH)/policy
508 cp -R . $(SRCPATH)/policy
509
510########################################
511#
512# Generate tags file
513#
514tags: $(TAGS)
515$(TAGS):
516 @($(CTAGS) --version | grep -q Exuberant) || (echo ERROR: Need exuberant-ctags to function!; exit 1)
517 @LC_ALL=C $(CTAGS) -f $(TAGS) --langdef=te --langmap=te:..te.if.spt \
518 --regex-te='/^type[ \t]+(\w+)(,|;)/\1/t,type/' \
519 --regex-te='/^typealias[ \t]+\w+[ \t+]+alias[ \t]+(\w+);/\1/t,type/' \
520 --regex-te='/^attribute[ \t]+(\w+);/\1/a,attribute/' \
521 --regex-te='/^[ \t]*define\(`(\w+)/\1/d,define/' \
522 --regex-te='/^[ \t]*interface\(`(\w+)/\1/i,interface/' \
523 --regex-te='/^[ \t]*bool[ \t]+(\w+)/\1/b,bool/' policy/modules/*/*.{if,te} policy/support/*.spt
524
525########################################
526#
527# Filesystem labeling
528#
529checklabels:
530 @echo "Checking labels on filesystem types: ext2 ext3 xfs jfs"
531 @if test -z "$(FILESYSTEMS)"; then \
532 echo "No filesystems with extended attributes found!" ;\
533 false ;\
534 fi
535 $(verbose) $(SETFILES) -v -n $(FCPATH) $(FILESYSTEMS)
536
537restorelabels:
538 @echo "Restoring labels on filesystem types: ext2 ext3 xfs jfs"
539 @if test -z "$(FILESYSTEMS)"; then \
540 echo "No filesystems with extended attributes found!" ;\
541 false ;\
542 fi
543 $(verbose) $(SETFILES) -v $(FCPATH) $(FILESYSTEMS)
544
545relabel:
546 @echo "Relabeling filesystem types: ext2 ext3 xfs jfs"
547 @if test -z "$(FILESYSTEMS)"; then \
548 echo "No filesystems with extended attributes found!" ;\
549 false ;\
550 fi
551 $(verbose) $(SETFILES) $(FCPATH) $(FILESYSTEMS)
552
553resetlabels:
554 @echo "Resetting labels on filesystem types: ext2 ext3 xfs jfs"
555 @if test -z "$(FILESYSTEMS)"; then \
556 echo "No filesystems with extended attributes found!" ;\
557 false ;\
558 fi
559 $(verbose) $(SETFILES) -F $(FCPATH) $(FILESYSTEMS)
560
561########################################
562#
563# Clean everything
564#
565bare: clean
566 rm -f $(POLXML)
567 rm -f $(TUNXML)
568 rm -f $(BOOLXML)
569 rm -f $(MOD_CONF)
570 rm -f $(BOOLEANS)
571 rm -fR $(HTMLDIR)
572 rm -f $(TAGS)
573# don't remove these files if we're given a local root
574ifndef LOCAL_ROOT
575 rm -f $(FCSORT)
576 rm -f $(SUPPORT)/*.pyc
577ifneq ($(GENERATED_TE),)
578 rm -f $(GENERATED_TE)
579endif
580ifneq ($(GENERATED_IF),)
581 rm -f $(GENERATED_IF)
582endif
583ifneq ($(GENERATED_FC),)
584 rm -f $(GENERATED_FC)
585endif
586endif
587
588.PHONY: install-src install-appconfig generate xml conf html bare tags
589.SUFFIXES:
590.SUFFIXES: .c