etc/Makefile.in was incorrectly installing mts.conf.in and sendfiles.in --
[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 mailspool   = @mailspool@
20 masquerade  = @masquerade@
21 smtpservers = @smtpservers@
22
23 INSTALL         = @INSTALL@
24 INSTALL_PROGRAM = @INSTALL_PROGRAM@
25 INSTALL_DATA    = @INSTALL_DATA@
26
27 # Path to search for programs to handle MIME
28 # content.  Used to create mhn.defaults
29 MHNSEARCHPATH = "$(PATH):/usr/demo/SOUND"
30
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
34
35 SED = sed
36
37 .SUFFIXES:
38
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
46
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
49
50 # files generated using above GENERATED_FILE_SRCs
51 GENERATED_FILES = mhn.defaults mts.conf sendfiles
52
53 # data files we need to install (in etc)
54 INSTALL_FILES = $(STATIC_FILES) $(GENERATED_FILES)
55
56 # scripts we need to install (in bin)
57 SCRIPTS = sendfiles
58
59 # auxiliary files (included in distribution but not installed)
60 AUX = Makefile.in
61
62 # all non-generated files in this directory are included in the distribution
63 DIST = $(STATIC_FILES) $(GENERATED_FILE_SRCS) $(SCRIPTS) $(AUX)
64
65 # ========= DEPENDENCIES FOR BUILDING ==========
66
67 all: $(GENERATED_FILES)
68
69 mhn.defaults: $(srcdir)/mhn.defaults.sh $(MHNSEARCHPROG)
70         rm -f $@
71         $(srcdir)/mhn.defaults.sh $(MHNSEARCHPATH) $(MHNSEARCHPROG) > $@
72
73 mts.conf: $(srcdir)/mts.conf.in Makefile
74         rm -f $@
75         $(SED) -e 's,%mailspool%,$(mailspool),' \
76                -e 's,%etcdir%,$(etcdir),' \
77                -e 's,%masquerade%,$(masquerade),' \
78                -e 's,%smtpservers%,$(smtpservers),' < $(srcdir)/mts.conf.in > $@
79
80 sendfiles: $(srcdir)/sendfiles.in Makefile
81         rm -f $@
82         $(SED) -e 's,%libdir%,$(libdir),' < $(srcdir)/sendfiles.in > $@
83
84 install: install-files install-scripts
85
86 install-files:
87         $(top_srcdir)/mkinstalldirs $(etcdir)
88         for file in $(INSTALL_FILES); do \
89           echo $$file; \
90           if [ -f $(etcdir)/$$file ]; then \
91             mv $(etcdir)/$$file $(etcdir)/$$file.prev; \
92           fi; \
93           $(INSTALL_DATA) $(srcdir)/$$file $(etcdir)/$$file; \
94           if diff $(etcdir)/$$file.prev $(etcdir)/$$file; then \
95             rm $(etcdir)/$$file.prev; \
96           fi; \
97         done
98
99 install-scripts:
100         $(top_srcdir)/mkinstalldirs $(bindir)
101         for script in $(SCRIPTS); do \
102           $(INSTALL_PROGRAM) $(srcdir)/$$script $(bindir)/$$script; \
103         done
104
105 uninstall: uninstall-files uninstall-scripts
106
107 uninstall-files:
108         for file in $(INSTALL_FILES); do \
109           rm -f $(etcdir)/$$file; \
110         done
111
112 uninstall-scripts:
113         for script in $(SCRIPTS); do \
114           rm -f $(bindir)/$$script; \
115         done
116
117 # ========== DEPENDENCIES FOR CLEANUP ==========
118
119 mostlyclean:
120         rm -f *~
121
122 clean: mostlyclean
123         rm -f $(GENERATED_FILES)
124
125 distclean: clean
126         rm -f Makefile
127
128 realclean: distclean
129
130 superclean: realclean
131
132 # ========== DEPENDENCIES FOR MAINTENANCE ==========
133
134 subdir = etc
135
136 Makefile: Makefile.in ../config.status
137         cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
138  
139 distdir = ../`cat ../distname`/$(subdir)
140 nmhdist: $(DIST)
141         @echo "Copying distribution files in $(subdir)"
142         @for file in $(DIST); do \
143           cp -p $(srcdir)/$$file $(distdir); \
144         done
145