Makefile.am 1.29 KB
Newer Older
1 2 3 4 5
edit = sed \
	-e 's|@version[@]|$(PACKAGE_VERSION)|g' \
	-e 's|@package[@]|$(PACKAGE_NAME)|g' \
	-e 's|@localstatedir[@]|$(localstatedir)|g' \
	-e 's|@prefix[@]|$(prefix)|g' \
6
	-e 's|@sysconfdir[@]|$(sysconfdir)|g' \
7 8 9
	-e 's|@config_dir[@]|$(config_dir)|g' \
	-e 's|@storage_dir[@]|$(storage_dir)|g' \
	-e 's|@run_dir[@]|$(run_dir)|g'
10

11
knot.sample.conf: knot.sample.conf.in
12 13 14 15 16 17
	rm -f $@ $@.tmp
	srcdir=''; \
	  test -f ./$@.in || srcdir=$(srcdir)/; \
	  $(edit) $${srcdir}$@.in >$@.tmp
	mv $@.tmp $@

18
EXTRA_DIST = knot.sample.conf.in example.com.zone keymgr-completion.sh keymgr-completion.zsh
19

20 21
if HAVE_DAEMON

Lubos Slovak's avatar
Lubos Slovak committed
22
install-data-local: knot.sample.conf
23 24 25 26
	if [ \! -f $(DESTDIR)/$(config_dir)/knot.sample.conf ]; then \
	  $(INSTALL) -d $(DESTDIR)/$(config_dir); \
	  $(INSTALL_DATA) knot.sample.conf $(srcdir)/example.com.zone $(DESTDIR)/$(config_dir); \
	fi
27
if HAVE_BASH_COMPLETION
28 29 30
	if [ \! -f $(BASH_COMPLETION_DIR)/keymgr ]; then \
	  $(INSTALL) -d $(BASH_COMPLETION_DIR); \
	  $(INSTALL_DATA) $(srcdir)/keymgr-completion.sh $(BASH_COMPLETION_DIR)/keymgr; \
31
	fi
32
endif # HAVE_BASH_COMPLETION
33

34
uninstall-local:
35 36 37
	-rm -rf $(DESTDIR)/$(config_dir)/knot.sample.conf \
	        $(DESTDIR)/$(config_dir)/example.com.zone \
	        $(DESTDIR)/$(sysconfdir)/bash_completion.d/keymgr
38

39 40
endif # HAVE_DAEMON

41
clean-local:
Lubos Slovak's avatar
Lubos Slovak committed
42
	rm -f knot.sample.conf