Makefile.am 5.5 KB

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