+### -*-makefile-*-
+###
+### Build script for nsict-utils
+###
+### (c) 2008 Mark Wooding
+###
+
+###----- Licensing notice ---------------------------------------------------
+###
+### This program is free software; you can redistribute it and/or modify
+### it under the terms of the GNU General Public License as published by
+### the Free Software Foundation; either version 2 of the License, or
+### (at your option) any later version.
+###
+### This program is distributed in the hope that it will be useful,
+### but WITHOUT ANY WARRANTY; without even the implied warranty of
+### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+### GNU General Public License for more details.
+###
+### You should have received a copy of the GNU General Public License
+### along with this program; if not, write to the Free Software Foundation,
+### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+EXTRA_DIST =
+CLEANFILES =
+
+man_MANS =
+dist_man_MANS =
+
+###--------------------------------------------------------------------------
+### Tools in C.
+
+bin_PROGRAMS =
+sbin_PROGRAMS =
+
+AM_CFLAGS = $(mLib_CFLAGS) $(catacomb_CFLAGS)
+
+## space
+bin_PROGRAMS += space
+space_SOURCES = space.c
+dist_man_MANS += space.1
+
+## not
+bin_PROGRAMS += not
+not_SOURCES = not.c
+dist_man_MANS += not.1
+
+## if-mtu
+bin_PROGRAMS += if-mtu
+if_mtu_SOURCES = if-mtu.c
+dist_man_MANS += if-mtu.1
+
+## xtitle
+bin_PROGRAMS += xtitle
+xtitle_SOURCES = xtitle.c
+## !UNDOCUMENTED
+
+## pause
+if HAVE_MLIB
+bin_PROGRAMS += pause
+pause_SOURCES = pause.c
+pause_LDADD = $(mLib_LIBS) $(MATH_LIBS)
+dist_man_MANS += pause.1
+endif
+
+## stamp
+if HAVE_MLIB
+bin_PROGRAMS += stamp
+stamp_SOURCES = stamp.c
+stamp_LDADD = $(mLib_LIBS)
+dist_man_MANS += stamp.1
+endif
+
+## locking
+if HAVE_MLIB
+bin_PROGRAMS += locking
+locking_SOURCES = locking.c
+locking_LDADD = $(mLib_LIBS)
+dist_man_MANS += locking.1
+endif
+
+## gorp
+if HAVE_CATACOMB
+bin_PROGRAMS += gorp
+gorp_SOURCES = gorp.c
+gorp_LDADD = $(catacomb_LIBS)
+dist_man_MANS += gorp.1
+endif
+
+## qmail-checkspam
+if HAVE_LIBSPAMC
+sbin_PROGRAMS += qmail-checkspam
+qmail_checkspam_SOURCES = qmail-checkspam.c
+qmail_checkspam_LDADD = -lspamc
+dist_man_MANS += qmail-checkspam.8
+endif
+
+## cdb tools
+if HAVE_LIBCDB
+bin_PROGRAMS += cdb-probe cdb-check-domain
+cdb_probe_SOURCES = cdb-probe.c
+cdb_probe_LDADD = -lcdb
+cdb_check_domain_SOURCES = cdb-check-domain.c
+cdb_check_domain_LDADD = -lcdb
+dist_man_MANS += cdb-probe.1 cdb-check-domain.1
+endif
+
+###--------------------------------------------------------------------------
+### Tools in scripts.
+
+bin_SCRIPTS =
+dist_bin_SCRIPTS =
+sbin_SCRIPTS =
+dist_sbin_SCRIPTS =
+
+## Making substitutions.
+confsubst = $(top_srcdir)/config/confsubst
+SUBSTITUTIONS = \
+ PACKAGE=$(PACKAGE) VERSION=$(VERSION) \
+ PYTHON=$(PYTHON) \
+ PERL=$(PERL) \
+ TCLSH=$(TCLSH)
+
+EXTRA_DIST += config/confsubst
+
+## Shell scripts.
+dist_bin_SCRIPTS += check-sender
+dist_man_MANS += check-sender.1
+
+dist_bin_SCRIPTS += buf
+dist_man_MANS += buf.1
+
+dist_bin_SCRIPTS += create
+dist_man_MANS += create.1
+
+dist_bin_SCRIPTS += z
+dist_man_MANS += z.1
+
+## bash scripts.
+if HAVE_BASH
+
+bin_SCRIPTS += inplace
+CLEANFILES += inplace
+EXTRA_DIST += inplace.in
+dist_man_MANS += inplace.1
+
+inplace: inplace.in Makefile
+ $(confsubst) $(srcdir)/inplace.in >$@.new $(SUBSTITUTIONS) && \
+ chmod +x $@.new && mv $@.new $@
+
+endif
+
+## Python scripts.
+if HAVE_PYTHON
+
+if HAVE_PYMOD_CDB
+bin_SCRIPTS += cdb-assign
+dist_man_MANS += cdb-assign.1
+endif
+
+CLEANFILES += cdb-assign
+EXTRA_DIST += cdb-assign.in
+
+cdb-assign: cdb-assign.in Makefile
+ $(confsubst) $(srcdir)/cdb-assign.in >$@.new $(SUBSTITUTIONS) && \
+ chmod +x $@.new && mv $@.new $@
+
+if HAVE_PYMOD_CDB
+bin_SCRIPTS += cdb-list
+dist_man_MANS += cdb-list.1
+endif
+
+CLEANFILES += cdb-list
+EXTRA_DIST += cdb-list.in
+
+cdb-list: cdb-list.in Makefile
+ $(confsubst) $(srcdir)/cdb-list.in >$@.new $(SUBSTITUTIONS) && \
+ chmod +x $@.new && mv $@.new $@
+
+if HAVE_PYMOD_CDB
+bin_SCRIPTS += cdb-map
+dist_man_MANS += cdb-map.1
+endif
+
+CLEANFILES += cdb-map
+EXTRA_DIST += cdb-map.in
+
+cdb-map: cdb-map.in Makefile
+ $(confsubst) $(srcdir)/cdb-map.in >$@.new $(SUBSTITUTIONS) && \
+ chmod +x $@.new && mv $@.new $@
+
+endif
+
+## Perl scripts.
+if HAVE_PERL
+
+sbin_SCRIPTS += shadowfix
+CLEANFILES += shadowfix
+EXTRA_DIST += shadowfix.in
+
+shadowfix: shadowfix.in Makefile
+ $(confsubst) $(srcdir)/shadowfix.in >$@.new $(SUBSTITUTIONS) && \
+ chmod +x $@.new && mv $@.new $@
+
+man_MANS += shadowfix.8
+CLEANFILES += shadowfix.8
+
+shadowfix.8: shadowfix.in
+ pod2man --section 8 $(srcdir)/shadowfix.in >$@.new && mv $@.new $@
+
+bin_SCRIPTS += unfwd
+CLEANFILES += unfwd
+EXTRA_DIST += unfwd.in
+dist_man_MANS += unfwd.1
+
+unfwd: unfwd.in Makefile
+ $(confsubst) $(srcdir)/unfwd.in >$@.new $(SUBSTITUTIONS) && \
+ chmod +x $@.new && mv $@.new $@
+
+endif
+
+## Perl modules.
+if HAVE_PERL
+dist_perlmod_DATA = MdwOpt.pm
+endif
+
+## Tcl scripts.
+if HAVE_TCLSH
+
+bin_SCRIPTS += splitconf
+CLEANFILES += splitconf
+EXTRA_DIST += splitconf.in
+dist_man_MANS += splitconf.1
+
+splitconf: splitconf.in Makefile
+ $(confsubst) $(srcdir)/splitconf.in >$@.new $(SUBSTITUTIONS) && \
+ chmod +x $@.new && mv $@.new $@
+
+endif
+
+###----- That's all, folks --------------------------------------------------