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
13 options/charon-logging.opt \
24 plugins/android_log.opt \
26 plugins/attr-sql.opt \
27 plugins/certexpire.opt \
28 plugins/coupling.opt \
31 plugins/duplicheck.opt \
33 plugins/eap-aka-3ggp2.opt \
34 plugins/eap-dynamic.opt \
36 plugins/eap-peap.opt \
37 plugins/eap-radius.opt \
39 plugins/eap-simaka-sql.opt \
42 plugins/eap-ttls.opt \
43 plugins/error-notify.opt \
46 plugins/imc-attestation.opt \
48 plugins/imc-scanner.opt \
49 plugins/imc-swid.opt \
50 plugins/imc-test.opt \
51 plugins/imv-attestation.opt \
53 plugins/imv-scanner.opt \
54 plugins/imv-test.opt \
55 plugins/ipseckey.opt \
57 plugins/kernel-klips.opt \
58 plugins/kernel-libipsec.opt \
59 plugins/kernel-netlink.opt \
60 plugins/kernel-pfroute.opt \
61 plugins/load-tester.opt \
69 plugins/socket-default.opt \
72 plugins/systime-fix.opt \
73 plugins/tnc-ifmap.opt \
77 plugins/tnccs-11.opt \
78 plugins/tnccs-20.opt \
81 plugins/whitelist.opt \
82 plugins/xauth-eap.opt \
85 alloptions = $(options) $(plugins)
87 confsnippets = $(alloptions:opt=conf)
89 # we only install snippets for enabled plugins
90 plugins_install_tmp = $(charon_plugins:%=plugins/%.tmp)
91 plugins_install_src = $(charon_plugins:%=plugins/%.conf)
92 # only install snippets for enabled components
93 # has to be defined via autoconf as we can't do it with automake conditionals
94 options_install_src = $(strongswan_options:%=options/%.conf)
96 templates_DATA = strongswan.conf
97 optionstemplate_DATA = $(options_install_src)
98 pluginstemplate_DATA = $(plugins_install_src)
102 BUILT_SOURCES = default.conf strongswan.conf.5.main $(confsnippets)
103 EXTRA_DIST = format-options.py strongswan.conf default.opt \
104 default.conf strongswan.conf.5.main $(alloptions) $(confsnippets)
106 CLEANFILES=$(man_MANS)
113 -e "s:\@PLUGIN_NAME\@:`basename $< .opt`:" \
114 $(srcdir)/default.opt | cat - $< | \
115 $(PYTHON) $(srcdir)/format-options.py -f conf -r charon.plugins > $(srcdir)/$@ \
118 $(PYTHON) $(srcdir)/format-options.py -f conf -r charon.plugins $< > $(srcdir)/$@ \
122 # we need another implicit rule to generate files from the generic template only
123 # if the rules above did not catch it. this requires an intermediate step that
124 # generates a copy of the generic config template.
125 $(plugins_install_tmp):
126 @mkdir -p $(builddir)/plugins
127 @cp $(srcdir)/default.conf $(builddir)/$@
132 -e "s:\@PLUGIN_NAME\@:`basename $< .tmp`:" \
133 $(builddir)/$< > $(builddir)/$@
135 strongswan.conf.5.main: $(alloptions)
137 cd $(srcdir) && $(PYTHON) format-options.py -f man $(alloptions) > $@
139 strongswan.conf.5: strongswan.conf.5.head strongswan.conf.5.main strongswan.conf.5.tail
141 cat strongswan.conf.5.head $(srcdir)/strongswan.conf.5.main strongswan.conf.5.tail > $@
144 rm -f plugins/*.conf plugins/*.tmp
146 maintainer-clean-local:
148 rm -f $(confsnippets) default.conf plugins/*.conf plugins/*.tmp
150 install-data-local: $(plugins_install_src)
151 test -e "$(DESTDIR)${strongswanconfdir}" || $(INSTALL) -d "$(DESTDIR)$(strongswanconfdir)"
152 test -e "$(DESTDIR)${strongswanddir}" || $(INSTALL) -d "$(DESTDIR)$(strongswanddir)"
153 test -e "$(DESTDIR)${charonconfdir}" || $(INSTALL) -d "$(DESTDIR)$(charonconfdir)"
154 test -e "$(DESTDIR)$(strongswanconfdir)/strongswan.conf" || $(INSTALL) -m 644 $(srcdir)/strongswan.conf $(DESTDIR)$(strongswanconfdir)/strongswan.conf || true
155 for f in $(options_install_src); do \
156 name=`basename $$f`; \
157 test -f "$(DESTDIR)$(strongswanddir)/$$name" || $(INSTALL) -m 644 "$(srcdir)/$$f" "$(DESTDIR)$(strongswanddir)/$$name" || true; \
159 for f in $(plugins_install_src); do \
160 name=`basename $$f`; \
161 if test -f "$$f"; then dir=; else dir="$(srcdir)/"; fi; \
162 test -f "$(DESTDIR)$(charonconfdir)/$$name" || $(INSTALL) -m 644 "$$dir$$f" "$(DESTDIR)$(charonconfdir)/$$name" || true; \