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