]> gitweb.michael.orlitzky.com - postfix-logwatch.git/blob - Makefile
e0a3d2f820c8721b02009c610a99fa140576a2b8
[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 $(DESTDIR)$(scriptdir_logwatch) $(DESTDIR)$(confdir_logwatch) || exit 1;
30 $(INSTALL) -m 0644 $(program) $(DESTDIR)$(scriptdir_logwatch)/$(program_logwatch) || exit 1;
31 $(INSTALL) -m 0644 $(program).conf $(DESTDIR)$(confdir_logwatch)/$(program_logwatch).conf || exit 1;
32 # removes taint mode (-T) to run under logwatch
33 perl -e 'while (<>) { $$.==1 and s/\s+-T$$//; print "$$_";}' -i $(DESTDIR)$(scriptdir_logwatch)/$(program_logwatch)
34
35 install-standalone:
36 $(INSTALL) -d -m 0755 $(DESTDIR)$(scriptdir_standalone) $(DESTDIR)$(confdir_standalone) || exit 1;
37 $(INSTALL) -m 0755 $(program) $(DESTDIR)$(scriptdir_standalone)/$(program) || exit 1;
38 $(INSTALL) -m 0644 $(program).conf $(DESTDIR)$(confdir_standalone)/$(program).conf || exit 1;
39 $(INSTALL) -m 0644 $(program).1 $(DESTDIR)$(mandir_standalone)/$(program).1 || exit 1;
40
41 install-all: install-logwatch install-standalone
42
43 uninstall-logwatch:
44 -rm $(DESTDIR)$(scriptdir_logwatch)/$(program_logwatch) $(DESTDIR)$(confdir_logwatch)/$(program_logwatch).conf
45
46 uninstall-standalone:
47 -rm $(DESTDIR)$(scriptdir_standalone)/$(program) $(DESTDIR)$(confdir_standalone)/$(program).conf \
48 $(DESTDIR)$(mandir_standalone)/$(program).1
49
50 uninstall-all: uninstall-logwatch uninstall-standalone
51
52 .PHONY: release
53 release:
54 vers=`egrep 'Version[ ]*=' $(program) | sed "s/.*'\(.*\)';/\1/"` ; \
55 echo Preparing version $$vers; \
56 rel=$(program)-$$vers ; \
57 tar -cJf $${rel}.tar.xz --transform=s",^,$${rel}/," $(src);
58
59 $(program).1.html: $(program).1
60 man2html $< > $@;