Makefile.am 1.09 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
19

20 21
if HAVE_DAEMON

Lubos Slovak's avatar
Lubos Slovak committed
22
install-data-local: knot.sample.conf
23 24 25 26
	[ -d $(DESTDIR)/$(config_dir) ] || \
	  $(INSTALL) -d $(DESTDIR)/$(config_dir)
	[ -f $(DESTDIR)/$(config_dir)/knot.sample.conf ] || \
	  $(INSTALL_DATA) knot.sample.conf $(srcdir)/example.com.zone $(DESTDIR)/$(config_dir)
27

28
uninstall-local:
29 30 31 32
	[ -f $(DESTDIR)/$(config_dir)/knot.sample.conf ] && \
	  rm -f $(DESTDIR)/$(config_dir)/knot.sample.conf
	[ -f $(DESTDIR)/$(config_dir)/example.com.zone ] && \
	  rm -f $(DESTDIR)/$(config_dir)/example.com.zone
33

34 35
endif # HAVE_DAEMON

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