* Merged mts/sendmail functionality into mts/smtp; switching between
[mmh] / etc / Makefile.in
index ad43e9d..c2645cb 100644 (file)
@@ -16,6 +16,7 @@ bindir      = @bindir@
 libdir      = @libdir@
 etcdir      = @sysconfdir@
 
+MTS         = @MTS@
 mailspool   = @mailspool@
 masquerade  = @masquerade@
 smtpservers = @smtpservers@
@@ -47,24 +48,27 @@ STATIC_FILES =  MailAliases components digestcomps distcomps forwcomps      \
 # templates and scripts from which non-static files are generated
 GENERATED_FILE_SRCS = mhn.defaults.sh mhn.find.sh mts.conf.in sendfiles.in
 
-# files generated using above GENERATED_FILE_SRCs
-GENERATED_FILES = mhn.defaults mts.conf sendfiles
+# scripts generated using above GENERATED_FILE_SRCs
+GENERATED_BIN_FILES = sendfiles
 
-# data files we need to install (in etc)
-INSTALL_FILES = $(STATIC_FILES) $(GENERATED_FILES)
+# non-scripts generated using above GENERATED_FILE_SRCs
+GENERATED_ETC_FILES = mhn.defaults mts.conf
 
 # scripts we need to install (in bin)
-SCRIPTS = sendfiles
+INSTALL_BIN_FILES = $(GENERATED_BIN_FILES)
+
+# non-scripts we need to install (in etc)
+INSTALL_ETC_FILES = $(STATIC_FILES) $(GENERATED_ETC_FILES)
 
 # auxiliary files (included in distribution but not installed)
 AUX = Makefile.in
 
 # all non-generated files in this directory are included in the distribution
-DIST = $(STATIC_FILES) $(GENERATED_FILE_SRCS) $(SCRIPTS) $(AUX)
+DIST = $(STATIC_FILES) $(GENERATED_FILE_SRCS) $(AUX)
 
 # ========= DEPENDENCIES FOR BUILDING ==========
 
-all: $(GENERATED_FILES)
+all: $(GENERATED_BIN_FILES) $(GENERATED_ETC_FILES)
 
 mhn.defaults: $(srcdir)/mhn.defaults.sh $(MHNSEARCHPROG)
        rm -f $@
@@ -72,7 +76,8 @@ mhn.defaults: $(srcdir)/mhn.defaults.sh $(MHNSEARCHPROG)
 
 mts.conf: $(srcdir)/mts.conf.in Makefile
        rm -f $@
-       $(SED) -e 's,%mailspool%,$(mailspool),' \
+       $(SED) -e 's,%mts%,$(MTS),' \
+              -e 's,%mailspool%,$(mailspool),' \
               -e 's,%etcdir%,$(etcdir),' \
               -e 's,%masquerade%,$(masquerade),' \
               -e 's,%smtpservers%,$(smtpservers),' < $(srcdir)/mts.conf.in > $@
@@ -81,11 +86,17 @@ sendfiles: $(srcdir)/sendfiles.in Makefile
        rm -f $@
        $(SED) -e 's,%libdir%,$(libdir),' < $(srcdir)/sendfiles.in > $@
 
-install: install-files install-scripts
+install: install-bin-files install-etc-files
 
-install-files:
+install-bin-files:
+       $(top_srcdir)/mkinstalldirs $(bindir)
+       for script in $(INSTALL_BIN_FILES); do \
+         $(INSTALL_PROGRAM) $(srcdir)/$$script $(bindir)/$$script; \
+       done
+
+install-etc-files:
        $(top_srcdir)/mkinstalldirs $(etcdir)
-       for file in $(INSTALL_FILES); do \
+       for file in $(INSTALL_ETC_FILES); do \
          echo $$file; \
          if [ -f $(etcdir)/$$file ]; then \
            mv $(etcdir)/$$file $(etcdir)/$$file.prev; \
@@ -96,22 +107,16 @@ install-files:
          fi; \
        done
 
-install-scripts:
-       $(top_srcdir)/mkinstalldirs $(bindir)
-       for script in $(SCRIPTS); do \
-         $(INSTALL_PROGRAM) $(srcdir)/$$script $(bindir)/$$script; \
-       done
-
-uninstall: uninstall-files uninstall-scripts
+uninstall: uninstall-bin-files uninstall-etc-files
 
-uninstall-files:
-       for file in $(INSTALL_FILES); do \
-         rm -f $(etcdir)/$$file; \
+uninstall-bin-files:
+       for script in $(INSTALL_BIN_FILES); do \
+         rm -f $(bindir)/$$script; \
        done
 
-uninstall-scripts:
-       for script in $(SCRIPTS); do \
-         rm -f $(bindir)/$$script; \
+uninstall-etc-files:
+       for file in $(INSTALL_ETC_FILES); do \
+         rm -f $(etcdir)/$$file; \
        done
 
 # ========== DEPENDENCIES FOR CLEANUP ==========
@@ -120,7 +125,7 @@ mostlyclean:
        rm -f *~
 
 clean: mostlyclean
-       rm -f $(GENERATED_FILES)
+       rm -f $(GENERATED_ETC_FILES) $(GENERATED_BIN_FILES)
 
 distclean: clean
        rm -f Makefile