1 PYTHON ?= python 2 3 # Installation directories. 4 PREFIX ?= $(DESTDIR)/usr 5 SYSCONFDIR ?= $(DESTDIR)/etc/sysconfig 6 LIBDIR ?= $(PREFIX)/lib 7 BINDIR ?= $(PREFIX)/bin 8 SBINDIR ?= $(PREFIX)/sbin 9 DATADIR ?= $(PREFIX)/share 10 MANDIR ?= $(PREFIX)/share/man 11 LOCALEDIR ?= /usr/share/locale 12 BASHCOMPLETIONDIR ?= $(DESTDIR)/usr/share/bash-completion/completions 13 SHAREDIR ?= $(PREFIX)/share/sandbox 14 override CFLAGS = -I$(PREFIX)/include -DPACKAGE="policycoreutils" -Wall -Werror -Wextra -W -DSHARED -shared 15 16 BASHCOMPLETIONS=sepolicy-bash-completion.sh 17 18 all: python-build 19 20 python-build: info.c search.c common.h policy.h policy.c 21 $(PYTHON) setup.py build 22 23 clean: 24 $(PYTHON) setup.py clean 25 -rm -rf build *~ \#* *pyc .#* 26 27 sepolgen: 28 ln -sf sepolicy sepolgen 29 30 test: 31 @$(PYTHON) test_sepolicy.py -v 32 33 install: 34 $(PYTHON) setup.py install `test -n "$(DESTDIR)" && echo --root $(DESTDIR)` 35 [ -d $(BINDIR) ] || mkdir -p $(BINDIR) 36 install -m 755 sepolicy.py $(BINDIR)/sepolicy 37 (cd $(BINDIR); ln -sf sepolicy sepolgen) 38 -mkdir -p $(MANDIR)/man8 39 install -m 644 *.8 $(MANDIR)/man8 40 -mkdir -p $(BASHCOMPLETIONDIR) 41 install -m 644 $(BASHCOMPLETIONS) $(BASHCOMPLETIONDIR)/sepolicy 42 -mkdir -p $(DESTDIR)/etc/dbus-1/system.d/ 43 install -m 644 org.selinux.conf $(DESTDIR)/etc/dbus-1/system.d/ 44 -mkdir -p $(DESTDIR)/usr/share/dbus-1/system-services 45 install -m 644 org.selinux.service $(DESTDIR)/usr/share/dbus-1/system-services 46 -mkdir -p $(DESTDIR)/usr/share/polkit-1/actions/ 47 install -m 644 org.selinux.policy $(DESTDIR)/usr/share/polkit-1/actions/ 48 -mkdir -p $(DESTDIR)/usr/share/system-config-selinux 49 install -m 755 selinux_server.py $(DESTDIR)/usr/share/system-config-selinux 50 install -m 644 *.desktop $(DATADIR)/system-config-selinux 51 -mkdir -p $(DESTDIR) $(DATADIR)/pixmaps 52 install -m 644 sepolicy_256.png $(DATADIR)/pixmaps/sepolicy.png 53 for i in 16 22 32 48 256; do \ 54 mkdir -p $(DESTDIR) $(DATADIR)/icons/hicolor/$${i}x$${i}/apps; \ 55 install -m 644 sepolicy_$${i}.png $(DATADIR)/icons/hicolor/$${i}x$${i}/apps/sepolicy.png; \ 56 done 57 58 relabel: 59