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
12 options/charon-logging.opt \
18 plugins/android_log.opt \
20 plugins/attr-sql.opt \
21 plugins/certexpire.opt \
22 plugins/coupling.opt \
25 plugins/duplicheck.opt \
27 plugins/eap-aka-3ggp2.opt \
28 plugins/eap-dynamic.opt \
30 plugins/eap-peap.opt \
31 plugins/eap-radius.opt \
33 plugins/eap-simaka-sql.opt \
36 plugins/eap-ttls.opt \
37 plugins/error-notify.opt \
41 plugins/imc-scanner.opt \
42 plugins/imc-test.opt \
44 plugins/imv-scanner.opt \
45 plugins/imv-test.opt \
46 plugins/ipseckey.opt \
48 plugins/kernel-klips.opt \
49 plugins/kernel-libipsec.opt \
50 plugins/kernel-netlink.opt \
51 plugins/kernel-pfroute.opt \
52 plugins/load-tester.opt \
60 plugins/socket-default.opt \
63 plugins/systime-fix.opt \
64 plugins/tnc-ifmap.opt \
68 plugins/tnccs-11.opt \
69 plugins/tnccs-20.opt \
72 plugins/whitelist.opt \
73 plugins/xauth-eap.opt \
76 alloptions = $(options) $(plugins)
78 confsnippets = $(alloptions:opt=conf)
80 # we only install snippets for enabled plugins
81 plugins_install_tmp = $(charon_plugins:%=plugins/%.tmp)
82 plugins_install_src = $(charon_plugins:%=plugins/%.conf)
84 options_install_src = $(options:opt=conf)
86 templates_DATA = strongswan.conf
87 optionstemplate_DATA = $(options_install_src)
88 pluginstemplate_DATA = $(plugins_install_src)
92 BUILT_SOURCES = default.conf strongswan.conf.5.main $(confsnippets)
93 EXTRA_DIST = format-options.py strongswan.conf default.opt \
94 default.conf strongswan.conf.5.main $(alloptions) $(confsnippets)
96 CLEANFILES=$(man_MANS)
103 -e "s:\@PLUGIN_NAME\@:`basename $< .opt`:" \
104 $(srcdir)/default.opt | cat - $< | \
105 $(PYTHON) $(srcdir)/format-options.py -f conf -r charon.plugins > $(srcdir)/$@ \
108 $(PYTHON) $(srcdir)/format-options.py -f conf -r charon.plugins $< > $(srcdir)/$@ \
112 # we need another implicit rule to generate files from the generic template only
113 # if the rules above did not catch it. this requires an intermediate step that
114 # generates a copy of the generic config template.
115 $(plugins_install_tmp):
116 @mkdir -p $(builddir)/plugins
117 @cp $(srcdir)/default.conf $(builddir)/$@
122 -e "s:\@PLUGIN_NAME\@:`basename $< .tmp`:" \
123 $(builddir)/$< > $(builddir)/$@
125 strongswan.conf.5.main: $(alloptions)
127 $(PYTHON) $(srcdir)/format-options.py -f man $^ > $@
129 strongswan.conf.5: strongswan.conf.5.head strongswan.conf.5.main strongswan.conf.5.tail
134 rm -f plugins/*.conf plugins/*.tmp
136 maintainer-clean-local:
138 rm -f $(confsnippets) default.conf plugins/*.conf plugins/*.tmp
140 install-data-local: $(plugins_install_src)
141 test -e "$(DESTDIR)${strongswanconfdir}" || $(INSTALL) -d "$(DESTDIR)$(strongswanconfdir)"
142 test -e "$(DESTDIR)${strongswanddir}" || $(INSTALL) -d "$(DESTDIR)$(strongswanddir)"
143 test -e "$(DESTDIR)${charonconfdir}" || $(INSTALL) -d "$(DESTDIR)$(charonconfdir)"
144 test -e "$(DESTDIR)$(strongswanconfdir)/strongswan.conf" || $(INSTALL) -m 640 $(srcdir)/strongswan.conf $(DESTDIR)$(strongswanconfdir)/strongswan.conf || true
145 for f in $(options_install_src); do \
146 name=`basename $$f`; \
147 test -f "$(DESTDIR)$(strongswanddir)/$$name" || $(INSTALL) -m 640 -t "$(DESTDIR)$(strongswanddir)" $(srcdir)/$$f || true; \
149 for f in $(plugins_install_src); do \
150 name=`basename $$f`; \
151 if test -f "$$f"; then dir=; else dir="$(srcdir)/"; fi; \
152 test -f "$(DESTDIR)$(charonconfdir)/$$name" || $(INSTALL) -m 640 -t "$(DESTDIR)$(charonconfdir)" "$$dir$$f" || true; \