2 # Makefile for etc subdirectory
7 top_srcdir = @top_srcdir@
12 exec_prefix = @exec_prefix@
17 mailspool = @mailspool@
18 masquerade = @masquerade@
21 INSTALL_PROGRAM = @INSTALL_PROGRAM@
22 INSTALL_SCRIPT = @INSTALL_SCRIPT@
23 INSTALL_DATA = @INSTALL_DATA@
25 # Path to search for programs to handle MIME
26 # content. Used to create mhn.defaults
27 MHNSEARCHPATH = "$(PATH):/usr/demo/SOUND"
29 # Program used to search path for various programs to
30 # handle MIME content. Used to create mhn.defaults
31 MHNSEARCHPROG = $(srcdir)/mhn.find.sh
37 # static configuration, format, and components files
38 STATIC_FILES = MailAliases components digestcomps distcomps forwcomps \
39 mhl.body mhl.digest mhl.format mhl.forward mhl.headers \
40 mhl.reply rcvdistcomps rcvdistcomps.outbox \
41 replcomps replgroupcomps scan.MMDDYY scan.YYYYMMDD \
42 scan.default scan.mailx scan.nomime scan.size scan.time \
43 scan.timely scan.unseen
45 # templates and scripts from which non-static files are generated
46 GENERATED_FILE_SRCS = mhn.defaults.sh mhn.find.sh mts.conf.in sendfiles.in
48 # scripts generated using above GENERATED_FILE_SRCs; don't add binaries
49 # to this list, as they'll get installed with INSTALL_SCRIPT and won't
51 GENERATED_BIN_FILES = sendfiles
53 # non-scripts generated using above GENERATED_FILE_SRCs
54 GENERATED_ETC_FILES = mhn.defaults mts.conf
56 # auxiliary files (included in distribution but not installed)
59 # all non-generated files in this directory are included in the distribution
60 DIST = $(STATIC_FILES) $(GENERATED_FILE_SRCS) $(AUX)
62 # ========= DEPENDENCIES FOR BUILDING ==========
64 all: $(GENERATED_BIN_FILES) $(GENERATED_ETC_FILES)
66 mhn.defaults: $(srcdir)/mhn.defaults.sh $(MHNSEARCHPROG)
68 $(srcdir)/mhn.defaults.sh $(MHNSEARCHPATH) $(MHNSEARCHPROG) > $@
70 mts.conf: $(srcdir)/mts.conf.in Makefile
72 $(SED) -e 's,%mailspool%,$(mailspool),' \
73 -e 's,%etcdir%,$(etcdir),' \
74 -e 's,%masquerade%,$(masquerade),' < $(srcdir)/mts.conf.in > $@
76 sendfiles: $(srcdir)/sendfiles.in Makefile
78 $(SED) -e 's,%libdir%,$(libdir),' < $(srcdir)/sendfiles.in > $@
80 install: install-bin-files install-etc-files
83 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(bindir)
84 for script in $(GENERATED_BIN_FILES); do \
85 $(INSTALL_SCRIPT) $$script $(DESTDIR)$(bindir)/$$script; \
89 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(etcdir)
90 INSTALL_FILES="$(GENERATED_ETC_FILES)"; \
91 for file in $(STATIC_FILES); do \
92 INSTALL_FILES="$$INSTALL_FILES $(srcdir)/$$file"; \
94 for path in $$INSTALL_FILES; do \
95 file=`basename $$path`; \
96 echo "Installing $$file..."; \
97 if [ -f "$(DESTDIR)$(etcdir)/$$file" ]; then \
98 if cmp -s "$$path" "$(DESTDIR)$(etcdir)/$$file"; then \
99 echo "$(DESTDIR)$(etcdir)/$$file unchanged, skipped"; \
101 $(INSTALL_DATA) "$$path" "$(DESTDIR)$(etcdir)/$$file.dist"; \
102 echo "INFO: $(DESTDIR)$(etcdir)/$$file installed with .dist extension"; \
105 $(INSTALL_DATA) $$path $(DESTDIR)$(etcdir)/$$file; \
109 uninstall: uninstall-bin-files uninstall-etc-files
112 for script in $(GENERATED_BIN_FILES); do \
113 rm -f $(DESTDIR)$(bindir)/$$script; \
117 for file in $(STATIC_FILES) $(GENERATED_ETC_FILES); do \
118 rm -f $(DESTDIR)$(etcdir)/$$file; \
121 # ========== DEPENDENCIES FOR CLEANUP ==========
127 rm -f $(GENERATED_ETC_FILES) $(GENERATED_BIN_FILES)
134 superclean: realclean
136 # ========== DEPENDENCIES FOR MAINTENANCE ==========
140 Makefile: Makefile.in ../config.status
141 cd .. && ./config.status $(subdir)/$@
143 distdir = ../`cat ../distname`/$(subdir)
145 @echo "Copying distribution files in $(subdir)"
146 @for file in $(DIST); do \
147 cp -p $(srcdir)/$$file $(distdir); \