Major overhaul.
[zoneconf] / Makefile.am
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
69
70 noinst_DATA += userv.rc
71 EXTRA_DIST += userv.rc.in
72
73 userv.rc: userv.rc.in Makefile
74 $(SUBST) $(srcdir)/userv.rc.in $(SUBSTITUTIONS) >userv.rc.new && \
75 mv userv.rc.new userv.rc
76
77 ## SSH interface.
78 sbin_SCRIPTS += zoneconf-install-ssh
79 EXTRA_DIST += zoneconf-install-ssh
80
81 ###--------------------------------------------------------------------------
82 ### Distribution.
83
84 EXTRA_DIST += config/auto-version
85
86 dist-hook:
87 echo $(VERSION) >$(distdir)/RELEASE
88
89 ###----- That's all, folks --------------------------------------------------