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