]> gitweb.michael.orlitzky.com - amavis-logwatch.git/blob - Makefile
Makefile: don't include myself in the release tarball.
[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 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 \
28 $(DESTDIR)$(scriptdir_logwatch) \
29 $(DESTDIR)$(confdir_logwatch)
30 $(INSTALL) -m 0644 \
31 $(program) \
32 $(DESTDIR)$(scriptdir_logwatch)/$(program_logwatch)
33 $(INSTALL) -m 0644 \
34 $(program).conf \
35 $(DESTDIR)$(confdir_logwatch)/$(program_logwatch).conf
36 # removes taint mode (-T) to run under logwatch
37 perl -e 'while (<>) { $$.==1 and s/\s+-T$$//; print "$$_";}' \
38 -i $(DESTDIR)$(scriptdir_logwatch)/$(program_logwatch)
39
40 install-standalone:
41 $(INSTALL) -d -m 0755 \
42 $(DESTDIR)$(scriptdir_standalone) \
43 $(DESTDIR)$(confdir_standalone) \
44 $(DESTDIR)$(mandir_standalone)
45 $(INSTALL) -m 0755 \
46 $(program) \
47 $(DESTDIR)$(scriptdir_standalone)/$(program)
48 $(INSTALL) -m 0644 \
49 $(program).conf \
50 $(DESTDIR)$(confdir_standalone)/$(program).conf
51 $(INSTALL) -m 0644 \
52 $(program).1 \
53 $(DESTDIR)$(mandir_standalone)/$(program).1
54
55 install-all: install-logwatch install-standalone
56
57 uninstall-logwatch:
58 rm -f $(DESTDIR)$(scriptdir_logwatch)/$(program_logwatch) \
59 $(DESTDIR)$(confdir_logwatch)/$(program_logwatch).conf
60 rm -rf $(DESTDIR)$(scriptdir_logwatch) \
61 $(DESTDIR)$(confdir_logwatch)
62
63 uninstall-standalone:
64 rm -f $(DESTDIR)$(scriptdir_standalone)/$(program) \
65 $(DESTDIR)$(confdir_standalone)/$(program).conf \
66 $(DESTDIR)$(mandir_standalone)/$(program).1
67 rm -rf $(DESTDIR)$(scriptdir_standalone) \
68 $(DESTDIR)$(confdir_standalone) \
69 $(DESTDIR)$(mandir_standalone)
70
71 uninstall-all: uninstall-logwatch uninstall-standalone
72
73 .PHONY: release
74 release:
75 vers=`egrep 'Version[ ]*=' $(program) | sed "s/.*'\(.*\)';/\1/"` ; \
76 echo Preparing version $$vers; \
77 rel=$(program)-$$vers ; \
78 tar -cJf $${rel}.tar.xz --transform=s",^,$${rel}/," $(src) ;
79
80 $(program).1.html: $(program).1
81 man2html $< > $@