program = postfix-logwatch program_logwatch = postfix src = $(program) \ $(program).conf \ $(program).conf-topn \ $(program).1 \ Changes Bugs README LICENSE prefix_logwatch = /etc/logwatch prefix_standalone = /usr/local scriptdir_logwatch = $(prefix_logwatch)/scripts/services confdir_logwatch = $(prefix_logwatch)/conf/services scriptdir_standalone = $(prefix_standalone)/bin confdir_standalone = $(prefix_standalone)/etc mandir_standalone = $(prefix_standalone)/man/man1 INSTALL = /usr/bin/install -c install: @echo 'Run "make install-logwatch" to install as a logwatch filter' @echo 'Run "make install-standalone" to install as a standalone utility' @echo 'Run "make install-all" to install both' install-logwatch: $(INSTALL) -d -m 0755 $(DESTDIR)$(scriptdir_logwatch) $(DESTDIR)$(confdir_logwatch) || exit 1; $(INSTALL) -m 0644 $(program) $(DESTDIR)$(scriptdir_logwatch)/$(program_logwatch) || exit 1; $(INSTALL) -m 0644 $(program).conf $(DESTDIR)$(confdir_logwatch)/$(program_logwatch).conf || exit 1; # removes taint mode (-T) to run under logwatch perl -e 'while (<>) { $$.==1 and s/\s+-T$$//; print "$$_";}' -i $(DESTDIR)$(scriptdir_logwatch)/$(program_logwatch) install-standalone: $(INSTALL) -d -m 0755 $(DESTDIR)$(scriptdir_standalone) $(DESTDIR)$(confdir_standalone) || exit 1; $(INSTALL) -m 0755 $(program) $(DESTDIR)$(scriptdir_standalone)/$(program) || exit 1; $(INSTALL) -m 0644 $(program).conf $(DESTDIR)$(confdir_standalone)/$(program).conf || exit 1; $(INSTALL) -m 0644 $(program).1 $(DESTDIR)$(mandir_standalone)/$(program).1 || exit 1; install-all: install-logwatch install-standalone uninstall-logwatch: -rm $(DESTDIR)$(scriptdir_logwatch)/$(program_logwatch) $(DESTDIR)$(confdir_logwatch)/$(program_logwatch).conf uninstall-standalone: -rm $(DESTDIR)$(scriptdir_standalone)/$(program) $(DESTDIR)$(confdir_standalone)/$(program).conf \ $(DESTDIR)$(mandir_standalone)/$(program).1 uninstall-all: uninstall-logwatch uninstall-standalone .PHONY: release release: vers=`egrep 'Version[ ]*=' $(program) | sed "s/.*'\(.*\)';/\1/"` ; \ echo Preparing version $$vers; \ rel=$(program)-$$vers ; \ tar -cJf $${rel}.tar.xz --transform=s",^,$${rel}/," $(src); $(program).1.html: $(program).1 man2html $< > $@;