| 1 | ### -*-makefile-*- |
| 2 | ### |
| 3 | ### Build script for zoneconf |
| 4 | ### |
| 5 | ### (c) 2011 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 | sbin_SCRIPTS = |
| 25 | man_MANS = |
| 26 | noinst_DATA = |
| 27 | |
| 28 | EXTRA_DIST = |
| 29 | CLEANFILES = |
| 30 | DISTCLEANFILES = |
| 31 | |
| 32 | pkgconfdir = $(sysconfdir)/$(PACKAGE) |
| 33 | |
| 34 | ###-------------------------------------------------------------------------- |
| 35 | ### Standard configuration substitutions. |
| 36 | |
| 37 | confsubst = $(top_srcdir)/config/confsubst |
| 38 | EXTRA_DIST += config/confsubst |
| 39 | |
| 40 | SUBSTITUTIONS = \ |
| 41 | prefix=$(prefix) exec_prefix=$(exec_prefix) \ |
| 42 | bindir=$(bindir) sbindir=$(sbindir) \ |
| 43 | bindprogsdir=$(bindprogsdir) \ |
| 44 | pkgconfdir=$(pkgconfdir) \ |
| 45 | pkgstatedir=$(localstatedir)/lib/$(PACKAGE) \ |
| 46 | PACKAGE=$(PACKAGE) VERSION=$(VERSION) \ |
| 47 | TCLSH=$(TCLSH) |
| 48 | |
| 49 | V_SUBST = $(V_SUBST_$(V)) |
| 50 | V_SUBST_ = $(V_SUBST_$(AM_DEFAULT_VERBOSITY)) |
| 51 | V_SUBST_0 = @echo " SUBST $@"; |
| 52 | SUBST = $(V_SUBST)$(confsubst) |
| 53 | |
| 54 | ###-------------------------------------------------------------------------- |
| 55 | ### Executable scripts. |
| 56 | |
| 57 | ## Main scripts. |
| 58 | sbin_SCRIPTS += zoneconf |
| 59 | EXTRA_DIST += zoneconf.in |
| 60 | CLEANFILES += zoneconf |
| 61 | |
| 62 | zoneconf: zoneconf.in Makefile |
| 63 | $(SUBST) $(srcdir)/zoneconf.in $(SUBSTITUTIONS) >zoneconf.new && \ |
| 64 | chmod +x zoneconf.new && mv zoneconf.new zoneconf |
| 65 | |
| 66 | ## Userv interface. |
| 67 | sbin_SCRIPTS += zoneconf-install-userv |
| 68 | EXTRA_DIST += zoneconf-install-userv.in |
| 69 | CLEANFILES += zoneconf-install-userv |
| 70 | |
| 71 | zoneconf-install-userv: zoneconf-install-userv.in Makefile |
| 72 | $(SUBST) $(srcdir)/zoneconf-install-userv.in $(SUBSTITUTIONS) \ |
| 73 | >zoneconf-install-userv.new && \ |
| 74 | chmod +x zoneconf-install-userv.new && \ |
| 75 | mv zoneconf-install-userv.new zoneconf-install-userv |
| 76 | |
| 77 | noinst_DATA += userv.rc |
| 78 | EXTRA_DIST += userv.rc.in |
| 79 | |
| 80 | userv.rc: userv.rc.in Makefile |
| 81 | $(SUBST) $(srcdir)/userv.rc.in $(SUBSTITUTIONS) >userv.rc.new && \ |
| 82 | mv userv.rc.new userv.rc |
| 83 | |
| 84 | ## SSH interface. |
| 85 | sbin_SCRIPTS += zoneconf-install-ssh |
| 86 | EXTRA_DIST += zoneconf-install-ssh.in |
| 87 | CLEANFILES += zoneconf-install-ssh |
| 88 | |
| 89 | zoneconf-install-ssh: zoneconf-install-ssh.in Makefile |
| 90 | $(SUBST) $(srcdir)/zoneconf-install-ssh.in $(SUBSTITUTIONS) \ |
| 91 | >zoneconf-install-ssh.new && \ |
| 92 | chmod +x zoneconf-install-ssh.new && \ |
| 93 | mv zoneconf-install-ssh.new zoneconf-install-ssh |
| 94 | |
| 95 | ###-------------------------------------------------------------------------- |
| 96 | ### Distribution. |
| 97 | |
| 98 | EXTRA_DIST += config/auto-version |
| 99 | |
| 100 | dist-hook: |
| 101 | echo $(VERSION) >$(distdir)/RELEASE |
| 102 | |
| 103 | ###----- That's all, folks -------------------------------------------------- |