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
15 options/charon-logging.opt \
16 options/charon-systemd.opt \
18 options/imv_policy_manager.opt \
24 options/scepclient.opt \
30 plugins/android_log.opt \
32 plugins/attr-sql.opt \
34 plugins/certexpire.opt \
35 plugins/coupling.opt \
38 plugins/duplicheck.opt \
40 plugins/eap-aka-3ggp2.opt \
41 plugins/eap-dynamic.opt \
43 plugins/eap-peap.opt \
44 plugins/eap-radius.opt \
46 plugins/eap-simaka-sql.opt \
49 plugins/eap-ttls.opt \
50 plugins/error-notify.opt \
51 plugins/ext-auth.opt \
52 plugins/forecast.opt \
55 plugins/imc-attestation.opt \
58 plugins/imc-scanner.opt \
59 plugins/imc-swid.opt \
60 plugins/imc-test.opt \
61 plugins/imv-attestation.opt \
63 plugins/imv-scanner.opt \
64 plugins/imv-swid.opt \
65 plugins/imv-test.opt \
66 plugins/ipseckey.opt \
68 plugins/kernel-libipsec.opt \
69 plugins/kernel-netlink.opt \
70 plugins/kernel-pfkey.opt \
71 plugins/kernel-pfroute.opt \
72 plugins/load-tester.opt \
76 plugins/osx-attr.opt \
82 plugins/socket-default.opt \
85 plugins/systime-fix.opt \
86 plugins/tnc-ifmap.opt \
90 plugins/tnccs-11.opt \
91 plugins/tnccs-20.opt \
95 plugins/whitelist.opt \
96 plugins/xauth-eap.opt \
99 alloptions = $(options) $(plugins)
101 confsnippets = $(alloptions:opt=conf)
103 # we only install snippets for enabled plugins
104 plugins_install_tmp = $(charon_plugins:%=plugins/%.tmp)
105 plugins_install_src = $(charon_plugins:%=plugins/%.conf)
106 # only install snippets for enabled components
107 # has to be defined via autoconf as we can't do it with automake conditionals
108 options_install_src = $(strongswan_options:%=options/%.conf)
110 templates_DATA = strongswan.conf
111 optionstemplate_DATA = $(options_install_src)
112 pluginstemplate_DATA = $(plugins_install_src)
116 BUILT_SOURCES = default.conf strongswan.conf.5.main $(confsnippets)
117 EXTRA_DIST = format-options.py strongswan.conf default.opt \
118 default.conf strongswan.conf.5.main $(alloptions) $(confsnippets)
120 CLEANFILES=$(man_MANS)
127 -e "s:\@PLUGIN_NAME\@:`basename $< .opt`:" \
128 $(srcdir)/default.opt | cat - $< | \
129 $(PYTHON) $(srcdir)/format-options.py -f conf -r charon.plugins > $(srcdir)/$@ \
132 $(PYTHON) $(srcdir)/format-options.py -f conf -r charon.plugins $< > $(srcdir)/$@ \
136 # we need another implicit rule to generate files from the generic template only
137 # if the rules above did not catch it. this requires an intermediate step that
138 # generates a copy of the generic config template.
139 $(plugins_install_tmp):
140 @mkdir -p $(builddir)/plugins
141 @cp $(srcdir)/default.conf $(builddir)/$@
146 -e "s:\@PLUGIN_NAME\@:`basename $< .tmp`:" \
147 $(builddir)/$< > $(builddir)/$@
149 strongswan.conf.5.main: $(alloptions)
151 cd $(srcdir) && $(PYTHON) format-options.py -f man $(alloptions) > $@
153 strongswan.conf.5: strongswan.conf.5.head strongswan.conf.5.main strongswan.conf.5.tail
155 cat strongswan.conf.5.head $(srcdir)/strongswan.conf.5.main strongswan.conf.5.tail > $@
158 rm -f plugins/*.conf plugins/*.tmp
160 maintainer-clean-local:
162 rm -f $(confsnippets) default.conf plugins/*.conf plugins/*.tmp
164 install-data-local: $(plugins_install_src)
165 test -e "$(DESTDIR)${strongswanconfdir}" || $(INSTALL) -d "$(DESTDIR)$(strongswanconfdir)" || true
166 test -e "$(DESTDIR)${strongswanddir}" || $(INSTALL) -d "$(DESTDIR)$(strongswanddir)" || true
167 test -e "$(DESTDIR)${charonconfdir}" || $(INSTALL) -d "$(DESTDIR)$(charonconfdir)" || true
168 test -e "$(DESTDIR)$(strongswanconfdir)/strongswan.conf" || $(INSTALL) -m 644 $(srcdir)/strongswan.conf $(DESTDIR)$(strongswanconfdir)/strongswan.conf || true
169 for f in $(options_install_src); do \
170 name=`basename $$f`; \
171 test -f "$(DESTDIR)$(strongswanddir)/$$name" || $(INSTALL) -m 644 "$(srcdir)/$$f" "$(DESTDIR)$(strongswanddir)/$$name" || true; \
173 for f in $(plugins_install_src); do \
174 name=`basename $$f`; \
175 if test -f "$$f"; then dir=; else dir="$(srcdir)/"; fi; \
176 test -f "$(DESTDIR)$(charonconfdir)/$$name" || $(INSTALL) -m 644 "$$dir$$f" "$(DESTDIR)$(charonconfdir)/$$name" || true; \