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_SCRIPT = @INSTALL_SCRIPT@
27 INSTALL_DATA = @INSTALL_DATA@
29 # Path to search for programs to handle MIME
30 # content. Used to create mhn.defaults
31 MHNSEARCHPATH = "$(PATH):/usr/demo/SOUND"
33 # Program used to search path for various programs to
34 # handle MIME content. Used to create mhn.defaults
35 MHNSEARCHPROG = $(srcdir)/mhn.find.sh
41 # static configuration, format, and components files
42 STATIC_FILES = MailAliases components digestcomps distcomps forwcomps \
43 mhl.body mhl.digest mhl.format mhl.forward mhl.headers \
44 mhl.reply rcvdistcomps rcvdistcomps.outbox \
45 replcomps replgroupcomps scan.MMDDYY scan.YYYYMMDD \
46 scan.default scan.mailx scan.nomime scan.size scan.time \
47 scan.timely scan.unseen
49 # templates and scripts from which non-static files are generated
50 GENERATED_FILE_SRCS = mhn.defaults.sh mhn.find.sh mts.conf.in sendfiles.in
52 # scripts generated using above GENERATED_FILE_SRCs; don't add binaries
53 # to this list, as they'll get installed with INSTALL_SCRIPT and won't
55 GENERATED_BIN_FILES = sendfiles
57 # non-scripts generated using above GENERATED_FILE_SRCs
58 GENERATED_ETC_FILES = mhn.defaults mts.conf
60 # auxiliary files (included in distribution but not installed)
63 # all non-generated files in this directory are included in the distribution
64 DIST = $(STATIC_FILES) $(GENERATED_FILE_SRCS) $(AUX)
66 # ========= DEPENDENCIES FOR BUILDING ==========
68 all: $(GENERATED_BIN_FILES) $(GENERATED_ETC_FILES)
70 mhn.defaults: $(srcdir)/mhn.defaults.sh $(MHNSEARCHPROG)
72 $(srcdir)/mhn.defaults.sh $(MHNSEARCHPATH) $(MHNSEARCHPROG) > $@
74 mts.conf: $(srcdir)/mts.conf.in Makefile
76 $(SED) -e 's,%mts%,$(MTS),' \
77 -e 's,%mailspool%,$(mailspool),' \
78 -e 's,%etcdir%,$(etcdir),' \
79 -e 's,%masquerade%,$(masquerade),' \
80 -e 's,%smtpservers%,$(smtpservers),' < $(srcdir)/mts.conf.in > $@
82 sendfiles: $(srcdir)/sendfiles.in Makefile
84 $(SED) -e 's,%libdir%,$(libdir),' < $(srcdir)/sendfiles.in > $@
86 install: install-bin-files install-etc-files
89 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(bindir)
90 for script in $(GENERATED_BIN_FILES); do \
91 $(INSTALL_SCRIPT) $$script $(DESTDIR)$(bindir)/$$script; \
95 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(etcdir)
96 INSTALL_FILES="$(GENERATED_ETC_FILES)"; \
97 for file in $(STATIC_FILES); do \
98 INSTALL_FILES="$$INSTALL_FILES $(srcdir)/$$file"; \
100 for path in $$INSTALL_FILES; do \
101 file=`basename $$path`; \
102 echo "Installing $$file..."; \
103 if [ -f "$(DESTDIR)$(etcdir)/$$file" ]; then \
104 if cmp -s "$$path" "$(DESTDIR)$(etcdir)/$$file"; then \
105 echo "$(DESTDIR)$(etcdir)/$$file unchanged, skipped"; \
107 $(INSTALL_DATA) "$$path" "$(DESTDIR)$(etcdir)/$$file.dist"; \
108 echo "INFO: $(DESTDIR)$(etcdir)/$$file installed with .dist extension"; \
111 $(INSTALL_DATA) $$path $(DESTDIR)$(etcdir)/$$file; \
115 uninstall: uninstall-bin-files uninstall-etc-files
118 for script in $(GENERATED_BIN_FILES); do \
119 rm -f $(DESTDIR)$(bindir)/$$script; \
123 for file in $(STATIC_FILES) $(GENERATED_ETC_FILES); do \
124 rm -f $(DESTDIR)$(etcdir)/$$file; \
127 # ========== DEPENDENCIES FOR CLEANUP ==========
133 rm -f $(GENERATED_ETC_FILES) $(GENERATED_BIN_FILES)
140 superclean: realclean
142 # ========== DEPENDENCIES FOR MAINTENANCE ==========
146 Makefile: Makefile.in ../config.status
147 cd .. && ./config.status $(subdir)/$@
149 distdir = ../`cat ../distname`/$(subdir)
151 @echo "Copying distribution files in $(subdir)"
152 @for file in $(DIST); do \
153 cp -p $(srcdir)/$$file $(distdir); \