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