-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
88 lines (76 loc) · 3.01 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/usr/bin/make -f
CONFDIR = etc/logcheck
SBINDIR = usr/sbin
BINDIR = usr/bin
SHAREDIR = usr/share/logtail/detectrotate
all:
install:
# Create the directories
install -m 750 -d $(DESTDIR)/$(CONFDIR)
install -d $(DESTDIR)/var/lib/logcheck
install -d $(DESTDIR)/$(SBINDIR)
install -d $(DESTDIR)/$(BINDIR)
install -d $(DESTDIR)/var/lock/logcheck
install -d $(DESTDIR)/$(SHAREDIR)
install -m 2750 -d $(DESTDIR)/$(CONFDIR)/ignore.d.paranoid
install -m 2750 -d $(DESTDIR)/$(CONFDIR)/ignore.d.workstation
install -m 2750 -d $(DESTDIR)/$(CONFDIR)/ignore.d.server
install -m 2750 -d $(DESTDIR)/$(CONFDIR)/cracking.d
install -m 2750 -d $(DESTDIR)/$(CONFDIR)/cracking.ignore.d
install -m 2750 -d $(DESTDIR)/$(CONFDIR)/violations.d
install -m 2750 -d $(DESTDIR)/$(CONFDIR)/violations.ignore.d
# Install the scripts
install -m 755 src/logcheck $(DESTDIR)/$(SBINDIR)/
install -m 755 src/logtail $(DESTDIR)/$(SBINDIR)/
install -m 755 src/logtail2 $(DESTDIR)/$(SBINDIR)/
install -m 755 src/logcheck-test $(DESTDIR)/$(BINDIR)/
install -m 755 src/detectrotate/10-savelog.dtr $(DESTDIR)/$(SHAREDIR)/
install -m 755 src/detectrotate/20-logrotate.dtr $(DESTDIR)/$(SHAREDIR)/
install -m 755 src/detectrotate/30-logrotate-dateext.dtr $(DESTDIR)/$(SHAREDIR)/
# Install the config files
install -m 640 etc/logcheck.logfiles $(DESTDIR)/$(CONFDIR)
install -m 640 etc/logcheck.conf $(DESTDIR)/$(CONFDIR)
# Install the rulefiles
install -m 644 rulefiles/linux/ignore.d.paranoid/* \
$(DESTDIR)/$(CONFDIR)/ignore.d.paranoid/
install -m 644 rulefiles/linux/ignore.d.server/* \
$(DESTDIR)/$(CONFDIR)/ignore.d.server/
install -m 644 rulefiles/linux/ignore.d.workstation/* \
$(DESTDIR)/$(CONFDIR)/ignore.d.workstation/
install -m 644 rulefiles/linux/violations.d/* \
$(DESTDIR)/$(CONFDIR)/violations.d/
install -m 644 rulefiles/linux/violations.ignore.d/* \
$(DESTDIR)/$(CONFDIR)/violations.ignore.d/
install -m 644 rulefiles/linux/cracking.d/* \
$(DESTDIR)/$(CONFDIR)/cracking.d/
clean:
# Remove the scripts
-rm -f $(DESTDIR)/$(SBINDIR)/logcheck
-rm -f $(DESTDIR)/$(SBINDIR)/logtail
-rm -f $(DESTDIR)/$(SBINDIR)/logtail2
-rm -f $(DESTDIR)/$(BINDIR)/logcheck-test
# Remove the configfiles
-rm -f $(DESTDIR)/$(CONFDIR)/logcheck.logfiles
-rm -f $(DESTDIR)/$(CONFDIR)/logcheck.conf
# Remove the rulesfiles
-rm -rf $(DESTDIR)/$(CONFDIR)/ignore.d.paranoid/
-rm -rf $(DESTDIR)/$(CONFDIR)/ignore.d.server/
-rm -rf $(DESTDIR)/$(CONFDIR)/ignore.d.workstation/
-rm -rf $(DESTDIR)/$(CONFDIR)/violations.d/
-rm -rf $(DESTDIR)/$(CONFDIR)/violations.d/
-rm -rf $(DESTDIR)/$(CONFDIR)/violations.ignore.d/
-rm -rf $(DESTDIR)/$(CONFDIR)/cracking.d/
# Remove the statedir and it's contents
-rm -rf $(DESTDIR)/var/lib/logcheck
# Finally remove the config directory
-rmdir $(DESTDIR)/$(CONFDIR)
distclean:
-find . -name "*~" | xargs -r --no-run-if-empty rm -vf
check:
#cd test; python test.py
system-test:
cd test; rm -fv state/*; \
../src/logcheck -c ../etc/logcheck.conf \
-l ../etc/logcheck.logfiles \
-r ../rulefiles/linux \
-S state/ -o