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-nm.opt \
16 options/charon-systemd.opt \
18 options/imv_policy_manager.opt \
24 options/scepclient.opt \
30 plugins/addrblock.opt \
31 plugins/android_log.opt \
33 plugins/attr-sql.opt \
35 plugins/bypass-lan.opt \
36 plugins/certexpire.opt \
37 plugins/coupling.opt \
40 plugins/duplicheck.opt \
42 plugins/eap-aka-3gpp.opt \
43 plugins/eap-aka-3gpp2.opt \
44 plugins/eap-dynamic.opt \
46 plugins/eap-peap.opt \
47 plugins/eap-radius.opt \
49 plugins/eap-simaka-sql.opt \
52 plugins/eap-ttls.opt \
53 plugins/error-notify.opt \
54 plugins/ext-auth.opt \
55 plugins/forecast.opt \
58 plugins/imc-attestation.opt \
61 plugins/imc-scanner.opt \
62 plugins/imc-swid.opt \
63 plugins/imc-swima.opt \
64 plugins/imc-test.opt \
65 plugins/imv-attestation.opt \
67 plugins/imv-scanner.opt \
68 plugins/imv-swid.opt \
69 plugins/imv-test.opt \
70 plugins/ipseckey.opt \
72 plugins/kernel-libipsec.opt \
73 plugins/kernel-netlink.opt \
74 plugins/kernel-pfkey.opt \
75 plugins/kernel-pfroute.opt \
76 plugins/load-tester.opt \
80 plugins/osx-attr.opt \
86 plugins/revocation.opt \
87 plugins/socket-default.opt \
90 plugins/systime-fix.opt \
91 plugins/tnc-ifmap.opt \
95 plugins/tnccs-11.opt \
96 plugins/tnccs-20.opt \
101 plugins/whitelist.opt \
102 plugins/xauth-eap.opt \
103 plugins/xauth-pam.opt
105 alloptions = $(options) $(plugins)
107 confsnippets = $(alloptions:opt=conf)
109 # we only install snippets for enabled plugins
110 plugins_install_tmp = $(charon_plugins:%=plugins/%.tmp)
111 plugins_install_src = $(charon_plugins:%=plugins/%.conf)
112 # only install snippets for enabled components
113 # has to be defined via autoconf as we can't do it with automake conditionals
114 options_install_src = $(strongswan_options:%=options/%.conf)
116 templates_DATA = strongswan.conf
117 optionstemplate_DATA = $(options_install_src)
118 pluginstemplate_DATA = $(plugins_install_src)
122 BUILT_SOURCES = default.conf strongswan.conf.5.main $(confsnippets)
123 EXTRA_DIST = format-options.py strongswan.conf default.opt \
124 default.conf strongswan.conf.5.main $(alloptions) $(confsnippets)
126 CLEANFILES=$(man_MANS)
133 -e "s:\@PLUGIN_NAME\@:`basename $< .opt`:" \
134 $(srcdir)/default.opt | cat - $< | \
135 $(PYTHON) $(srcdir)/format-options.py -f conf -r charon.plugins > $(srcdir)/$@ \
138 $(PYTHON) $(srcdir)/format-options.py -f conf -r charon.plugins $< > $(srcdir)/$@ \
142 # we need another implicit rule to generate files from the generic template only
143 # if the rules above did not catch it. this requires an intermediate step that
144 # generates a copy of the generic config template.
145 $(plugins_install_tmp):
146 @mkdir -p $(builddir)/plugins
147 @cp $(srcdir)/default.conf $(builddir)/$@
152 -e "s:\@PLUGIN_NAME\@:`basename $< .tmp`:" \
153 $(builddir)/$< > $(builddir)/$@
155 strongswan.conf.5.main: $(alloptions)
157 cd $(srcdir) && $(PYTHON) format-options.py -f man $(alloptions) > $@
159 strongswan.conf.5: strongswan.conf.5.head strongswan.conf.5.main strongswan.conf.5.tail
161 cat strongswan.conf.5.head $(srcdir)/strongswan.conf.5.main strongswan.conf.5.tail > $@
164 rm -f plugins/*.conf plugins/*.tmp
166 maintainer-clean-local:
168 rm -f $(confsnippets) default.conf plugins/*.conf plugins/*.tmp
170 install-data-local: $(plugins_install_src)
171 test -e "$(DESTDIR)${strongswanconfdir}" || $(INSTALL) -d "$(DESTDIR)$(strongswanconfdir)" || true
172 test -e "$(DESTDIR)${strongswanddir}" || $(INSTALL) -d "$(DESTDIR)$(strongswanddir)" || true
173 test -e "$(DESTDIR)${charonconfdir}" || $(INSTALL) -d "$(DESTDIR)$(charonconfdir)" || true
174 test -e "$(DESTDIR)$(strongswanconfdir)/strongswan.conf" || $(INSTALL) -m 644 $(srcdir)/strongswan.conf $(DESTDIR)$(strongswanconfdir)/strongswan.conf || true
175 for f in $(options_install_src); do \
176 name=`basename $$f`; \
177 test -f "$(DESTDIR)$(strongswanddir)/$$name" || $(INSTALL) -m 644 "$(srcdir)/$$f" "$(DESTDIR)$(strongswanddir)/$$name" || true; \
179 for f in $(plugins_install_src); do \
180 name=`basename $$f`; \
181 if test -f "$$f"; then dir=; else dir="$(srcdir)/"; fi; \
182 test -f "$(DESTDIR)$(charonconfdir)/$$name" || $(INSTALL) -m 644 "$$dir$$f" "$(DESTDIR)$(charonconfdir)/$$name" || true; \