Makefile.am 2.98 KB
Newer Older
1
SUBDIRS = . tests
2

3 4
# Install keactrl in sbin and the keactrl.conf required by the keactrl
# in etc. keactrl will look for its configuration file in the etc folder.
5
# If the default location needs to be changed it may be achieved by
6
# setting KEACTRL_CONF environment variable.
7
sbin_SCRIPTS  = keactrl
8
KEA_CONFIGFILES = kea-dhcp4.conf kea-dhcp6.conf kea-dhcp-ddns.conf \
9
                  kea-ctrl-agent.conf kea-netconf.conf
10
CONFIGFILES = keactrl.conf $(KEA_CONFIGFILES)
11

12
man_MANS = keactrl.8
13
DISTCLEANFILES = keactrl keactrl.conf $(man_MANS)
14
CLEANFILES = $(KEA_CONFIGFILES)
15 16
EXTRA_DIST = keactrl.in keactrl.conf.in kea-dhcp4.conf.pre \
             kea-dhcp6.conf.pre kea-dhcp-ddns.conf.pre \
17 18
             kea-ctrl-agent.conf.pre kea-netconf.conf.pre \
             $(man_MANS) keactrl.xml
19

20 21 22
# *.conf files are not really sources used for building other targets, but we need
# these files to be generated before make install is called.
BUILT_SOURCES = $(KEA_CONFIGFILES)
23

24 25 26
if GENERATE_DOCS

keactrl.8: keactrl.xml
27
	@XSLTPROC@ --novalid --xinclude @NONET@ -o $@ \
28
        http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/keactrl.xml
29 30 31 32 33 34 35 36

else

$(man_MANS):
	@echo Man generation disabled.  Creating dummy $@.  Configure with --enable-generate-docs to enable it.
	@echo Man generation disabled.  Remove this file, configure with --enable-generate-docs, and rebuild Kea > $@

endif
37

38
kea-dhcp4.conf: kea-dhcp4.conf.pre
39 40
	$(top_builddir)/tools/path_replacer.sh \
    $(top_srcdir)/src/bin/keactrl/kea-dhcp4.conf.pre $@
41 42

kea-dhcp6.conf: kea-dhcp6.conf.pre
43 44
	$(top_builddir)/tools/path_replacer.sh \
    $(top_srcdir)/src/bin/keactrl/kea-dhcp6.conf.pre $@
45 46

kea-dhcp-ddns.conf: kea-dhcp-ddns.conf.pre
47 48
	$(top_builddir)/tools/path_replacer.sh \
    $(top_srcdir)/src/bin/keactrl/kea-dhcp-ddns.conf.pre $@
49 50

kea-ctrl-agent.conf: kea-ctrl-agent.conf.pre
51 52
	$(top_builddir)/tools/path_replacer.sh \
    $(top_srcdir)/src/bin/keactrl/kea-ctrl-agent.conf.pre $@
53

54 55 56 57
kea-netconf.conf: kea-netconf.conf.pre
	$(top_builddir)/tools/path_replacer.sh \
    $(top_srcdir)/src/bin/keactrl/kea-netconf.conf.pre $@

58
if INSTALL_CONFIGURATIONS
59

60 61 62 63 64 65 66
# Since Kea 1.3.0 release we have 4 different Kea configuration files
# instead of one, i.e. kea-dhcp4.conf, kea-dhcp6.conf, kea-dhcp-ddns.conf
# and kea-ctrl-agent.conf. To facilitate the use of these new files
# the keactrl.conf has been updated in Kea 1.3.0 release. Therefore,
# we install new version of thea keactrl.conf file unconditionally.
# To preserve any user modifications to the old version of the file,
# this old file is backed up as keactrl.conf.bak.
67 68 69
install-data-local:
	$(mkinstalldirs) $(DESTDIR)/@sysconfdir@/@PACKAGE@
	for f in $(CONFIGFILES) ; do	\
70 71 72 73 74 75 76 77
		if test -f $(DESTDIR)$(sysconfdir)/@PACKAGE@/$$f && \
		   test $$f = "keactrl.conf"; then \
			mv $(DESTDIR)$(sysconfdir)/@PACKAGE@/$$f \
			   $(DESTDIR)$(sysconfdir)/@PACKAGE@/$$f.bak; \
		fi; \
		if test ! -f $(DESTDIR)$(sysconfdir)/@PACKAGE@/$$f; then \
			${INSTALL_DATA} $$f $(DESTDIR)$(sysconfdir)/@PACKAGE@/; \
		fi; \
78
	done
79

80
endif