]> gitweb.michael.orlitzky.com - postfix-logwatch.git/blob - Makefile
Makefile: report logreporters stuff.
[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 $(program).1.html \
9 Changes Bugs Makefile README LICENSE
10
11 prefix_logwatch = /etc/logwatch
12 prefix_standalone = /usr/local
13
14
15 scriptdir_logwatch = $(prefix_logwatch)/scripts/services
16 confdir_logwatch = $(prefix_logwatch)/conf/services
17
18 scriptdir_standalone = $(prefix_standalone)/bin
19 confdir_standalone = $(prefix_standalone)/etc
20 mandir_standalone = $(prefix_standalone)/man/man1
21
22 INSTALL = /usr/bin/install -c
23
24 install:
25 @echo 'Run "make install-logwatch" to install as a logwatch filter'
26 @echo 'Run "make install-standalone" to install as a standalone utility'
27 @echo 'Run "make install-all" to install both'
28
29 install-logwatch:
30 $(INSTALL) -d -m 0755 $(DESTDIR)$(scriptdir_logwatch) $(DESTDIR)$(confdir_logwatch) || exit 1;
31 $(INSTALL) -m 0644 $(program) $(DESTDIR)$(scriptdir_logwatch)/$(program_logwatch) || exit 1;
32 $(INSTALL) -m 0644 $(program).conf $(DESTDIR)$(confdir_logwatch)/$(program_logwatch).conf || exit 1;
33 # removes taint mode (-T) to run under logwatch
34 perl -e 'while (<>) { $$.==1 and s/\s+-T$$//; print "$$_";}' -i $(DESTDIR)$(scriptdir_logwatch)/$(program_logwatch)
35
36 install-standalone:
37 $(INSTALL) -d -m 0755 $(DESTDIR)$(scriptdir_standalone) $(DESTDIR)$(confdir_standalone) || exit 1;
38 $(INSTALL) -m 0755 $(program) $(DESTDIR)$(scriptdir_standalone)/$(program) || exit 1;
39 $(INSTALL) -m 0644 $(program).conf $(DESTDIR)$(confdir_standalone)/$(program).conf || exit 1;
40 $(INSTALL) -m 0644 $(program).1 $(DESTDIR)$(mandir_standalone)/$(program).1 || exit 1;
41
42 install-all: install-logwatch install-standalone
43
44 uninstall-logwatch:
45 -rm $(DESTDIR)$(scriptdir_logwatch)/$(program_logwatch) $(DESTDIR)$(confdir_logwatch)/$(program_logwatch).conf
46
47 uninstall-standalone:
48 -rm $(DESTDIR)$(scriptdir_standalone)/$(program) $(DESTDIR)$(confdir_standalone)/$(program).conf \
49 $(DESTDIR)$(mandir_standalone)/$(program).1
50
51 uninstall-all: uninstall-logwatch uninstall-standalone
52
53 PKGDIR = /tmp/$(program)-package
54
55 release: program htmlpage
56 vers=`egrep 'Version[ ]*=' $(program) | sed "s/.*'\(.*\)';/\1/"` ; \
57 echo Preparing version $$vers; \
58 rel=$(program)-$$vers ; \
59 tar -czvf $${rel}.tgz --group=0 --owner=0 --mode=644 --transform=s",^,$${rel}/," $(src) ; \
60 md5sum $${rel}.tgz > $${rel}.tgz.md5 ; \
61 chmod 644 $${rel}.tgz $${rel}.tgz.md5
62
63 htmlpage:
64 groff -m mandoc -T ascii $(program).1 | man2html -t 'Man page: $(program)(1)' >| $(program).1.html;