masqmail

diff Makefile.in @ 145:e68d8752735a

remove all installed dirs on `make uninstall' but no generated data remove log_dir, conf_dir, spool_dir if empty remove run_dir in any case
author meillo@marmaro.de
date Wed, 07 Jul 2010 23:43:05 +0200
parents 6eec8bcfd320
children 88dab0d22341
line diff
     1.1 --- a/Makefile.in	Wed Jul 07 23:37:49 2010 +0200
     1.2 +++ b/Makefile.in	Wed Jul 07 23:43:05 2010 +0200
     1.3 @@ -693,13 +693,16 @@
     1.4  
     1.5  install-data-local: log_dir spool_dir uid_bit conf_dir tpl_dir run_dir doc_dir rmail
     1.6  
     1.7 -uninstall-local: rm-rmail rm-doc_dir rm-tpl_dir
     1.8 +uninstall-local: rm-rmail rm-doc_dir rm-tpl_dir rm-conf_dir rm-run_dir rm-spool_dir rm-log_dir
     1.9  
    1.10  conf_dir: $(DESTDIR)@with_confdir@
    1.11  
    1.12  $(DESTDIR)@with_confdir@:
    1.13  	install -d $(DESTDIR)@with_confdir@
    1.14  
    1.15 +rm-conf_dir:
    1.16 +	rmdir $(DESTDIR)@with_confdir@  # removes only if empty
    1.17 +
    1.18  tpl_dir: $(DESTDIR)@datadir@/tpl
    1.19  
    1.20  $(DESTDIR)@datadir@/tpl: conf_dir
    1.21 @@ -719,6 +722,9 @@
    1.22  run_dir:
    1.23  	install -d -o @with_user@ -g @with_group@ $(DESTDIR)/var/run/masqmail
    1.24  
    1.25 +rm-run_dir:
    1.26 +	rm -rf $(DESTDIR)/var/run/masqmail
    1.27 +
    1.28  log_dir: $(DESTDIR)@with_logdir@
    1.29  
    1.30  $(DESTDIR)@with_logdir@:
    1.31 @@ -726,6 +732,9 @@
    1.32  		install -d `dirname $(DESTDIR)@with_logdir@`
    1.33  	install -d -o @with_user@ -g @with_group@ $(DESTDIR)@with_logdir@
    1.34  
    1.35 +rm-log_dir:
    1.36 +	rmdir $(DESTDIR)@with_logdir@  # removes only if empty
    1.37 +
    1.38  spool_dir: $(DESTDIR)@with_spooldir@
    1.39  
    1.40  $(DESTDIR)@with_spooldir@:
    1.41 @@ -736,6 +745,14 @@
    1.42  	install -d -o @with_user@ -g @with_group@ $(DESTDIR)@with_spooldir@/input
    1.43  	install -d -o @with_user@ -g @with_group@ $(DESTDIR)@with_spooldir@/popuidl
    1.44  
    1.45 +rm-spool_dir:
    1.46 +	: # removal fails if the dirs are non-empty
    1.47 +	: # this prevents losing spooled files
    1.48 +	rmdir $(DESTDIR)@with_spooldir@/lock
    1.49 +	rmdir $(DESTDIR)@with_spooldir@/input
    1.50 +	rmdir $(DESTDIR)@with_spooldir@/popuidl
    1.51 +	rmdir $(DESTDIR)@with_spooldir@
    1.52 +
    1.53  rmail:
    1.54  	[ -d "$(DESTDIR)@prefix@/bin" ] || mkdir -p "$(DESTDIR)@prefix@/bin"
    1.55  	sed '/^SENDMAIL/s,/usr/sbin/sendmail,$(DESTDIR)@prefix@/sbin/masqmail,'\