Makefile.am 1.38 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 28 29 30 31 32
if HAVE_BASH_COMPLETIONS
	if [ \! -f $(DESTDIR)/$(bash_completions_dir)/keymgr ]; then \
	  $(INSTALL) -d $(DESTDIR)/$(bash_completions_dir); \
	  $(INSTALL_DATA) $(srcdir)/keymgr-completion.sh $(DESTDIR)/$(bash_completions_dir)/keymgr; \
	fi
endif # HAVE_BASH_COMPLETIONS
33

34
uninstall-local:
35
	-rm -rf $(DESTDIR)/$(config_dir)/knot.sample.conf \
36
	        $(DESTDIR)/$(config_dir)/example.com.zone
37 38 39
if HAVE_BASH_COMPLETIONS
	-rm -rf $(DESTDIR)/$(bash_completions_dir)/keymgr
endif # HAVE_BASH_COMPLETIONS
40

41 42
endif # HAVE_DAEMON

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