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