wolfssl: Fixes, code style changes and some refactorings
[strongswan.git] / conf / Makefile.am
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
9
10 options = \
11         options/aikgen.opt \
12         options/attest.opt \
13         options/charon.opt \
14         options/charon-logging.opt \
15         options/charon-nm.opt \
16         options/charon-systemd.opt \
17         options/imcv.opt \
18         options/imv_policy_manager.opt \
19         options/manager.opt \
20         options/medsrv.opt \
21         options/pki.opt \
22         options/pool.opt \
23         options/scepclient.opt \
24         options/starter.opt \
25         options/swanctl.opt \
26         options/tnc.opt \
27         options/sec-updater.opt \
28         options/sw-collector.opt
29
30 plugins = \
31         plugins/addrblock.opt \
32         plugins/android_log.opt \
33         plugins/attr.opt \
34         plugins/attr-sql.opt \
35         plugins/bliss.opt \
36         plugins/bypass-lan.opt \
37         plugins/certexpire.opt \
38         plugins/coupling.opt \
39         plugins/curl.opt \
40         plugins/dhcp.opt \
41         plugins/dnscert.opt \
42         plugins/duplicheck.opt \
43         plugins/eap-aka.opt \
44         plugins/eap-aka-3gpp.opt \
45         plugins/eap-aka-3gpp2.opt \
46         plugins/eap-dynamic.opt \
47         plugins/eap-gtc.opt \
48         plugins/eap-peap.opt \
49         plugins/eap-radius.opt \
50         plugins/eap-sim.opt \
51         plugins/eap-simaka-sql.opt \
52         plugins/eap-tls.opt \
53         plugins/eap-tnc.opt \
54         plugins/eap-ttls.opt \
55         plugins/error-notify.opt \
56         plugins/ext-auth.opt \
57         plugins/forecast.opt \
58         plugins/gcrypt.opt \
59         plugins/ha.opt \
60         plugins/imc-attestation.opt \
61         plugins/imc-hcd.opt \
62         plugins/imc-os.opt \
63         plugins/imc-scanner.opt \
64         plugins/imc-swima.opt \
65         plugins/imc-test.opt \
66         plugins/imv-attestation.opt \
67         plugins/imv-os.opt \
68         plugins/imv-scanner.opt \
69         plugins/imv-swima.opt \
70         plugins/imv-test.opt \
71         plugins/ipseckey.opt \
72         plugins/led.opt \
73         plugins/kernel-libipsec.opt \
74         plugins/kernel-netlink.opt \
75         plugins/kernel-pfkey.opt \
76         plugins/kernel-pfroute.opt \
77         plugins/load-tester.opt \
78         plugins/lookip.opt \
79         plugins/ntru.opt \
80         plugins/openssl.opt \
81         plugins/osx-attr.opt \
82         plugins/p-cscf.opt \
83         plugins/pkcs11.opt \
84         plugins/radattr.opt \
85         plugins/random.opt \
86         plugins/resolve.opt \
87         plugins/revocation.opt \
88         plugins/save-keys.opt \
89         plugins/socket-default.opt \
90         plugins/sql.opt \
91         plugins/stroke.opt \
92         plugins/systime-fix.opt \
93         plugins/tnc-ifmap.opt \
94         plugins/tnc-imc.opt \
95         plugins/tnc-imv.opt \
96         plugins/tnc-pdp.opt \
97         plugins/tnccs-11.opt \
98         plugins/tnccs-20.opt \
99         plugins/tpm.opt \
100         plugins/unbound.opt \
101         plugins/updown.opt \
102         plugins/vici.opt \
103         plugins/whitelist.opt \
104         plugins/wolfssl.opt \
105         plugins/xauth-eap.opt \
106         plugins/xauth-pam.opt
107
108 alloptions = $(options) $(plugins)
109
110 confsnippets = $(alloptions:opt=conf)
111
112 # we only install snippets for enabled plugins
113 plugins_install_tmp = $(charon_plugins:%=plugins/%.tmp)
114 plugins_install_src = $(charon_plugins:%=plugins/%.conf)
115 # only install snippets for enabled components
116 # has to be defined via autoconf as we can't do it with automake conditionals
117 options_install_src = $(strongswan_options:%=options/%.conf)
118
119 templates_DATA = strongswan.conf
120 optionstemplate_DATA = $(options_install_src)
121 pluginstemplate_DATA = $(plugins_install_src)
122 man_MANS = \
123         strongswan.conf.5
124
125 BUILT_SOURCES = default.conf strongswan.conf.5.main $(confsnippets)
126 EXTRA_DIST = format-options.py strongswan.conf default.opt \
127         default.conf strongswan.conf.5.main $(alloptions) $(confsnippets)
128
129 CLEANFILES=$(man_MANS)
130
131 .opt.conf:
132         $(AM_V_GEN) \
133         case "$<" in \
134         *plugins/*) \
135                 sed \
136                 -e "s:\@PLUGIN_NAME\@:`basename $< .opt`:" \
137                 $(srcdir)/default.opt | cat - $< | \
138                 $(PYTHON) $(srcdir)/format-options.py -f conf -r charon.plugins > $(srcdir)/$@ \
139                 ;; \
140         *) \
141                 $(PYTHON) $(srcdir)/format-options.py -f conf -r charon.plugins $< > $(srcdir)/$@ \
142                 ;; \
143         esac
144
145 # we need another implicit rule to generate files from the generic template only
146 # if the rules above did not catch it.  this requires an intermediate step that
147 # generates a copy of the generic config template.
148 $(plugins_install_tmp):
149         @mkdir -p $(builddir)/plugins
150         @cp $(srcdir)/default.conf $(builddir)/$@
151
152 .tmp.conf:
153         $(AM_V_GEN) \
154         sed \
155         -e "s:\@PLUGIN_NAME\@:`basename $< .tmp`:" \
156         $(builddir)/$< > $(builddir)/$@
157
158 strongswan.conf.5.main: $(alloptions)
159         $(AM_V_GEN) \
160         cd $(srcdir) && $(PYTHON) format-options.py -f man $(alloptions) > $@
161
162 strongswan.conf.5: strongswan.conf.5.head strongswan.conf.5.main strongswan.conf.5.tail
163         $(AM_V_GEN) \
164         cat strongswan.conf.5.head $(srcdir)/strongswan.conf.5.main strongswan.conf.5.tail > $@
165
166 clean-local:
167         rm -f plugins/*.conf plugins/*.tmp
168
169 maintainer-clean-local:
170         cd $(srcdir) && \
171                 rm -f $(confsnippets) default.conf plugins/*.conf plugins/*.tmp
172
173 install-data-local: $(plugins_install_src)
174         test -e "$(DESTDIR)${strongswanconfdir}" || $(INSTALL) -d "$(DESTDIR)$(strongswanconfdir)" || true
175         test -e "$(DESTDIR)${strongswanddir}" || $(INSTALL) -d "$(DESTDIR)$(strongswanddir)" || true
176         test -e "$(DESTDIR)${charonconfdir}" || $(INSTALL) -d "$(DESTDIR)$(charonconfdir)" || true
177         test -e "$(DESTDIR)$(strongswan_conf)" || $(INSTALL) -m 644 $(srcdir)/strongswan.conf $(DESTDIR)$(strongswan_conf) || true
178         for f in $(options_install_src); do \
179                 name=`basename $$f`; \
180                 test -f "$(DESTDIR)$(strongswanddir)/$$name" || $(INSTALL) -m 644 "$(srcdir)/$$f" "$(DESTDIR)$(strongswanddir)/$$name" || true; \
181         done
182         for f in $(plugins_install_src); do \
183                 name=`basename $$f`; \
184                 if test -f "$$f"; then dir=; else dir="$(srcdir)/"; fi; \
185                 test -f "$(DESTDIR)$(charonconfdir)/$$name" || $(INSTALL) -m 644 "$$dir$$f" "$(DESTDIR)$(charonconfdir)/$$name" || true; \
186         done