Changed my mind again on scan.MMDDYY and scan.YYYYMMDD. Put the replied /
[mmh] / etc / Makefile.in
1 #
2 # Makefile for etc subdirectory
3 #
4 # $Id$
5 #
6
7 SHELL = /bin/sh
8
9 top_srcdir = @top_srcdir@
10 srcdir     = @srcdir@
11 VPATH      = @srcdir@
12
13 prefix      = @prefix@
14 exec_prefix = @exec_prefix@
15 bindir      = @bindir@
16 libdir      = @libdir@
17 etcdir      = @sysconfdir@
18
19 MTS         = @MTS@
20 mailspool   = @mailspool@
21 masquerade  = @masquerade@
22 smtpservers = @smtpservers@
23
24 INSTALL         = @INSTALL@
25 INSTALL_PROGRAM = @INSTALL_PROGRAM@
26 INSTALL_DATA    = @INSTALL_DATA@
27
28 # Path to search for programs to handle MIME
29 # content.  Used to create mhn.defaults
30 MHNSEARCHPATH = "$(PATH):/usr/demo/SOUND"
31
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
35
36 SED = sed
37
38 .SUFFIXES:
39
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
47
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
50
51 # scripts generated using above GENERATED_FILE_SRCs
52 GENERATED_BIN_FILES = sendfiles
53
54 # non-scripts generated using above GENERATED_FILE_SRCs
55 GENERATED_ETC_FILES = mhn.defaults mts.conf
56
57 # auxiliary files (included in distribution but not installed)
58 AUX = Makefile.in
59
60 # all non-generated files in this directory are included in the distribution
61 DIST = $(STATIC_FILES) $(GENERATED_FILE_SRCS) $(AUX)
62
63 # ========= DEPENDENCIES FOR BUILDING ==========
64
65 all: $(GENERATED_BIN_FILES) $(GENERATED_ETC_FILES)
66
67 mhn.defaults: $(srcdir)/mhn.defaults.sh $(MHNSEARCHPROG)
68         rm -f $@
69         $(srcdir)/mhn.defaults.sh $(MHNSEARCHPATH) $(MHNSEARCHPROG) > $@
70
71 mts.conf: $(srcdir)/mts.conf.in Makefile
72         rm -f $@
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 > $@
78
79 sendfiles: $(srcdir)/sendfiles.in Makefile
80         rm -f $@
81         $(SED) -e 's,%libdir%,$(libdir),' < $(srcdir)/sendfiles.in > $@
82
83 install: install-bin-files install-etc-files
84
85 install-bin-files:
86         $(top_srcdir)/mkinstalldirs $(bindir)
87         for script in $(GENERATED_BIN_FILES); do \
88           $(INSTALL_PROGRAM) $$script $(bindir)/$$script; \
89         done
90
91 install-etc-files:
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"; \
96         done; \
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; \
105             else \
106               echo; \
107               echo "  Previous version of $$file saved as $$file.prev due\c";\
108               echo   " to diffs."; \
109               echo "  Please merge any local config changes into the new\c"; \
110               echo   " $$file."; \
111               echo; \
112             fi; \
113           else \
114             $(INSTALL_DATA) $$path $(etcdir)/$$file; \
115           fi; \
116         done
117
118 uninstall: uninstall-bin-files uninstall-etc-files
119
120 uninstall-bin-files:
121         for script in $(GENERATED_BIN_FILES); do \
122           rm -f $(bindir)/$$script; \
123         done
124
125 uninstall-etc-files:
126         for file in $(STATIC_FILES) $(GENERATED_ETC_FILES); do \
127           rm -f $(etcdir)/$$file; \
128         done
129
130 # ========== DEPENDENCIES FOR CLEANUP ==========
131
132 mostlyclean:
133         rm -f *~
134
135 clean: mostlyclean
136         rm -f $(GENERATED_ETC_FILES) $(GENERATED_BIN_FILES)
137
138 distclean: clean
139         rm -f Makefile
140
141 realclean: distclean
142
143 superclean: realclean
144
145 # ========== DEPENDENCIES FOR MAINTENANCE ==========
146
147 subdir = etc
148
149 Makefile: Makefile.in ../config.status
150         cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
151  
152 distdir = ../`cat ../distname`/$(subdir)
153 nmhdist: $(DIST)
154         @echo "Copying distribution files in $(subdir)"
155         @for file in $(DIST); do \
156           cp -p $(srcdir)/$$file $(distdir); \
157         done
158