You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

494 lines
15 KiB

  1. #
  2. # Copyright (C) 2012-2015 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=strongswan
  9. PKG_VERSION:=5.3.2
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  12. PKG_SOURCE_URL:=http://download.strongswan.org/ http://download2.strongswan.org/
  13. PKG_MD5SUM:=fab014be1477ef4ebf9a765e10f8802c
  14. PKG_LICENSE:=GPL-2.0+
  15. PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
  16. PKG_MOD_AVAILABLE:= \
  17. addrblock \
  18. aes \
  19. af-alg \
  20. agent \
  21. attr \
  22. attr-sql \
  23. blowfish \
  24. ccm \
  25. cmac \
  26. constraints \
  27. coupling \
  28. ctr \
  29. curl \
  30. des \
  31. dhcp \
  32. dnskey \
  33. duplicheck \
  34. eap-identity \
  35. eap-md5 \
  36. eap-mschapv2 \
  37. eap-radius \
  38. farp \
  39. fips-prf \
  40. gcm \
  41. gcrypt \
  42. gmp \
  43. ha \
  44. hmac \
  45. kernel-libipsec \
  46. kernel-netlink \
  47. ldap \
  48. led \
  49. load-tester \
  50. nonce \
  51. md4 \
  52. md5 \
  53. mysql \
  54. openssl \
  55. pem \
  56. pgp \
  57. pkcs1 \
  58. pkcs8 \
  59. pkcs11 \
  60. pubkey \
  61. random \
  62. resolve \
  63. revocation \
  64. sha1 \
  65. sha2 \
  66. smp \
  67. socket-default \
  68. socket-dynamic \
  69. sql \
  70. sqlite \
  71. stroke \
  72. test-vectors \
  73. unity \
  74. uci \
  75. updown \
  76. whitelist \
  77. x509 \
  78. xauth-eap \
  79. xauth-generic \
  80. xcbc
  81. PKG_CONFIG_DEPENDS:= \
  82. CONFIG_STRONGSWAN_ROUTING_TABLE \
  83. CONFIG_STRONGSWAN_ROUTING_TABLE_PRIO \
  84. $(patsubst %,CONFIG_PACKAGE_strongswan-mod-%,$(PKG_MOD_AVAILABLE)) \
  85. PKG_FIXUP:=autoreconf
  86. PKG_INSTALL:=1
  87. PKG_BUILD_PARALLEL:=1
  88. include $(INCLUDE_DIR)/package.mk
  89. define Package/strongswan/Default
  90. SUBMENU:=VPN
  91. SECTION:=net
  92. CATEGORY:=Network
  93. TITLE:=StrongSwan
  94. URL:=http://www.strongswan.org/
  95. endef
  96. define Package/strongswan/description/Default
  97. StrongSwan is an OpenSource IPsec implementation for the Linux operating system.
  98. endef
  99. define Package/strongswan
  100. $(call Package/strongswan/Default)
  101. DEPENDS:= +libpthread +ip \
  102. +kmod-crypto-authenc \
  103. +kmod-ipsec +kmod-ipsec4 +kmod-ipsec6 \
  104. +kmod-ipt-ipsec +iptables-mod-ipsec
  105. endef
  106. define Package/strongswan/config
  107. source "$(SOURCE)/Config.in"
  108. endef
  109. define Package/strongswan/description
  110. $(call Package/strongswan/description/Default)
  111. This package contains shared libraries and scripts.
  112. endef
  113. define Package/strongswan-full
  114. $(call Package/strongswan/Default)
  115. TITLE+= (full)
  116. DEPENDS:= +strongswan \
  117. +strongswan-charon \
  118. +strongswan-mod-addrblock \
  119. +strongswan-mod-aes \
  120. +strongswan-mod-af-alg \
  121. +strongswan-mod-agent \
  122. +strongswan-mod-attr \
  123. +strongswan-mod-attr-sql \
  124. +strongswan-mod-blowfish \
  125. +strongswan-mod-ccm \
  126. +strongswan-mod-cmac \
  127. +strongswan-mod-constraints \
  128. +strongswan-mod-coupling \
  129. +strongswan-mod-ctr \
  130. +strongswan-mod-curl \
  131. +strongswan-mod-des \
  132. +strongswan-mod-dhcp \
  133. +strongswan-mod-dnskey \
  134. +strongswan-mod-duplicheck \
  135. +strongswan-mod-eap-identity \
  136. +strongswan-mod-eap-md5 \
  137. +strongswan-mod-eap-mschapv2 \
  138. +strongswan-mod-eap-radius \
  139. +strongswan-mod-farp \
  140. +strongswan-mod-fips-prf \
  141. +strongswan-mod-gcm \
  142. +strongswan-mod-gcrypt \
  143. +strongswan-mod-gmp \
  144. +strongswan-mod-ha \
  145. +strongswan-mod-hmac \
  146. +strongswan-mod-kernel-netlink \
  147. +strongswan-mod-ldap \
  148. +strongswan-mod-led \
  149. +strongswan-mod-load-tester \
  150. +strongswan-mod-nonce \
  151. +strongswan-mod-md4 \
  152. +strongswan-mod-md5 \
  153. +strongswan-mod-mysql \
  154. +strongswan-mod-openssl \
  155. +strongswan-mod-pem \
  156. +strongswan-mod-pgp \
  157. +strongswan-mod-pkcs1 \
  158. +strongswan-mod-pkcs8 \
  159. +strongswan-mod-pkcs11 \
  160. +strongswan-mod-pubkey \
  161. +strongswan-mod-random \
  162. +strongswan-mod-resolve \
  163. +strongswan-mod-revocation \
  164. +strongswan-mod-sha1 \
  165. +strongswan-mod-sha2 \
  166. +strongswan-mod-smp \
  167. +strongswan-mod-socket-default \
  168. +strongswan-mod-sql \
  169. +strongswan-mod-sqlite \
  170. +strongswan-mod-stroke \
  171. +strongswan-mod-test-vectors \
  172. +strongswan-mod-uci \
  173. +strongswan-mod-unity \
  174. +strongswan-mod-updown \
  175. +strongswan-mod-whitelist \
  176. +strongswan-mod-x509 \
  177. +strongswan-mod-xauth-eap \
  178. +strongswan-mod-xauth-generic \
  179. +strongswan-mod-xcbc \
  180. +strongswan-utils \
  181. @DEVEL
  182. endef
  183. define Package/strongswan-full/description
  184. $(call Package/strongswan/description/Default)
  185. This meta-package contains dependencies for all of the strongswan plugins
  186. except kernel-libipsec,
  187. socket-dynamic and which are ommitted in favor of the kernel-netlink and
  188. socket-default plugins.
  189. endef
  190. define Package/strongswan-default
  191. $(call Package/strongswan/Default)
  192. TITLE+= (default)
  193. DEPENDS:= +strongswan \
  194. +strongswan-charon \
  195. +strongswan-mod-aes \
  196. +strongswan-mod-attr \
  197. +strongswan-mod-constraints \
  198. +strongswan-mod-des \
  199. +strongswan-mod-dnskey \
  200. +strongswan-mod-fips-prf \
  201. +strongswan-mod-gmp \
  202. +strongswan-mod-hmac \
  203. +strongswan-mod-kernel-netlink \
  204. +strongswan-mod-md5 \
  205. +strongswan-mod-nonce \
  206. +strongswan-mod-pem \
  207. +strongswan-mod-pgp \
  208. +strongswan-mod-pkcs1 \
  209. +strongswan-mod-pubkey \
  210. +strongswan-mod-random \
  211. +strongswan-mod-resolve \
  212. +strongswan-mod-revocation \
  213. +strongswan-mod-sha1 \
  214. +strongswan-mod-sha2 \
  215. +strongswan-mod-socket-default \
  216. +strongswan-mod-stroke \
  217. +strongswan-mod-updown \
  218. +strongswan-mod-x509 \
  219. +strongswan-mod-xauth-generic \
  220. +strongswan-mod-xcbc \
  221. +strongswan-utils
  222. endef
  223. define Package/strongswan-default/description
  224. $(call Package/strongswan/description/Default)
  225. This meta-package contains only dependencies to match upstream defaults.
  226. endef
  227. define Package/strongswan-minimal
  228. $(call Package/strongswan/Default)
  229. TITLE+= (minimal)
  230. DEPENDS:= +strongswan \
  231. +strongswan-charon \
  232. +strongswan-mod-aes \
  233. +strongswan-mod-gmp \
  234. +strongswan-mod-hmac \
  235. +strongswan-mod-kernel-netlink \
  236. +strongswan-mod-nonce \
  237. +strongswan-mod-pubkey \
  238. +strongswan-mod-random \
  239. +strongswan-mod-sha1 \
  240. +strongswan-mod-socket-default \
  241. +strongswan-mod-stroke \
  242. +strongswan-mod-updown \
  243. +strongswan-mod-x509 \
  244. +strongswan-mod-xcbc
  245. endef
  246. define Package/strongswan-minimal/description
  247. $(call Package/strongswan/description/Default)
  248. This meta-package contains only dependencies for a minimal IKEv2 setup.
  249. endef
  250. define Package/strongswan-charon
  251. $(call Package/strongswan/Default)
  252. TITLE+= IKEv1/IKEv2 keying daemon
  253. DEPENDS:= +strongswan
  254. endef
  255. define Package/strongswan-charon/description
  256. $(call Package/strongswan/description/Default)
  257. This package contains charon, an IKEv2 keying daemon.
  258. endef
  259. define Package/strongswan-utils
  260. $(call Package/strongswan/Default)
  261. TITLE+= utilities
  262. DEPENDS:= +strongswan
  263. endef
  264. define Package/strongswan-utils/description
  265. $(call Package/strongswan/description/Default)
  266. This package contains the pki & scepclient utilities.
  267. endef
  268. define BuildPlugin
  269. define Package/strongswan-mod-$(1)
  270. $$(call Package/strongswan/Default)
  271. TITLE:= StrongSwan $(2) plugin
  272. DEPENDS:= +strongswan $(3)
  273. endef
  274. define Package/strongswan-mod-$(1)/install
  275. $(INSTALL_DIR) $$(1)/etc/strongswan.d/charon
  276. if [ -f $(PKG_INSTALL_DIR)/etc/strongswan.d/charon/$(1).conf ]; then \
  277. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/strongswan.d/charon/$(1).conf $$(1)/etc/strongswan.d/charon/; fi
  278. $(INSTALL_DIR) $$(1)/usr/lib/ipsec/plugins
  279. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/plugins/libstrongswan-$(1).so \
  280. $$(1)/usr/lib/ipsec/plugins/
  281. $(call Plugin/$(1)/install,$$(1))
  282. endef
  283. $$(eval $$(call BuildPackage,strongswan-mod-$(1)))
  284. endef
  285. CONFIGURE_ARGS+= \
  286. --disable-scripts \
  287. --disable-static \
  288. --disable-fast \
  289. --with-systemdsystemunitdir=no \
  290. $(if $(CONFIG_PACKAGE_strongswan-utils),--enable-pki --enable-scepclient,--disable-pki --disable-scepclient) \
  291. --with-random-device=/dev/random \
  292. --with-urandom-device=/dev/urandom \
  293. --with-routing-table="$(call qstrip,$(CONFIG_STRONGSWAN_ROUTING_TABLE))" \
  294. --with-routing-table-prio="$(call qstrip,$(CONFIG_STRONGSWAN_ROUTING_TABLE_PRIO))" \
  295. $(foreach m,$(PKG_MOD_AVAILABLE), \
  296. $(if $(CONFIG_PACKAGE_strongswan-mod-$(m)),--enable-$(m),--disable-$(m)) \
  297. )
  298. EXTRA_LDFLAGS+= -Wl,-rpath-link,$(STAGING_DIR)/usr/lib
  299. define Package/strongswan/conffiles
  300. /etc/ipsec.conf
  301. /etc/ipsec.secrets
  302. /etc/ipsec.user
  303. /etc/strongswan.conf
  304. endef
  305. define Package/strongswan/install
  306. $(INSTALL_DIR) $(1)/etc
  307. $(CP) $(PKG_INSTALL_DIR)/etc/strongswan.conf $(1)/etc/
  308. $(INSTALL_DIR) $(1)/usr/lib/ipsec
  309. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/{libstrongswan.so.*,libhydra.so.*} $(1)/usr/lib/ipsec/
  310. $(INSTALL_CONF) ./files/ipsec.secrets $(1)/etc/
  311. $(INSTALL_DIR) $(1)/etc/init.d
  312. $(INSTALL_BIN) ./files/ipsec.init $(1)/etc/init.d/ipsec
  313. endef
  314. define Package/strongswan-default/install
  315. true
  316. endef
  317. define Package/strongswan-full/install
  318. true
  319. endef
  320. define Package/strongswan-minimal/install
  321. true
  322. endef
  323. define Package/strongswan-charon/install
  324. $(INSTALL_DIR) $(1)/usr/lib/ipsec
  325. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ipsec/charon $(1)/usr/lib/ipsec/
  326. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/libcharon.so.* $(1)/usr/lib/ipsec/
  327. endef
  328. define Package/strongswan-utils/install
  329. $(INSTALL_DIR) $(1)/usr/sbin
  330. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ipsec $(1)/usr/sbin/
  331. $(INSTALL_DIR) $(1)/usr/bin
  332. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/pki $(1)/usr/bin/
  333. $(INSTALL_DIR) $(1)/usr/lib/ipsec
  334. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ipsec/scepclient $(1)/usr/lib/ipsec/
  335. endef
  336. define Plugin/duplicheck/install
  337. $(INSTALL_DIR) $(1)/usr/lib/ipsec/plugins
  338. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/duplicheck $(1)/usr/lib/ipsec/
  339. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/plugins/libstrongswan-duplicheck.so $(1)/usr/lib/ipsec/plugins/
  340. endef
  341. define Plugin/eap-radius/install
  342. $(INSTALL_DIR) $(1)/usr/lib/ipsec/plugins
  343. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/libradius.so.* $(1)/usr/lib/ipsec/
  344. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/plugins/libstrongswan-eap-radius.so $(1)/usr/lib/ipsec/plugins/
  345. endef
  346. define Plugin/attr-sql/install
  347. $(INSTALL_DIR) $(1)/usr/lib/ipsec
  348. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/pool $(1)/usr/lib/ipsec/
  349. endef
  350. define Plugin/stroke/install
  351. $(INSTALL_DIR) $(1)/etc/ipsec.d/aacerts
  352. $(INSTALL_DIR) $(1)/etc/ipsec.d/acerts
  353. $(INSTALL_DIR) $(1)/etc/ipsec.d/cacerts
  354. $(INSTALL_DIR) $(1)/etc/ipsec.d/certs
  355. $(INSTALL_DIR) $(1)/etc/ipsec.d/crls
  356. $(INSTALL_DIR) $(1)/etc/ipsec.d/ocspcerts
  357. $(INSTALL_DIR) $(1)/etc/ipsec.d/private
  358. $(INSTALL_DIR) $(1)/etc/ipsec.d/reqs
  359. $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/ipsec.conf $(1)/etc/
  360. $(INSTALL_DIR) $(1)/usr/lib/ipsec/plugins
  361. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ipsec/{starter,stroke} $(1)/usr/lib/ipsec/
  362. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/plugins/libstrongswan-stroke.so $(1)/usr/lib/ipsec/plugins/
  363. endef
  364. define Plugin/updown/install
  365. $(INSTALL_DIR) $(1)/usr/lib/ipsec/plugins
  366. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/_updown $(1)/usr/lib/ipsec/
  367. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/plugins/libstrongswan-updown.so $(1)/usr/lib/ipsec/plugins/
  368. $(INSTALL_DIR) $(1)/etc
  369. $(INSTALL_CONF) ./files/ipsec.user $(1)/etc/
  370. endef
  371. define Plugin/whitelist/install
  372. $(INSTALL_DIR) $(1)/usr/lib/ipsec/plugins
  373. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/whitelist $(1)/usr/lib/ipsec/
  374. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/plugins/libstrongswan-whitelist.so $(1)/usr/lib/ipsec/plugins/
  375. endef
  376. define Plugin/kernel-libipsec/install
  377. $(INSTALL_DIR) $(1)/usr/lib/ipsec
  378. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/libipsec.so.* $(1)/usr/lib/ipsec/
  379. endef
  380. $(eval $(call BuildPackage,strongswan))
  381. $(eval $(call BuildPackage,strongswan-default))
  382. $(eval $(call BuildPackage,strongswan-full))
  383. $(eval $(call BuildPackage,strongswan-minimal))
  384. $(eval $(call BuildPackage,strongswan-charon))
  385. $(eval $(call BuildPackage,strongswan-utils))
  386. $(eval $(call BuildPlugin,addrblock,RFC 3779 address block constraint support,))
  387. $(eval $(call BuildPlugin,aes,AES crypto,))
  388. $(eval $(call BuildPlugin,af-alg,AF_ALG crypto interface to Linux Crypto API,+kmod-crypto-user))
  389. $(eval $(call BuildPlugin,agent,SSH agent signing,))
  390. $(eval $(call BuildPlugin,attr,file based config,))
  391. $(eval $(call BuildPlugin,attr-sql,SQL based config,+strongswan-charon))
  392. $(eval $(call BuildPlugin,blowfish,Blowfish crypto,))
  393. $(eval $(call BuildPlugin,ccm,CCM AEAD wrapper crypto,))
  394. $(eval $(call BuildPlugin,cmac,CMAC crypto,))
  395. $(eval $(call BuildPlugin,constraints,advanced X509 constraint checking,))
  396. $(eval $(call BuildPlugin,coupling,IKEv2 plugin to couple peer certificates permanently to authentication,))
  397. $(eval $(call BuildPlugin,ctr,Counter Mode wrapper crypto,))
  398. $(eval $(call BuildPlugin,curl,cURL fetcher plugin,+PACKAGE_strongswan-mod-curl:libcurl))
  399. $(eval $(call BuildPlugin,des,DES crypto,))
  400. $(eval $(call BuildPlugin,dhcp,DHCP based attribute provider,))
  401. $(eval $(call BuildPlugin,dnskey,DNS RR key decoding,))
  402. $(eval $(call BuildPlugin,duplicheck,advanced duplicate checking,))
  403. $(eval $(call BuildPlugin,eap-identity,EAP identity helper,))
  404. $(eval $(call BuildPlugin,eap-md5,EAP MD5 (CHAP) EAP auth,))
  405. $(eval $(call BuildPlugin,eap-mschapv2,EAP MS-CHAPv2 EAP auth,+strongswan-mod-md4 +strongswan-mod-des))
  406. $(eval $(call BuildPlugin,eap-radius,EAP RADIUS auth,))
  407. $(eval $(call BuildPlugin,farp,fake arp respsonses,))
  408. $(eval $(call BuildPlugin,fips-prf,FIPS PRF crypto,+strongswan-mod-sha1))
  409. $(eval $(call BuildPlugin,gcm,GCM AEAD wrapper crypto,))
  410. $(eval $(call BuildPlugin,gcrypt,libgcrypt,+PACKAGE_strongswan-mod-gcrypt:libgcrypt))
  411. $(eval $(call BuildPlugin,gmp,libgmp,+PACKAGE_strongswan-mod-gmp:libgmp))
  412. $(eval $(call BuildPlugin,ha,high availability cluster,))
  413. $(eval $(call BuildPlugin,hmac,HMAC crypto,))
  414. $(eval $(call BuildPlugin,kernel-libipsec,libipsec kernel interface,))
  415. $(eval $(call BuildPlugin,kernel-netlink,netlink kernel interface,))
  416. $(eval $(call BuildPlugin,ldap,LDAP,+PACKAGE_strongswan-mod-ldap:libopenldap))
  417. $(eval $(call BuildPlugin,led,LED blink on IKE activity,))
  418. $(eval $(call BuildPlugin,load-tester,load testing,))
  419. $(eval $(call BuildPlugin,nonce,nonce genereation,))
  420. $(eval $(call BuildPlugin,md4,MD4 crypto,))
  421. $(eval $(call BuildPlugin,md5,MD5 crypto,))
  422. $(eval $(call BuildPlugin,mysql,MySQL database interface,+strongswan-mod-sql +PACKAGE_strongswan-mod-mysql:libmysqlclient-r))
  423. $(eval $(call BuildPlugin,openssl,OpenSSL crypto,+PACKAGE_strongswan-mod-openssl:libopenssl))
  424. $(eval $(call BuildPlugin,pem,PEM decoding,))
  425. $(eval $(call BuildPlugin,pgp,PGP key decoding,))
  426. $(eval $(call BuildPlugin,pkcs1,PKCS1 key decoding,))
  427. $(eval $(call BuildPlugin,pkcs8,PKCS8 key decoding,))
  428. $(eval $(call BuildPlugin,pkcs11,PKCS11 key decoding,))
  429. $(eval $(call BuildPlugin,pubkey,raw public key,))
  430. $(eval $(call BuildPlugin,random,RNG,))
  431. $(eval $(call BuildPlugin,resolve,DNS resolver,))
  432. $(eval $(call BuildPlugin,revocation,X509 CRL/OCSP revocation,))
  433. $(eval $(call BuildPlugin,sha1,SHA1 crypto,))
  434. $(eval $(call BuildPlugin,sha2,SHA2 crypto,))
  435. $(eval $(call BuildPlugin,smp,SMP configuration and control interface,+PACKAGE_strongswan-mod-smp:libxml2))
  436. $(eval $(call BuildPlugin,socket-default,default socket implementation for charon,))
  437. $(eval $(call BuildPlugin,socket-dynamic,dynamic socket implementation for charon,))
  438. $(eval $(call BuildPlugin,sql,SQL database interface,))
  439. $(eval $(call BuildPlugin,sqlite,SQLite database interface,+strongswan-mod-sql +PACKAGE_strongswan-mod-sqlite:libsqlite3))
  440. $(eval $(call BuildPlugin,stroke,Stroke,+strongswan-utils))
  441. $(eval $(call BuildPlugin,test-vectors,crypto test vectors,))
  442. $(eval $(call BuildPlugin,uci,UCI config interface,+PACKAGE_strongswan-mod-uci:libuci))
  443. $(eval $(call BuildPlugin,unity,Cisco Unity extension,))
  444. $(eval $(call BuildPlugin,updown,updown firewall,))
  445. $(eval $(call BuildPlugin,whitelist,peer identity whitelisting,))
  446. $(eval $(call BuildPlugin,x509,x509 certificate,))
  447. $(eval $(call BuildPlugin,xauth-eap,EAP XAuth backend,))
  448. $(eval $(call BuildPlugin,xauth-generic,generic XAuth backend,))
  449. $(eval $(call BuildPlugin,xcbc,xcbc crypto,))