1 # make this relative to the location of strongswan.conf
2 strongswanconfdir = `dirname $(strongswan_conf)`
3 strongswanddir = $(strongswanconfdir)/strongswan.d
4 charonconfdir = $(strongswanddir)/charon
12 alloptions = $(options) $(plugins)
14 confsnippets = $(alloptions:opt=conf)
16 # we only install snippets for enabled plugins
17 plugins_install_tmp = $(charon_plugins:%=plugins/%.tmp)
18 plugins_install_src = $(charon_plugins:%=plugins/%.conf)
20 strongswand_DATA = $(options:opt=conf)
21 charonconf_DATA = $(plugins_install_src)
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)
29 CLEANFILES=$(man_MANS)
36 -e "s:\@PLUGIN_NAME\@:`basename $< .opt`:" \
37 $(srcdir)/default.opt | cat - $< | \
38 $(PYTHON) $(srcdir)/format-options.py -f conf -r charon.plugins > $(srcdir)/$@ \
41 $(PYTHON) $(srcdir)/format-options.py -f conf -r charon.plugins $< > $(srcdir)/$@ \
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)/$@
54 -e "s:\@PLUGIN_NAME\@:`basename $< .tmp`:" \
55 $(srcdir)/$< > $(srcdir)/$@
57 strongswan.conf.5.main: $(alloptions)
59 $(PYTHON) $(srcdir)/format-options.py -f man $^ > $@
61 maintainer-clean-local:
63 rm -f $(confsnippets) default.conf plugins/*.conf plugins/*.tmp
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
70 chmod 0640 $(DESTDIR)$(strongswanddir)/*.conf
71 chmod 0640 $(DESTDIR)$(charonconfdir)/*.conf