@@ -18,33 +18,76 @@ openfortivpn_CPPFLAGS = -DSYSCONFDIR=\"$(sysconfdir)\" \
1818openfortivpn_CPPFLAGS += $(OPENSSL_CFLAGS ) $(LIBSYSTEMD_CFLAGS )
1919openfortivpn_LDADD = $(OPENSSL_LIBS ) $(LIBSYSTEMD_LIBS )
2020
21- DISTCHECK_CONFIGURE_FLAGS = CFLAGS=-Werror
21+ PATHFILES =
22+ CLEAN_LOCALS =
23+ EXTRA_DIST = \
24+ autogen.sh \
25+ CHANGELOG.md \
26+ LICENSE \
27+ LICENSE.OpenSSL \
28+ README.md
2229
23- confdir =$(sysconfdir ) /@PACKAGE@
30+ DISTCHECK_CONFIGURE_FLAGS = \
31+ CFLAGS=-Werror \
32+ --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir )
33+
34+ # configuration file template
2435datadir =$(prefix ) /share/@PACKAGE@
2536data_DATA =etc/openfortivpn/config.template
2637
38+ EXTRA_DIST += $(data_DATA )
39+
40+ # initial configuration file
41+ confdir =$(sysconfdir ) /@PACKAGE@
42+
2743etc/openfortivpn/config : $(srcdir ) /etc/openfortivpn/config.template
2844 @$(MKDIR_P ) etc/openfortivpn
2945 $(AM_V_GEN )$(SED ) -e ' /^#/n;/^\s*$$/n;s/^/# /' $(srcdir ) /etc/openfortivpn/config.template > $@
3046
31- install-data-hook : etc/openfortivpn/config
47+ install-data-hook : etc/openfortivpn/config lib/systemd/system/openfortivpn@.service
3248 if ! test -f $( DESTDIR) $( confdir) /config ; then \
3349 $(MKDIR_P ) $(DESTDIR )$(confdir ) ; \
3450 $(INSTALL ) -m 600 etc/openfortivpn/config \
3551 $(DESTDIR )$(confdir ) /config ; \
3652 fi
3753
54+ clean-local-config :
55+ -rm -f $(top_builddir ) /etc/openfortivpn/config
56+
57+ CLEAN_LOCALS += clean-local-config
58+
59+ # systemd service file
60+ PATHFILES += lib/systemd/system/openfortivpn@.service
61+
62+ if HAVE_SYSTEMD
63+ lib/systemd/system/openfortivpn@.service : $(srcdir ) /lib/systemd/system/openfortivpn@.service.in
64+ @$(MKDIR_P ) lib/systemd/system
65+ $(AM_V_GEN )$(SED ) -e ' s|[@]BINDIR[@]|$(bindir)|g;s|[@]SYSCONFDIR[@]|$(sysconfdir)|g' $(srcdir ) /lib/systemd/system/openfortivpn@.service.in > $@
66+
67+ systemdsystemunit_DATA = lib/systemd/system/openfortivpn@.service
68+
69+ clean-local-systemd :
70+ -rm -f $(top_builddir ) /lib/systemd/system/openfortivpn@.service
71+
72+ CLEAN_LOCALS += clean-local-systemd
73+ endif
74+
75+ # man page
76+ PATHFILES += doc/openfortivpn.1
3877dist_man_MANS = doc/openfortivpn.1
3978
4079doc/openfortivpn.1 : $(srcdir ) /doc/openfortivpn.1.in
4180 @$(MKDIR_P ) doc
4281 $(AM_V_GEN )$(SED ) -e ' s|[@]SYSCONFDIR[@]|$(sysconfdir)|g;s|[@]DATADIR[@]|$(datadir)|g' $(srcdir ) /doc/openfortivpn.1.in > $@
4382
44- all-local : etc/openfortivpn/config
83+ clean-local-man :
84+ -rm -f $(top_builddir ) /doc/openfortivpn.1
4585
46- clean-local :
47- -rm -f etc/openfortivpn/config
48- -rm -f doc/openfortivpn.1
86+ CLEAN_LOCALS += clean-local-man
87+
88+
89+ EXTRA_DIST += $(PATHFILES:=.in )
90+
91+ all-local : etc/openfortivpn/config
4992
50- EXTRA_DIST = autogen.sh CHANGELOG.md LICENSE LICENSE.OpenSSL README.md doc/openfortivpn.1.in $( data_DATA )
93+ clean-local : $( CLEAN_LOCALS )
0 commit comments