2 # Makefile for etc subdirectory
9 top_srcdir = @top_srcdir@
14 exec_prefix = @exec_prefix@
20 mailspool = @mailspool@
21 masquerade = @masquerade@
22 smtpservers = @smtpservers@
25 INSTALL_PROGRAM = @INSTALL_PROGRAM@
26 INSTALL_DATA = @INSTALL_DATA@
28 # Path to search for programs to handle MIME
29 # content. Used to create mhn.defaults
30 MHNSEARCHPATH = "$(PATH):/usr/demo/SOUND"
32 # Program used to search path for various programs to
33 # handle MIME content. Used to create mhn.defaults
34 MHNSEARCHPROG = $(srcdir)/mhn.find.sh
40 # static configuration, format, and components files
41 STATIC_FILES = MailAliases components digestcomps distcomps forwcomps \
42 mhl.body mhl.digest mhl.format mhl.forward mhl.headers \
43 mhl.reply rcvdistcomps rcvdistcomps.outbox \
44 replcomps replgroupcomps scan.MMDDYY scan.YYYYMMDD \
45 scan.default scan.mailx scan.nomime scan.size scan.time \
46 scan.timely scan.unseen
48 # templates and scripts from which non-static files are generated
49 GENERATED_FILE_SRCS = mhn.defaults.sh mhn.find.sh mts.conf.in sendfiles.in
51 # scripts generated using above GENERATED_FILE_SRCs
52 GENERATED_BIN_FILES = sendfiles
54 # non-scripts generated using above GENERATED_FILE_SRCs
55 GENERATED_ETC_FILES = mhn.defaults mts.conf
57 # auxiliary files (included in distribution but not installed)
60 # all non-generated files in this directory are included in the distribution
61 DIST = $(STATIC_FILES) $(GENERATED_FILE_SRCS) $(AUX)
63 # ========= DEPENDENCIES FOR BUILDING ==========
65 all: $(GENERATED_BIN_FILES) $(GENERATED_ETC_FILES)
67 mhn.defaults: $(srcdir)/mhn.defaults.sh $(MHNSEARCHPROG)
69 $(srcdir)/mhn.defaults.sh $(MHNSEARCHPATH) $(MHNSEARCHPROG) > $@
71 mts.conf: $(srcdir)/mts.conf.in Makefile
73 $(SED) -e 's,%mts%,$(MTS),' \
74 -e 's,%mailspool%,$(mailspool),' \
75 -e 's,%etcdir%,$(etcdir),' \
76 -e 's,%masquerade%,$(masquerade),' \
77 -e 's,%smtpservers%,$(smtpservers),' < $(srcdir)/mts.conf.in > $@
79 sendfiles: $(srcdir)/sendfiles.in Makefile
81 $(SED) -e 's,%libdir%,$(libdir),' < $(srcdir)/sendfiles.in > $@
83 install: install-bin-files install-etc-files
86 $(top_srcdir)/mkinstalldirs $(bindir)
87 for script in $(GENERATED_BIN_FILES); do \
88 $(INSTALL_PROGRAM) $$script $(bindir)/$$script; \
92 $(top_srcdir)/mkinstalldirs $(etcdir)
93 INSTALL_FILES="$(GENERATED_ETC_FILES)"; \
94 for file in $(STATIC_FILES); do \
95 INSTALL_FILES="$$INSTALL_FILES $(srcdir)/$$file"; \
97 for path in $$INSTALL_FILES; do \
98 file=`basename $$path`; \
99 echo "Installing $$file..."; \
100 if [ -f $(etcdir)/$$file ]; then \
101 mv $(etcdir)/$$file $(etcdir)/$$file.prev; \
102 $(INSTALL_DATA) $$path $(etcdir)/$$file; \
103 if diff $(etcdir)/$$file.prev $(etcdir)/$$file; then \
104 rm $(etcdir)/$$file.prev; \
107 echo " Previous version of $$file saved as $$file.prev due\c";\
109 echo " Please merge any local config changes into the new\c"; \
114 $(INSTALL_DATA) $$path $(etcdir)/$$file; \
118 uninstall: uninstall-bin-files uninstall-etc-files
121 for script in $(GENERATED_BIN_FILES); do \
122 rm -f $(bindir)/$$script; \
126 for file in $(STATIC_FILES) $(GENERATED_ETC_FILES); do \
127 rm -f $(etcdir)/$$file; \
130 # ========== DEPENDENCIES FOR CLEANUP ==========
136 rm -f $(GENERATED_ETC_FILES) $(GENERATED_BIN_FILES)
143 superclean: realclean
145 # ========== DEPENDENCIES FOR MAINTENANCE ==========
149 Makefile: Makefile.in ../config.status
150 cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
152 distdir = ../`cat ../distname`/$(subdir)
154 @echo "Copying distribution files in $(subdir)"
155 @for file in $(DIST); do \
156 cp -p $(srcdir)/$$file $(distdir); \