• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1PKG_CONFIG ?= pkg-config
2
3# Installation directories.
4LINGUAS ?= ru
5PREFIX ?= /usr
6SBINDIR ?= $(PREFIX)/sbin
7MANDIR = $(PREFIX)/share/man
8AUTOSTARTDIR = /etc/xdg/autostart
9DBUSSERVICEDIR = $(PREFIX)/share/dbus-1/services
10SYSTEMDSYSTEMUNITDIR ?= $(shell $(PKG_CONFIG) --variable=systemdsystemunitdir systemd)
11SYSTEMDUSERUNITDIR ?= $(shell $(PKG_CONFIG) --variable=systemduserunitdir systemd)
12
13autostart_DATA = sealertauto.desktop
14INITDIR ?= /etc/rc.d/init.d
15SELINUXDIR = /etc/selinux
16
17GIO_CFLAGS = -DHAVE_DBUS $(shell $(PKG_CONFIG) --cflags gio-2.0)
18GIO_LIBS = $(shell $(PKG_CONFIG) --libs gio-2.0)
19
20CFLAGS ?= -g -Werror -Wall -W
21override CFLAGS += $(GIO_CFLAGS)
22
23override LDLIBS += -lselinux $(GIO_LIBS)
24
25all: restorecond
26
27restorecond.o utmpwatcher.o stringslist.o user.o watch.o: restorecond.h
28
29restorecond:  restore.o restorecond.o utmpwatcher.o stringslist.o user.o watch.o
30	$(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS)
31
32install: all
33	[ -d $(DESTDIR)$(MANDIR)/man8 ] || mkdir -p $(DESTDIR)$(MANDIR)/man8
34	-mkdir -p $(DESTDIR)$(SBINDIR)
35	install -m 755 restorecond $(DESTDIR)$(SBINDIR)
36	install -m 644 restorecond.8 $(DESTDIR)$(MANDIR)/man8
37	for lang in $(LINGUAS) ; do \
38		if [ -e $${lang} ] ; then \
39			[ -d $(DESTDIR)$(MANDIR)/$${lang}/man8 ] || mkdir -p $(DESTDIR)$(MANDIR)/$${lang}/man8 ; \
40			install -m 644 $${lang}/*.8 $(DESTDIR)$(MANDIR)/$${lang}/man8/ ; \
41		fi ; \
42	done
43	-mkdir -p $(DESTDIR)$(INITDIR)
44	install -m 755 restorecond.init $(DESTDIR)$(INITDIR)/restorecond
45	-mkdir -p $(DESTDIR)$(SELINUXDIR)
46	install -m 644 restorecond.conf $(DESTDIR)$(SELINUXDIR)/restorecond.conf
47	install -m 644 restorecond_user.conf $(DESTDIR)$(SELINUXDIR)/restorecond_user.conf
48	-mkdir -p $(DESTDIR)$(AUTOSTARTDIR)
49	install -m 644 restorecond.desktop $(DESTDIR)$(AUTOSTARTDIR)/restorecond.desktop
50	-mkdir -p $(DESTDIR)$(DBUSSERVICEDIR)
51	install -m 644 org.selinux.Restorecond.service  $(DESTDIR)$(DBUSSERVICEDIR)/org.selinux.Restorecond.service
52	-mkdir -p $(DESTDIR)$(SYSTEMDSYSTEMUNITDIR)
53	install -m 644 restorecond.service $(DESTDIR)$(SYSTEMDSYSTEMUNITDIR)
54	-mkdir -p $(DESTDIR)$(SYSTEMDUSERUNITDIR)
55	install -m 644 restorecond_user.service $(DESTDIR)$(SYSTEMDUSERUNITDIR)
56relabel: install
57	/sbin/restorecon $(DESTDIR)$(SBINDIR)/restorecond
58
59clean:
60	-rm -f restorecond *.o *~
61
62indent:
63	../../scripts/Lindent $(wildcard *.[ch])
64
65test:
66