Commit | Line | Data |
---|---|---|
b2ffb9b7 MW |
1 | ### -*-makefile-*- |
2 | ### | |
3 | ### Build script for nsict-utils | |
4 | ### | |
5 | ### (c) 2008 Mark Wooding | |
6 | ### | |
7 | ||
8 | ###----- Licensing notice --------------------------------------------------- | |
9 | ### | |
10 | ### This program is free software; you can redistribute it and/or modify | |
11 | ### it under the terms of the GNU General Public License as published by | |
12 | ### the Free Software Foundation; either version 2 of the License, or | |
13 | ### (at your option) any later version. | |
14 | ### | |
15 | ### This program is distributed in the hope that it will be useful, | |
16 | ### but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | ### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | ### GNU General Public License for more details. | |
19 | ### | |
20 | ### You should have received a copy of the GNU General Public License | |
21 | ### along with this program; if not, write to the Free Software Foundation, | |
22 | ### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
23 | ||
24 | EXTRA_DIST = | |
25 | CLEANFILES = | |
26 | ||
27 | man_MANS = | |
28 | dist_man_MANS = | |
29 | ||
30 | ###-------------------------------------------------------------------------- | |
31 | ### Tools in C. | |
32 | ||
33 | bin_PROGRAMS = | |
34 | sbin_PROGRAMS = | |
35 | ||
36 | AM_CFLAGS = $(mLib_CFLAGS) $(catacomb_CFLAGS) | |
37 | ||
38 | ## space | |
39 | bin_PROGRAMS += space | |
40 | space_SOURCES = space.c | |
41 | dist_man_MANS += space.1 | |
42 | ||
43 | ## not | |
44 | bin_PROGRAMS += not | |
45 | not_SOURCES = not.c | |
46 | dist_man_MANS += not.1 | |
47 | ||
48 | ## if-mtu | |
49 | bin_PROGRAMS += if-mtu | |
50 | if_mtu_SOURCES = if-mtu.c | |
51 | dist_man_MANS += if-mtu.1 | |
52 | ||
e3e2681b MW |
53 | ## getpass |
54 | bin_PROGRAMS += getpass | |
55 | getpass_SOURCES = getpass.c | |
56 | dist_man_MANS += getpass.1 | |
57 | ||
b2ffb9b7 MW |
58 | ## xtitle |
59 | bin_PROGRAMS += xtitle | |
60 | xtitle_SOURCES = xtitle.c | |
61 | ## !UNDOCUMENTED | |
62 | ||
63 | ## pause | |
64 | if HAVE_MLIB | |
65 | bin_PROGRAMS += pause | |
66 | pause_SOURCES = pause.c | |
67 | pause_LDADD = $(mLib_LIBS) $(MATH_LIBS) | |
68 | dist_man_MANS += pause.1 | |
69 | endif | |
70 | ||
71 | ## stamp | |
72 | if HAVE_MLIB | |
73 | bin_PROGRAMS += stamp | |
74 | stamp_SOURCES = stamp.c | |
75 | stamp_LDADD = $(mLib_LIBS) | |
76 | dist_man_MANS += stamp.1 | |
77 | endif | |
78 | ||
79 | ## locking | |
80 | if HAVE_MLIB | |
81 | bin_PROGRAMS += locking | |
82 | locking_SOURCES = locking.c | |
83 | locking_LDADD = $(mLib_LIBS) | |
84 | dist_man_MANS += locking.1 | |
85 | endif | |
86 | ||
87 | ## gorp | |
88 | if HAVE_CATACOMB | |
89 | bin_PROGRAMS += gorp | |
90 | gorp_SOURCES = gorp.c | |
91 | gorp_LDADD = $(catacomb_LIBS) | |
92 | dist_man_MANS += gorp.1 | |
93 | endif | |
94 | ||
95 | ## qmail-checkspam | |
96 | if HAVE_LIBSPAMC | |
97 | sbin_PROGRAMS += qmail-checkspam | |
98 | qmail_checkspam_SOURCES = qmail-checkspam.c | |
99 | qmail_checkspam_LDADD = -lspamc | |
100 | dist_man_MANS += qmail-checkspam.8 | |
101 | endif | |
102 | ||
103 | ## cdb tools | |
104 | if HAVE_LIBCDB | |
105 | bin_PROGRAMS += cdb-probe cdb-check-domain | |
106 | cdb_probe_SOURCES = cdb-probe.c | |
107 | cdb_probe_LDADD = -lcdb | |
108 | cdb_check_domain_SOURCES = cdb-check-domain.c | |
109 | cdb_check_domain_LDADD = -lcdb | |
110 | dist_man_MANS += cdb-probe.1 cdb-check-domain.1 | |
111 | endif | |
112 | ||
113 | ###-------------------------------------------------------------------------- | |
114 | ### Tools in scripts. | |
115 | ||
116 | bin_SCRIPTS = | |
117 | dist_bin_SCRIPTS = | |
118 | sbin_SCRIPTS = | |
119 | dist_sbin_SCRIPTS = | |
120 | ||
121 | ## Making substitutions. | |
122 | confsubst = $(top_srcdir)/config/confsubst | |
123 | SUBSTITUTIONS = \ | |
124 | PACKAGE=$(PACKAGE) VERSION=$(VERSION) \ | |
125 | PYTHON=$(PYTHON) \ | |
126 | PERL=$(PERL) \ | |
127 | TCLSH=$(TCLSH) | |
128 | ||
129 | EXTRA_DIST += config/confsubst | |
130 | ||
131 | ## Shell scripts. | |
132 | dist_bin_SCRIPTS += check-sender | |
133 | dist_man_MANS += check-sender.1 | |
134 | ||
135 | dist_bin_SCRIPTS += buf | |
136 | dist_man_MANS += buf.1 | |
137 | ||
138 | dist_bin_SCRIPTS += create | |
139 | dist_man_MANS += create.1 | |
140 | ||
141 | dist_bin_SCRIPTS += z | |
142 | dist_man_MANS += z.1 | |
143 | ||
144 | ## bash scripts. | |
145 | if HAVE_BASH | |
146 | ||
147 | bin_SCRIPTS += inplace | |
148 | CLEANFILES += inplace | |
149 | EXTRA_DIST += inplace.in | |
150 | dist_man_MANS += inplace.1 | |
151 | ||
152 | inplace: inplace.in Makefile | |
153 | $(confsubst) $(srcdir)/inplace.in >$@.new $(SUBSTITUTIONS) && \ | |
154 | chmod +x $@.new && mv $@.new $@ | |
155 | ||
156 | endif | |
157 | ||
158 | ## Python scripts. | |
159 | if HAVE_PYTHON | |
160 | ||
161 | if HAVE_PYMOD_CDB | |
162 | bin_SCRIPTS += cdb-assign | |
163 | dist_man_MANS += cdb-assign.1 | |
164 | endif | |
165 | ||
166 | CLEANFILES += cdb-assign | |
167 | EXTRA_DIST += cdb-assign.in | |
168 | ||
169 | cdb-assign: cdb-assign.in Makefile | |
170 | $(confsubst) $(srcdir)/cdb-assign.in >$@.new $(SUBSTITUTIONS) && \ | |
171 | chmod +x $@.new && mv $@.new $@ | |
172 | ||
173 | if HAVE_PYMOD_CDB | |
174 | bin_SCRIPTS += cdb-list | |
175 | dist_man_MANS += cdb-list.1 | |
176 | endif | |
177 | ||
178 | CLEANFILES += cdb-list | |
179 | EXTRA_DIST += cdb-list.in | |
180 | ||
181 | cdb-list: cdb-list.in Makefile | |
182 | $(confsubst) $(srcdir)/cdb-list.in >$@.new $(SUBSTITUTIONS) && \ | |
183 | chmod +x $@.new && mv $@.new $@ | |
184 | ||
185 | if HAVE_PYMOD_CDB | |
186 | bin_SCRIPTS += cdb-map | |
187 | dist_man_MANS += cdb-map.1 | |
188 | endif | |
189 | ||
190 | CLEANFILES += cdb-map | |
191 | EXTRA_DIST += cdb-map.in | |
192 | ||
193 | cdb-map: cdb-map.in Makefile | |
194 | $(confsubst) $(srcdir)/cdb-map.in >$@.new $(SUBSTITUTIONS) && \ | |
195 | chmod +x $@.new && mv $@.new $@ | |
196 | ||
197 | endif | |
198 | ||
199 | ## Perl scripts. | |
200 | if HAVE_PERL | |
201 | ||
202 | sbin_SCRIPTS += shadowfix | |
203 | CLEANFILES += shadowfix | |
204 | EXTRA_DIST += shadowfix.in | |
205 | ||
206 | shadowfix: shadowfix.in Makefile | |
207 | $(confsubst) $(srcdir)/shadowfix.in >$@.new $(SUBSTITUTIONS) && \ | |
208 | chmod +x $@.new && mv $@.new $@ | |
209 | ||
210 | man_MANS += shadowfix.8 | |
211 | CLEANFILES += shadowfix.8 | |
212 | ||
213 | shadowfix.8: shadowfix.in | |
214 | pod2man --section 8 $(srcdir)/shadowfix.in >$@.new && mv $@.new $@ | |
215 | ||
216 | bin_SCRIPTS += unfwd | |
217 | CLEANFILES += unfwd | |
218 | EXTRA_DIST += unfwd.in | |
219 | dist_man_MANS += unfwd.1 | |
220 | ||
221 | unfwd: unfwd.in Makefile | |
222 | $(confsubst) $(srcdir)/unfwd.in >$@.new $(SUBSTITUTIONS) && \ | |
223 | chmod +x $@.new && mv $@.new $@ | |
224 | ||
225 | endif | |
226 | ||
227 | ## Perl modules. | |
228 | if HAVE_PERL | |
229 | dist_perlmod_DATA = MdwOpt.pm | |
230 | endif | |
231 | ||
232 | ## Tcl scripts. | |
233 | if HAVE_TCLSH | |
234 | ||
235 | bin_SCRIPTS += splitconf | |
236 | CLEANFILES += splitconf | |
237 | EXTRA_DIST += splitconf.in | |
238 | dist_man_MANS += splitconf.1 | |
239 | ||
240 | splitconf: splitconf.in Makefile | |
241 | $(confsubst) $(srcdir)/splitconf.in >$@.new $(SUBSTITUTIONS) && \ | |
242 | chmod +x $@.new && mv $@.new $@ | |
243 | ||
244 | endif | |
245 | ||
d87cfc24 MW |
246 | ###-------------------------------------------------------------------------- |
247 | ### Other administrivia. | |
248 | ||
249 | dist-hook: | |
250 | echo $(VERSION) >$(distdir)/RELEASE | |
251 | ||
252 | ###-------------------------------------------------------------------------- | |
253 | ### Debian. | |
254 | ||
255 | ## Standard files. | |
256 | EXTRA_DIST += debian/rules | |
257 | EXTRA_DIST += debian/copyright | |
258 | EXTRA_DIST += debian/changelog | |
259 | EXTRA_DIST += debian/control | |
260 | ||
261 | ## What to install where. | |
262 | EXTRA_DIST += debian/inst | |
263 | ||
b2ffb9b7 | 264 | ###----- That's all, folks -------------------------------------------------- |