swanctl: Install swanctl.conf if it does not exist yet
authorTobias Brunner <tobias@strongswan.org>
Thu, 17 Apr 2014 16:34:38 +0000 (18:34 +0200)
committerMartin Willi <martin@revosec.ch>
Wed, 7 May 2014 13:48:16 +0000 (15:48 +0200)
src/swanctl/Makefile.am

index 1f702e1..4f0c1c2 100644 (file)
@@ -23,10 +23,14 @@ swanctl_LDADD = \
 
 swanctl.o :            $(top_builddir)/config.status
 
-EXTRA_DIST = swanctl.conf
-
 AM_CPPFLAGS = \
        -I$(top_srcdir)/src/libstrongswan \
        -I$(top_srcdir)/src/libcharon/plugins/vici \
        -DSWANCTLDIR=\""${swanctldir}\"" \
        -DPLUGINS=\""${s_plugins}\""
+
+EXTRA_DIST = swanctl.conf
+
+install-data-local: swanctl.conf
+       test -e "$(DESTDIR)$(swanctldir)" || $(INSTALL) -d "$(DESTDIR)$(swanctldir)"
+       test -e "$(DESTDIR)$(swanctldir)/swanctl.conf" || $(INSTALL) -m 640 $(srcdir)/swanctl.conf $(DESTDIR)$(swanctldir)/swanctl.conf || true