1 # make this relative to the location of strongswan.conf
2 strongswanconfdir = `dirname $(strongswan_conf)`
3 strongswanddir = $(strongswanconfdir)/strongswan.d
4 charonconfdir = $(strongswanddir)/charon
5 # copy these files also to /usr/share
6 templatesdir = $(pkgdatadir)/templates/config
7 optionstemplatedir = $(templatesdir)/strongswan.d
8 pluginstemplatedir = $(templatesdir)/plugins
14 options/charon-logging.opt \
15 options/charon-systemd.opt \
22 options/scepclient.opt \
28 plugins/android_log.opt \
30 plugins/attr-sql.opt \
32 plugins/certexpire.opt \
33 plugins/coupling.opt \
36 plugins/duplicheck.opt \
38 plugins/eap-aka-3ggp2.opt \
39 plugins/eap-dynamic.opt \
41 plugins/eap-peap.opt \
42 plugins/eap-radius.opt \
44 plugins/eap-simaka-sql.opt \
47 plugins/eap-ttls.opt \
48 plugins/error-notify.opt \
49 plugins/ext-auth.opt \
50 plugins/forecast.opt \
53 plugins/imc-attestation.opt \
55 plugins/imc-scanner.opt \
56 plugins/imc-swid.opt \
57 plugins/imc-test.opt \
58 plugins/imv-attestation.opt \
60 plugins/imv-scanner.opt \
61 plugins/imv-swid.opt \
62 plugins/imv-test.opt \
63 plugins/ipseckey.opt \
65 plugins/kernel-libipsec.opt \
66 plugins/kernel-netlink.opt \
67 plugins/kernel-pfkey.opt \
68 plugins/kernel-pfroute.opt \
69 plugins/load-tester.opt \
77 plugins/socket-default.opt \
80 plugins/systime-fix.opt \
81 plugins/tnc-ifmap.opt \
85 plugins/tnccs-11.opt \
86 plugins/tnccs-20.opt \
90 plugins/whitelist.opt \
91 plugins/xauth-eap.opt \
94 alloptions = $(options) $(plugins)
96 confsnippets = $(alloptions:opt=conf)
98 # we only install snippets for enabled plugins
99 plugins_install_tmp = $(charon_plugins:%=plugins/%.tmp)
100 plugins_install_src = $(charon_plugins:%=plugins/%.conf)
101 # only install snippets for enabled components
102 # has to be defined via autoconf as we can't do it with automake conditionals
103 options_install_src = $(strongswan_options:%=options/%.conf)
105 templates_DATA = strongswan.conf
106 optionstemplate_DATA = $(options_install_src)
107 pluginstemplate_DATA = $(plugins_install_src)
111 BUILT_SOURCES = default.conf strongswan.conf.5.main $(confsnippets)
112 EXTRA_DIST = format-options.py strongswan.conf default.opt \
113 default.conf strongswan.conf.5.main $(alloptions) $(confsnippets)
115 CLEANFILES=$(man_MANS)
122 -e "s:\@PLUGIN_NAME\@:`basename $< .opt`:" \
123 $(srcdir)/default.opt | cat - $< | \
124 $(PYTHON) $(srcdir)/format-options.py -f conf -r charon.plugins > $(srcdir)/$@ \
127 $(PYTHON) $(srcdir)/format-options.py -f conf -r charon.plugins $< > $(srcdir)/$@ \
131 # we need another implicit rule to generate files from the generic template only
132 # if the rules above did not catch it. this requires an intermediate step that
133 # generates a copy of the generic config template.
134 $(plugins_install_tmp):
135 @mkdir -p $(builddir)/plugins
136 @cp $(srcdir)/default.conf $(builddir)/$@
141 -e "s:\@PLUGIN_NAME\@:`basename $< .tmp`:" \
142 $(builddir)/$< > $(builddir)/$@
144 strongswan.conf.5.main: $(alloptions)
146 cd $(srcdir) && $(PYTHON) format-options.py -f man $(alloptions) > $@
148 strongswan.conf.5: strongswan.conf.5.head strongswan.conf.5.main strongswan.conf.5.tail
150 cat strongswan.conf.5.head $(srcdir)/strongswan.conf.5.main strongswan.conf.5.tail > $@
153 rm -f plugins/*.conf plugins/*.tmp
155 maintainer-clean-local:
157 rm -f $(confsnippets) default.conf plugins/*.conf plugins/*.tmp
159 install-data-local: $(plugins_install_src)
160 test -e "$(DESTDIR)${strongswanconfdir}" || $(INSTALL) -d "$(DESTDIR)$(strongswanconfdir)" || true
161 test -e "$(DESTDIR)${strongswanddir}" || $(INSTALL) -d "$(DESTDIR)$(strongswanddir)" || true
162 test -e "$(DESTDIR)${charonconfdir}" || $(INSTALL) -d "$(DESTDIR)$(charonconfdir)" || true
163 test -e "$(DESTDIR)$(strongswanconfdir)/strongswan.conf" || $(INSTALL) -m 644 $(srcdir)/strongswan.conf $(DESTDIR)$(strongswanconfdir)/strongswan.conf || true
164 for f in $(options_install_src); do \
165 name=`basename $$f`; \
166 test -f "$(DESTDIR)$(strongswanddir)/$$name" || $(INSTALL) -m 644 "$(srcdir)/$$f" "$(DESTDIR)$(strongswanddir)/$$name" || true; \
168 for f in $(plugins_install_src); do \
169 name=`basename $$f`; \
170 if test -f "$$f"; then dir=; else dir="$(srcdir)/"; fi; \
171 test -f "$(DESTDIR)$(charonconfdir)/$$name" || $(INSTALL) -m 644 "$$dir$$f" "$(DESTDIR)$(charonconfdir)/$$name" || true; \