]> git.ipfire.org Git - thirdparty/strongswan.git/blob - conf/Makefile.am
conf: Generate groff snippet for configuration options
[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
6 options = \
7 options/charon.opt
8
9 plugins = \
10 plugins/test.opt
11
12 alloptions = $(options) $(plugins)
13
14 confsnippets = $(alloptions:opt=conf)
15
16 # we only install snippets for enabled plugins
17 plugins_install_tmp = $(charon_plugins:%=plugins/%.tmp)
18 plugins_install_src = $(charon_plugins:%=plugins/%.conf)
19
20 strongswand_DATA = $(options:opt=conf)
21 charonconf_DATA = $(plugins_install_src)
22 man_MANS = \
23 strongswan.conf.5
24
25 BUILT_SOURCES = default.conf strongswan.conf.5.main $(confsnippets)
26 EXTRA_DIST = format-options.py strongswan.conf default.opt \
27 default.conf strongswan.conf.5.main $(alloptions) $(confsnippets)
28
29 CLEANFILES=$(man_MANS)
30
31 .opt.conf:
32 $(AM_V_GEN) \
33 case "$<" in \
34 *plugins/*) \
35 sed \
36 -e "s:\@PLUGIN_NAME\@:`basename $< .opt`:" \
37 $(srcdir)/default.opt | cat - $< | \
38 $(PYTHON) $(srcdir)/format-options.py -f conf -r charon.plugins > $(srcdir)/$@ \
39 ;; \
40 *) \
41 $(PYTHON) $(srcdir)/format-options.py -f conf -r charon.plugins $< > $(srcdir)/$@ \
42 ;; \
43 esac
44
45 # we need another implicit rule to generate files from the generic template only
46 # if the rules above did not catch it. this requires an intermediate step that
47 # generates a copy of the generic config template.
48 $(plugins_install_tmp):
49 @cp $(srcdir)/default.conf $(srcdir)/$@
50
51 .tmp.conf:
52 $(AM_V_GEN) \
53 sed \
54 -e "s:\@PLUGIN_NAME\@:`basename $< .tmp`:" \
55 $(srcdir)/$< > $(srcdir)/$@
56
57 strongswan.conf.5.main: $(alloptions)
58 $(AM_V_GEN) \
59 $(PYTHON) $(srcdir)/format-options.py -f man $^ > $@
60
61 maintainer-clean-local:
62 cd $(srcdir) && \
63 rm -f $(confsnippets) default.conf plugins/*.conf plugins/*.tmp
64
65 install-exec-local:
66 test -e "$(DESTDIR)${strongswanconfdir}" || $(INSTALL) -d "$(DESTDIR)$(strongswanconfdir)"
67 test -e "$(DESTDIR)$(strongswanconfdir)/strongswan.conf" || $(INSTALL) -m 640 $(srcdir)/strongswan.conf $(DESTDIR)$(strongswanconfdir)/strongswan.conf || true
68
69 install-data-hook:
70 chmod 0640 $(DESTDIR)$(strongswanddir)/*.conf
71 chmod 0640 $(DESTDIR)$(charonconfdir)/*.conf