2 # Makefile for etc subdirectory
7 top_srcdir = @top_srcdir@
12 exec_prefix = @exec_prefix@
18 mailspool = @mailspool@
19 masquerade = @masquerade@
20 smtpservers = @smtpservers@
23 INSTALL_PROGRAM = @INSTALL_PROGRAM@
24 INSTALL_SCRIPT = @INSTALL_SCRIPT@
25 INSTALL_DATA = @INSTALL_DATA@
27 # Path to search for programs to handle MIME
28 # content. Used to create mhn.defaults
29 MHNSEARCHPATH = "$(PATH):/usr/demo/SOUND"
31 # Program used to search path for various programs to
32 # handle MIME content. Used to create mhn.defaults
33 MHNSEARCHPROG = $(srcdir)/mhn.find.sh
39 # static configuration, format, and components files
40 STATIC_FILES = MailAliases components digestcomps distcomps forwcomps \
41 mhl.body mhl.digest mhl.format mhl.forward mhl.headers \
42 mhl.reply rcvdistcomps rcvdistcomps.outbox \
43 replcomps replgroupcomps scan.MMDDYY scan.YYYYMMDD \
44 scan.default scan.mailx scan.nomime scan.size scan.time \
45 scan.timely scan.unseen
47 # templates and scripts from which non-static files are generated
48 GENERATED_FILE_SRCS = mhn.defaults.sh mhn.find.sh mts.conf.in sendfiles.in
50 # scripts generated using above GENERATED_FILE_SRCs; don't add binaries
51 # to this list, as they'll get installed with INSTALL_SCRIPT and won't
53 GENERATED_BIN_FILES = sendfiles
55 # non-scripts generated using above GENERATED_FILE_SRCs
56 GENERATED_ETC_FILES = mhn.defaults mts.conf
58 # auxiliary files (included in distribution but not installed)
61 # all non-generated files in this directory are included in the distribution
62 DIST = $(STATIC_FILES) $(GENERATED_FILE_SRCS) $(AUX)
64 # ========= DEPENDENCIES FOR BUILDING ==========
66 all: $(GENERATED_BIN_FILES) $(GENERATED_ETC_FILES)
68 mhn.defaults: $(srcdir)/mhn.defaults.sh $(MHNSEARCHPROG)
70 $(srcdir)/mhn.defaults.sh $(MHNSEARCHPATH) $(MHNSEARCHPROG) > $@
72 mts.conf: $(srcdir)/mts.conf.in Makefile
74 $(SED) -e 's,%mts%,$(MTS),' \
75 -e 's,%mailspool%,$(mailspool),' \
76 -e 's,%etcdir%,$(etcdir),' \
77 -e 's,%masquerade%,$(masquerade),' \
78 -e 's,%smtpservers%,$(smtpservers),' < $(srcdir)/mts.conf.in > $@
80 sendfiles: $(srcdir)/sendfiles.in Makefile
82 $(SED) -e 's,%libdir%,$(libdir),' < $(srcdir)/sendfiles.in > $@
84 install: install-bin-files install-etc-files
87 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(bindir)
88 for script in $(GENERATED_BIN_FILES); do \
89 $(INSTALL_SCRIPT) $$script $(DESTDIR)$(bindir)/$$script; \
93 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(etcdir)
94 INSTALL_FILES="$(GENERATED_ETC_FILES)"; \
95 for file in $(STATIC_FILES); do \
96 INSTALL_FILES="$$INSTALL_FILES $(srcdir)/$$file"; \
98 for path in $$INSTALL_FILES; do \
99 file=`basename $$path`; \
100 echo "Installing $$file..."; \
101 if [ -f "$(DESTDIR)$(etcdir)/$$file" ]; then \
102 if cmp -s "$$path" "$(DESTDIR)$(etcdir)/$$file"; then \
103 echo "$(DESTDIR)$(etcdir)/$$file unchanged, skipped"; \
105 $(INSTALL_DATA) "$$path" "$(DESTDIR)$(etcdir)/$$file.dist"; \
106 echo "INFO: $(DESTDIR)$(etcdir)/$$file installed with .dist extension"; \
109 $(INSTALL_DATA) $$path $(DESTDIR)$(etcdir)/$$file; \
113 uninstall: uninstall-bin-files uninstall-etc-files
116 for script in $(GENERATED_BIN_FILES); do \
117 rm -f $(DESTDIR)$(bindir)/$$script; \
121 for file in $(STATIC_FILES) $(GENERATED_ETC_FILES); do \
122 rm -f $(DESTDIR)$(etcdir)/$$file; \
125 # ========== DEPENDENCIES FOR CLEANUP ==========
131 rm -f $(GENERATED_ETC_FILES) $(GENERATED_BIN_FILES)
138 superclean: realclean
140 # ========== DEPENDENCIES FOR MAINTENANCE ==========
144 Makefile: Makefile.in ../config.status
145 cd .. && ./config.status $(subdir)/$@
147 distdir = ../`cat ../distname`/$(subdir)
149 @echo "Copying distribution files in $(subdir)"
150 @for file in $(DIST); do \
151 cp -p $(srcdir)/$$file $(distdir); \