noinst_DATA = manager.conf

CLEANFILES = $(noinst_DATA)

EXTRA_DIST = manager.conf.in

manager.conf: Makefile manager.conf.in
	sed \
		-e 's|[@]templatesdir[@]|$(templatesdir)|' \
		-e 's|[@]confdir[@]|$(confdir)|' \
		< $(srcdir)/$@.in > $@

install-data-local:
	$(mkinstalldirs) $(DESTDIR)$(confdir)
	if [ -f $(DESTDIR)$(confdir)/manager.conf ]; then                       \
	    $(INSTALL_DATA) manager.conf $(DESTDIR)$(confdir)/manager.conf.new; \
	else                                                                       \
	    $(INSTALL_DATA) manager.conf $(DESTDIR)$(confdir)/manager.conf;     \
	fi

uninstall-local:
	rm -f $(DESTDIR)$(confdir)/manager.conf