2016-10-30 19:15:08 +00:00
|
|
|
PKG_CONFIG ?= pkg-config
|
|
|
|
|
2008-08-19 19:30:36 +00:00
|
|
|
# Installation directories.
|
2011-09-19 20:38:33 +00:00
|
|
|
PREFIX ?= $(DESTDIR)/usr
|
2008-08-19 19:30:36 +00:00
|
|
|
SBINDIR ?= $(PREFIX)/sbin
|
2011-08-03 15:40:47 +00:00
|
|
|
LIBDIR ?= $(PREFIX)/lib
|
2008-08-19 19:30:36 +00:00
|
|
|
MANDIR = $(PREFIX)/share/man
|
2011-08-03 15:40:47 +00:00
|
|
|
AUTOSTARTDIR = $(DESTDIR)/etc/xdg/autostart
|
|
|
|
DBUSSERVICEDIR = $(DESTDIR)/usr/share/dbus-1/services
|
2013-10-09 21:36:36 +00:00
|
|
|
SYSTEMDDIR ?= $(DESTDIR)/usr/lib/systemd
|
2011-08-03 15:40:47 +00:00
|
|
|
|
|
|
|
autostart_DATA = sealertauto.desktop
|
2013-10-09 21:36:36 +00:00
|
|
|
INITDIR ?= $(DESTDIR)/etc/rc.d/init.d
|
2008-08-19 19:30:36 +00:00
|
|
|
SELINUXDIR = $(DESTDIR)/etc/selinux
|
|
|
|
|
2016-10-30 19:15:08 +00:00
|
|
|
DBUSFLAGS = -DHAVE_DBUS $(shell $(PKG_CONFIG) --cflags dbus-glib-1)
|
|
|
|
DBUSLIB = $(shell $(PKG_CONFIG) --libs dbus-glib-1)
|
2011-08-03 15:40:47 +00:00
|
|
|
|
2008-08-19 19:30:36 +00:00
|
|
|
CFLAGS ?= -g -Werror -Wall -W
|
2017-04-24 17:59:56 +00:00
|
|
|
override CFLAGS += $(DBUSFLAGS)
|
2011-08-03 15:40:47 +00:00
|
|
|
|
2016-09-15 16:14:33 +00:00
|
|
|
USE_PCRE2 ?= n
|
|
|
|
ifeq ($(USE_PCRE2),y)
|
2017-04-24 17:59:57 +00:00
|
|
|
PCRE_CFLAGS := -DUSE_PCRE2 -DPCRE2_CODE_UNIT_WIDTH=8 $(shell $(PKG_CONFIG) --cflags libpcre2-8)
|
|
|
|
PCRE_LDLIBS := $(shell $(PKG_CONFIG) --libs libpcre2-8)
|
2016-09-15 16:14:33 +00:00
|
|
|
else
|
2017-04-24 17:59:57 +00:00
|
|
|
PCRE_CFLAGS := $(shell $(PKG_CONFIG) --cflags libpcre)
|
|
|
|
PCRE_LDLIBS := $(shell $(PKG_CONFIG) --libs libpcre)
|
2016-09-15 16:14:33 +00:00
|
|
|
endif
|
2017-04-24 17:59:57 +00:00
|
|
|
export PCRE_CFLAGS PCRE_LDLIBS
|
2016-09-15 16:14:33 +00:00
|
|
|
|
2017-06-20 15:16:41 +00:00
|
|
|
override LDLIBS += -lselinux $(PCRE_LDLIBS) $(DBUSLIB)
|
2008-08-19 19:30:36 +00:00
|
|
|
|
|
|
|
all: restorecond
|
|
|
|
|
2011-08-03 15:40:47 +00:00
|
|
|
restorecond.o utmpwatcher.o stringslist.o user.o watch.o: restorecond.h
|
|
|
|
|
2016-11-08 19:21:10 +00:00
|
|
|
restorecond: restore.o restorecond.o utmpwatcher.o stringslist.o user.o watch.o
|
2008-08-19 19:30:36 +00:00
|
|
|
$(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS)
|
|
|
|
|
|
|
|
install: all
|
|
|
|
[ -d $(MANDIR)/man8 ] || mkdir -p $(MANDIR)/man8
|
|
|
|
-mkdir -p $(SBINDIR)
|
|
|
|
install -m 755 restorecond $(SBINDIR)
|
|
|
|
install -m 644 restorecond.8 $(MANDIR)/man8
|
|
|
|
-mkdir -p $(INITDIR)
|
2009-02-17 16:42:15 +00:00
|
|
|
install -m 755 restorecond.init $(INITDIR)/restorecond
|
2008-08-19 19:30:36 +00:00
|
|
|
-mkdir -p $(SELINUXDIR)
|
2011-08-03 15:40:47 +00:00
|
|
|
install -m 644 restorecond.conf $(SELINUXDIR)/restorecond.conf
|
|
|
|
install -m 644 restorecond_user.conf $(SELINUXDIR)/restorecond_user.conf
|
|
|
|
-mkdir -p $(AUTOSTARTDIR)
|
|
|
|
install -m 644 restorecond.desktop $(AUTOSTARTDIR)/restorecond.desktop
|
|
|
|
-mkdir -p $(DBUSSERVICEDIR)
|
|
|
|
install -m 600 org.selinux.Restorecond.service $(DBUSSERVICEDIR)/org.selinux.Restorecond.service
|
2013-10-09 21:36:36 +00:00
|
|
|
-mkdir -p $(SYSTEMDDIR)/system
|
|
|
|
install -m 644 restorecond.service $(SYSTEMDDIR)/system/
|
2008-08-19 19:30:36 +00:00
|
|
|
relabel: install
|
|
|
|
/sbin/restorecon $(SBINDIR)/restorecond
|
|
|
|
|
|
|
|
clean:
|
|
|
|
-rm -f restorecond *.o *~
|
|
|
|
|
|
|
|
indent:
|
|
|
|
../../scripts/Lindent $(wildcard *.[ch])
|
|
|
|
|
2016-11-16 14:05:20 +00:00
|
|
|
test:
|