* Bug #15213, #18635: The use of the insecure m_scratch() and
[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_SCRIPT  = @INSTALL_SCRIPT@
27 INSTALL_DATA    = @INSTALL_DATA@
28
29 # Path to search for programs to handle MIME
30 # content.  Used to create mhn.defaults
31 MHNSEARCHPATH = "$(PATH):/usr/demo/SOUND"
32
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
36
37 SED = sed
38
39 .SUFFIXES:
40
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
48
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
51
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
54 # be stripped.
55 GENERATED_BIN_FILES = sendfiles
56
57 # non-scripts generated using above GENERATED_FILE_SRCs
58 GENERATED_ETC_FILES = mhn.defaults mts.conf
59
60 # auxiliary files (included in distribution but not installed)
61 AUX = Makefile.in
62
63 # all non-generated files in this directory are included in the distribution
64 DIST = $(STATIC_FILES) $(GENERATED_FILE_SRCS) $(AUX)
65
66 # ========= DEPENDENCIES FOR BUILDING ==========
67
68 all: $(GENERATED_BIN_FILES) $(GENERATED_ETC_FILES)
69
70 mhn.defaults: $(srcdir)/mhn.defaults.sh $(MHNSEARCHPROG)
71         rm -f $@
72         $(srcdir)/mhn.defaults.sh $(MHNSEARCHPATH) $(MHNSEARCHPROG) > $@
73
74 mts.conf: $(srcdir)/mts.conf.in Makefile
75         rm -f $@
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 > $@
81
82 sendfiles: $(srcdir)/sendfiles.in Makefile
83         rm -f $@
84         $(SED) -e 's,%libdir%,$(libdir),' < $(srcdir)/sendfiles.in > $@
85
86 install: install-bin-files install-etc-files
87
88 install-bin-files:
89         $(top_srcdir)/mkinstalldirs $(DESTDIR)$(bindir)
90         for script in $(GENERATED_BIN_FILES); do \
91           $(INSTALL_SCRIPT) $$script $(DESTDIR)$(bindir)/$$script; \
92         done
93
94 install-etc-files:
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"; \
99         done; \
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"; \
106             else \
107               $(INSTALL_DATA) "$$path" "$(DESTDIR)$(etcdir)/$$file.dist"; \
108               echo "INFO: $(DESTDIR)$(etcdir)/$$file installed with .dist extension"; \
109             fi; \
110           else \
111             $(INSTALL_DATA) $$path $(DESTDIR)$(etcdir)/$$file; \
112           fi; \
113         done
114
115 uninstall: uninstall-bin-files uninstall-etc-files
116
117 uninstall-bin-files:
118         for script in $(GENERATED_BIN_FILES); do \
119           rm -f $(DESTDIR)$(bindir)/$$script; \
120         done
121
122 uninstall-etc-files:
123         for file in $(STATIC_FILES) $(GENERATED_ETC_FILES); do \
124           rm -f $(DESTDIR)$(etcdir)/$$file; \
125         done
126
127 # ========== DEPENDENCIES FOR CLEANUP ==========
128
129 mostlyclean:
130         rm -f *~
131
132 clean: mostlyclean
133         rm -f $(GENERATED_ETC_FILES) $(GENERATED_BIN_FILES)
134
135 distclean: clean
136         rm -f Makefile
137
138 realclean: distclean
139
140 superclean: realclean
141
142 # ========== DEPENDENCIES FOR MAINTENANCE ==========
143
144 subdir = etc
145
146 Makefile: Makefile.in ../config.status
147         cd .. && ./config.status $(subdir)/$@
148  
149 distdir = ../`cat ../distname`/$(subdir)
150 nmhdist: $(DIST)
151         @echo "Copying distribution files in $(subdir)"
152         @for file in $(DIST); do \
153           cp -p $(srcdir)/$$file $(distdir); \
154         done
155