chiark / gitweb /
Major overhaul.
[zoneconf] / Makefile.am
diff --git a/Makefile.am b/Makefile.am
new file mode 100644 (file)
index 0000000..a26d686
--- /dev/null
@@ -0,0 +1,89 @@
+### -*-makefile-*-
+###
+### Build script for zoneconf
+###
+### (c) 2011 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.
+
+sbin_SCRIPTS            =
+man_MANS                =
+noinst_DATA             =
+
+EXTRA_DIST              =
+CLEANFILES              =
+DISTCLEANFILES          =
+
+pkgconfdir              = $(sysconfdir)/$(PACKAGE)
+
+###--------------------------------------------------------------------------
+### Standard configuration substitutions.
+
+confsubst = $(top_srcdir)/config/confsubst
+EXTRA_DIST             += config/confsubst
+
+SUBSTITUTIONS = \
+               prefix=$(prefix) exec_prefix=$(exec_prefix) \
+               bindir=$(bindir) sbindir=$(sbindir) \
+               bindprogsdir=$(bindprogsdir) \
+               pkgconfdir=$(pkgconfdir) \
+               pkgstatedir=$(localstatedir)/lib/$(PACKAGE) \
+               PACKAGE=$(PACKAGE) VERSION=$(VERSION) \
+               TCLSH=$(TCLSH)
+
+V_SUBST = $(V_SUBST_$(V))
+V_SUBST_ = $(V_SUBST_$(AM_DEFAULT_VERBOSITY))
+V_SUBST_0 = @echo "  SUBST  $@";
+SUBST = $(V_SUBST)$(confsubst)
+
+###--------------------------------------------------------------------------
+### Executable scripts.
+
+## Main scripts.
+sbin_SCRIPTS           += zoneconf
+EXTRA_DIST             += zoneconf.in
+CLEANFILES             += zoneconf
+
+zoneconf: zoneconf.in Makefile
+       $(SUBST) $(srcdir)/zoneconf.in $(SUBSTITUTIONS) >zoneconf.new && \
+               chmod +x zoneconf.new && mv zoneconf.new zoneconf
+
+## Userv interface.
+sbin_SCRIPTS           += zoneconf-install-userv
+EXTRA_DIST             += zoneconf-install-userv
+
+noinst_DATA            += userv.rc
+EXTRA_DIST             += userv.rc.in
+
+userv.rc: userv.rc.in Makefile
+       $(SUBST) $(srcdir)/userv.rc.in $(SUBSTITUTIONS) >userv.rc.new && \
+               mv userv.rc.new userv.rc
+
+## SSH interface.
+sbin_SCRIPTS           += zoneconf-install-ssh
+EXTRA_DIST             += zoneconf-install-ssh
+
+###--------------------------------------------------------------------------
+### Distribution.
+
+EXTRA_DIST             += config/auto-version
+
+dist-hook:
+       echo $(VERSION) >$(distdir)/RELEASE
+
+###----- That's all, folks --------------------------------------------------