]> gitweb.michael.orlitzky.com - postfix-logwatch.git/blob - Makefile
Changes: add the one change in v1.40.05.
[postfix-logwatch.git] / Makefile
1 program = postfix-logwatch
2 program_logwatch = postfix
3
4 src = $(program) \
5 $(program).conf \
6 $(program).conf-topn \
7 $(program).1 \
8 Changes Bugs README LICENSE
9
10 prefix_logwatch = /etc/logwatch
11 prefix_standalone = /usr/local
12
13
14 scriptdir_logwatch = $(prefix_logwatch)/scripts/services
15 confdir_logwatch = $(prefix_logwatch)/conf/services
16
17 scriptdir_standalone = $(prefix_standalone)/bin
18 confdir_standalone = $(prefix_standalone)/etc
19 mandir_standalone = $(prefix_standalone)/man/man1
20
21 INSTALL = /usr/bin/install -c
22
23 install:
24 @echo 'Run "make install-logwatch" to install as a logwatch filter'
25 @echo 'Run "make install-standalone" to install as a standalone utility'
26 @echo 'Run "make install-all" to install both'
27
28 install-logwatch:
29 $(INSTALL) -d -m 0755 \
30 $(DESTDIR)$(scriptdir_logwatch) \
31 $(DESTDIR)$(confdir_logwatch)
32 $(INSTALL) -m 0644 \
33 $(program) \
34 $(DESTDIR)$(scriptdir_logwatch)/$(program_logwatch)
35 $(INSTALL) -m 0644 \
36 $(program).conf \
37 $(DESTDIR)$(confdir_logwatch)/$(program_logwatch).conf
38 # removes taint mode (-T) to run under logwatch
39 perl -e 'while (<>) { $$.==1 and s/\s+-T$$//; print "$$_";}' \
40 -i $(DESTDIR)$(scriptdir_logwatch)/$(program_logwatch)
41
42 install-standalone:
43 $(INSTALL) -d -m 0755 \
44 $(DESTDIR)$(scriptdir_standalone) \
45 $(DESTDIR)$(confdir_standalone) \
46 $(DESTDIR)$(mandir_standalone)
47 $(INSTALL) -m 0755 \
48 $(program) \
49 $(DESTDIR)$(scriptdir_standalone)/$(program)
50 $(INSTALL) -m 0644 \
51 $(program).conf \
52 $(DESTDIR)$(confdir_standalone)/$(program).conf
53 $(INSTALL) -m 0644 \
54 $(program).1 \
55 $(DESTDIR)$(mandir_standalone)/$(program).1
56
57 install-all: install-logwatch install-standalone
58
59 uninstall-logwatch:
60 rm -f $(DESTDIR)$(scriptdir_logwatch)/$(program_logwatch) \
61 $(DESTDIR)$(confdir_logwatch)/$(program_logwatch).conf
62 rm -rf $(DESTDIR)$(scriptdir_logwatch) \
63 $(DESTDIR)$(confdir_logwatch)
64
65 uninstall-standalone:
66 rm -f $(DESTDIR)$(scriptdir_standalone)/$(program) \
67 $(DESTDIR)$(confdir_standalone)/$(program).conf \
68 $(DESTDIR)$(mandir_standalone)/$(program).1
69 rm -rf $(DESTDIR)$(scriptdir_standalone) \
70 $(DESTDIR)$(confdir_standalone) \
71 $(DESTDIR)$(mandir_standalone)
72
73 uninstall-all: uninstall-logwatch uninstall-standalone
74
75 .PHONY: release
76 release:
77 vers=`egrep 'Version[ ]*=' $(program) | sed "s/.*'\(.*\)';/\1/"` ; \
78 echo Preparing version $$vers; \
79 rel=$(program)-$$vers ; \
80 tar -cJf $${rel}.tar.xz --transform=s",^,$${rel}/," $(src);
81
82 $(program).1.html: $(program).1
83 man2html $< > $@;