2016-10-30 19:15:08 +00:00
|
|
|
PKG_CONFIG ?= pkg-config
|
|
|
|
|
2008-08-19 19:30:36 +00:00
|
|
|
# Installation directories.
|
2018-12-25 15:25:05 +00:00
|
|
|
LINGUAS ?= ru
|
2018-02-14 09:57:12 +00:00
|
|
|
PREFIX ?= /usr
|
2008-08-19 19:30:36 +00:00
|
|
|
SBINDIR ?= $(PREFIX)/sbin
|
|
|
|
MANDIR = $(PREFIX)/share/man
|
2018-02-14 09:57:12 +00:00
|
|
|
AUTOSTARTDIR = /etc/xdg/autostart
|
|
|
|
DBUSSERVICEDIR = $(PREFIX)/share/dbus-1/services
|
|
|
|
SYSTEMDDIR ?= $(PREFIX)/lib/systemd
|
2011-08-03 15:40:47 +00:00
|
|
|
|
|
|
|
autostart_DATA = sealertauto.desktop
|
2018-05-31 13:18:04 +00:00
|
|
|
INITDIR ?= /etc/rc.d/init.d
|
|
|
|
SELINUXDIR = /etc/selinux
|
2008-08-19 19:30:36 +00:00
|
|
|
|
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
|
|
|
|
2019-03-21 10:04:39 +00:00
|
|
|
override LDLIBS += -lselinux $(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
|
2018-02-14 09:57:12 +00:00
|
|
|
[ -d $(DESTDIR)$(MANDIR)/man8 ] || mkdir -p $(DESTDIR)$(MANDIR)/man8
|
|
|
|
-mkdir -p $(DESTDIR)$(SBINDIR)
|
|
|
|
install -m 755 restorecond $(DESTDIR)$(SBINDIR)
|
|
|
|
install -m 644 restorecond.8 $(DESTDIR)$(MANDIR)/man8
|
2018-12-25 15:25:05 +00:00
|
|
|
for lang in $(LINGUAS) ; do \
|
|
|
|
if [ -e $${lang} ] ; then \
|
|
|
|
[ -d $(DESTDIR)$(MANDIR)/$${lang}/man8 ] || mkdir -p $(DESTDIR)$(MANDIR)/$${lang}/man8 ; \
|
|
|
|
install -m 644 $${lang}/*.8 $(DESTDIR)$(MANDIR)/$${lang}/man8/ ; \
|
|
|
|
fi ; \
|
|
|
|
done
|
2018-05-31 13:18:04 +00:00
|
|
|
-mkdir -p $(DESTDIR)$(INITDIR)
|
|
|
|
install -m 755 restorecond.init $(DESTDIR)$(INITDIR)/restorecond
|
|
|
|
-mkdir -p $(DESTDIR)$(SELINUXDIR)
|
|
|
|
install -m 644 restorecond.conf $(DESTDIR)$(SELINUXDIR)/restorecond.conf
|
|
|
|
install -m 644 restorecond_user.conf $(DESTDIR)$(SELINUXDIR)/restorecond_user.conf
|
2018-02-14 09:57:12 +00:00
|
|
|
-mkdir -p $(DESTDIR)$(AUTOSTARTDIR)
|
|
|
|
install -m 644 restorecond.desktop $(DESTDIR)$(AUTOSTARTDIR)/restorecond.desktop
|
|
|
|
-mkdir -p $(DESTDIR)$(DBUSSERVICEDIR)
|
2019-01-22 11:47:24 +00:00
|
|
|
install -m 644 org.selinux.Restorecond.service $(DESTDIR)$(DBUSSERVICEDIR)/org.selinux.Restorecond.service
|
2018-02-14 09:57:12 +00:00
|
|
|
-mkdir -p $(DESTDIR)$(SYSTEMDDIR)/system
|
|
|
|
install -m 644 restorecond.service $(DESTDIR)$(SYSTEMDDIR)/system/
|
2008-08-19 19:30:36 +00:00
|
|
|
relabel: install
|
2018-02-14 09:57:12 +00:00
|
|
|
/sbin/restorecon $(DESTDIR)$(SBINDIR)/restorecond
|
2008-08-19 19:30:36 +00:00
|
|
|
|
|
|
|
clean:
|
|
|
|
-rm -f restorecond *.o *~
|
|
|
|
|
|
|
|
indent:
|
|
|
|
../../scripts/Lindent $(wildcard *.[ch])
|
|
|
|
|
2016-11-16 14:05:20 +00:00
|
|
|
test:
|