From 1a5ea5da5abfaac44bb679b2adee3c5111eeaa35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Fri, 22 May 2015 10:10:13 +0200 Subject: [PATCH] Simplify install and clean local targets --- samples/Makefile.am | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/samples/Makefile.am b/samples/Makefile.am index 175c468ce..28ad67f7d 100644 --- a/samples/Makefile.am +++ b/samples/Makefile.am @@ -20,22 +20,19 @@ EXTRA_DIST = knot.sample.conf.in example.com.zone keymgr-completion.sh keymgr-co if HAVE_DAEMON install-data-local: knot.sample.conf - [ -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) - [ -d $(DESTDIR)/$(sysconfdir)/bash_completion.d ] || - $(INSTALL) -d $(DESTDIR)/$(sysconfdir)/bash_completion.d - [ -f $(DESTDIR)/$(sysconfdir)/bash_completion.d/keymgr ] || \ - $(INSTALL_DATA) keymgr-completion.sh $(DESTDIR)/$(sysconfdir)/bash_completion.d/keymgr + 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 + if [ \! -f $(DESTDIR)/$(sysconfdir)/bash_completion.d/keymgr ]; then \ + $(INSTALL) -d $(DESTDIR)/$(sysconfdir)/bash_completion.d; \ + $(INSTALL_DATA) $(srcdir)/keymgr-completion.sh $(DESTDIR)/$(sysconfdir)/bash_completion.d/keymgr; \ + fi uninstall-local: - [ -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 - [ -f $(DESTDIR)/$(sysconfdir)/bash_completion.d/keymgr ] && \ - rm -f $(DESTDIR)/$(sysconfdir)/bash_completion.d/keymgr + -rm -rf $(DESTDIR)/$(config_dir)/knot.sample.conf \ + $(DESTDIR)/$(config_dir)/example.com.zone \ + $(DESTDIR)/$(sysconfdir)/bash_completion.d/keymgr endif # HAVE_DAEMON