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
|
2020-04-30 11:08:35 +00:00
|
|
|
SYSTEMDSYSTEMUNITDIR ?= $(shell $(PKG_CONFIG) --variable=systemdsystemunitdir systemd)
|
|
|
|
SYSTEMDUSERUNITDIR ?= $(shell $(PKG_CONFIG) --variable=systemduserunitdir 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
|
|
|
|
2020-04-13 11:59:38 +00:00
|
|
|
GIO_CFLAGS = -DHAVE_DBUS $(shell $(PKG_CONFIG) --cflags gio-2.0)
|
|
|
|
GIO_LIBS = $(shell $(PKG_CONFIG) --libs gio-2.0)
|
2011-08-03 15:40:47 +00:00
|
|
|
|
2008-08-19 19:30:36 +00:00
|
|
|
CFLAGS ?= -g -Werror -Wall -W
|
2020-04-13 11:59:38 +00:00
|
|
|
override CFLAGS += $(GIO_CFLAGS)
|
2011-08-03 15:40:47 +00:00
|
|
|
|
2020-04-13 11:59:38 +00:00
|
|
|
override LDLIBS += -lselinux $(GIO_LIBS)
|
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
|
2020-04-30 11:08:35 +00:00
|
|
|
-mkdir -p $(DESTDIR)$(SYSTEMDSYSTEMUNITDIR)
|
|
|
|
install -m 644 restorecond.service $(DESTDIR)$(SYSTEMDSYSTEMUNITDIR)
|
|
|
|
-mkdir -p $(DESTDIR)$(SYSTEMDUSERUNITDIR)
|
|
|
|
install -m 644 restorecond_user.service $(DESTDIR)$(SYSTEMDUSERUNITDIR)
|
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:
|