aaf0d667348b218aed8ffb0d05210c395f0b4c88
[openwrt/svn-archive/archive.git] / net / strongswan4 / Makefile
1 #
2 # Copyright (C) 2010 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=strongswan
11 PKG_VERSION:=4.3.6
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=http://download.strongswan.org/
16 PKG_MD5SUM:=e071f46b6c463ce76900758734e6143e
17
18 PKG_MOD_AVAILABLE:= \
19 aes \
20 agent \
21 attr \
22 attr-sql \
23 blowfish \
24 curl \
25 des \
26 dnskey \
27 eap-md5 \
28 eap-mschapv2 \
29 eap-radius \
30 fips-prf \
31 gcrypt \
32 gmp \
33 hmac \
34 kernel-klips \
35 kernel-netlink \
36 kernel-pfkey \
37 ldap \
38 load-tester \
39 md5 \
40 medcli \
41 medsrv \
42 mysql \
43 padlock \
44 pem \
45 pgp \
46 pkcs1 \
47 pubkey \
48 random \
49 resolve \
50 sha1 \
51 sha2 \
52 smp \
53 sql \
54 sqlite \
55 stroke \
56 uci \
57 updown \
58 x509 \
59 xcbc \
60
61 PKG_BUILD_DEPENDS:= \
62 clearsilver \
63 fcgi \
64
65 PKG_CONFIG_DEPENDS:= \
66 CONFIG_STRONGSWAN4_ENABLE_CISCO_QUIRKS \
67 CONFIG_STRONGSWAN4_ENABLE_NAT_TRANSPORT \
68 CONFIG_STRONGSWAN4_DEVICE_RANDOM \
69 CONFIG_STRONGSWAN4_DEVICE_URANDOM \
70 CONFIG_STRONGSWAN4_ROUTING_TABLE \
71 CONFIG_STRONGSWAN4_ROUTING_TABLE_PRIO \
72 $(patsubst %,CONFIG_PACKAGE_strongswan4-mod-%,$(PKG_MOD_AVAILABLE)) \
73
74 PKG_FIXUP:=libtool
75 PKG_INSTALL:=1
76
77 include $(INCLUDE_DIR)/package.mk
78
79
80 define Package/strongswan4/Default
81 SECTION:=net
82 CATEGORY:=Network
83 TITLE:=StrongSwan
84 URL:=http://www.strongswan.org/
85 endef
86
87 define Package/strongswan4/description/Default
88 StrongSwan is an OpenSource IPsec implementation for the Linux
89 operating system.
90 endef
91
92
93 define Package/strongswan4
94 $(call Package/strongswan4/Default)
95 DEPENDS:= +libpthread +ip \
96 +kmod-ipsec +kmod-ipsec4 \
97 +kmod-ipt-ipsec +iptables-mod-ipsec
98 MENU:=1
99 endef
100
101 define Package/strongswan4/config
102 source "$(SOURCE)/Config.in"
103 endef
104
105 define Package/strongswan4/description
106 $(call Package/strongswan4/description/Default)
107 .
108 This package contains shared libraries and scripts.
109 endef
110
111
112 define Package/strongswan4-full
113 $(call Package/strongswan4/Default)
114 TITLE+= (full)
115 DEPENDS:= strongswan4 \
116 +strongswan4-app-charon \
117 +strongswan4-app-pluto \
118 +strongswan4-mod-aes \
119 +strongswan4-mod-agent \
120 +strongswan4-mod-attr \
121 +strongswan4-mod-attr-sql \
122 +strongswan4-mod-blowfish \
123 +strongswan4-mod-curl \
124 +strongswan4-mod-des \
125 +strongswan4-mod-dnskey \
126 +strongswan4-mod-eap-md5 \
127 +strongswan4-mod-eap-mschapv2 \
128 +strongswan4-mod-eap-radius \
129 +strongswan4-mod-fips-prf \
130 +strongswan4-mod-gcrypt \
131 +strongswan4-mod-gmp \
132 +strongswan4-mod-hmac \
133 +strongswan4-mod-kernel-klips \
134 +strongswan4-mod-kernel-netlink \
135 +strongswan4-mod-kernel-pfkey \
136 +strongswan4-mod-ldap \
137 +strongswan4-mod-load-tester \
138 +strongswan4-mod-md5 \
139 +strongswan4-mod-medcli \
140 +strongswan4-mod-medsrv \
141 +strongswan4-mod-mysql \
142 +strongswan4-mod-padlock \
143 +strongswan4-mod-pem \
144 +strongswan4-mod-pgp \
145 +strongswan4-mod-pkcs1 \
146 +strongswan4-mod-pubkey \
147 +strongswan4-mod-random \
148 +strongswan4-mod-resolve \
149 +strongswan4-mod-sha1 \
150 +strongswan4-mod-sha2 \
151 +strongswan4-mod-smp \
152 +strongswan4-mod-sql \
153 +strongswan4-mod-sqlite \
154 +strongswan4-mod-stroke \
155 +strongswan4-mod-uci \
156 +strongswan4-mod-updown \
157 +strongswan4-mod-x509 \
158 +strongswan4-mod-xcbc \
159 +strongswan4-utils
160 endef
161
162 define Package/strongswan4-full/description
163 $(call Package/strongswan4/description/Default)
164 .
165 This meta-package contains only dependencies for a complete setup.
166 endef
167
168
169 define Package/strongswan4-minimal
170 $(call Package/strongswan4/Default)
171 TITLE+= (minimal)
172 DEPENDS:= strongswan4 \
173 +strongswan4-app-charon \
174 +strongswan4-mod-aes \
175 +strongswan4-mod-gmp \
176 +strongswan4-mod-hmac \
177 +strongswan4-mod-pubkey \
178 +strongswan4-mod-random \
179 +strongswan4-mod-sha1 \
180 +strongswan4-mod-stroke \
181 +strongswan4-mod-updown \
182 +strongswan4-mod-x509 \
183 +strongswan4-mod-xcbc
184 endef
185
186 define Package/strongswan4-minimal/description
187 $(call Package/strongswan4/description/Default)
188 .
189 This meta-package contains only dependencies for a minimal setup.
190 endef
191
192
193 define Package/strongswan4-app-charon
194 $(call Package/strongswan4/Default)
195 TITLE+= IKEv2 keying daemon
196 DEPENDS:= strongswan4
197 endef
198
199 define Package/strongswan4-app-charon/description
200 $(call Package/strongswan4/description/Default)
201 .
202 This package contains charon, an IKEv2 keying daemon.
203 endef
204
205
206 define Package/strongswan4-app-pluto
207 $(call Package/strongswan4/Default)
208 TITLE+= IKEv1 keying daemon
209 DEPENDS:= strongswan4
210 endef
211
212 define Package/strongswan4-app-pluto/description
213 $(call Package/strongswan4/description/Default)
214 .
215 This package contains pluto, an IKEv1 keying daemon.
216 endef
217
218
219 define Package/strongswan4-utils
220 $(call Package/strongswan4/Default)
221 TITLE+= utilities
222 DEPENDS:= strongswan4
223 endef
224
225 define Package/strongswan4-utils/description
226 $(call Package/strongswan4/description/Default)
227 .
228 This package contains the openac, pki & scepclient utilities.
229 endef
230
231
232 # 1. Name
233 # 2. Title
234 # 3. Depends
235 define BuildPlugin
236 define Package/strongswan4-mod-$(1)
237 $$(call Package/strongswan4/Default)
238 TITLE:= StronSwan $(2) plugin
239 DEPENDS:= strongswan4 $(3)
240 endef
241
242 define Package/strongswan4-mod-$(1)/install
243 $(INSTALL_DIR) $$(1)/usr/lib/ipsec/plugins
244 $(CP) \
245 $(PKG_INSTALL_DIR)/usr/lib/ipsec/plugins/libstrongswan-$(1).so \
246 $$(1)/usr/lib/ipsec/plugins/ ;
247 $(call Plugin/$(1)/install,$$(1))
248 endef
249
250 $$(eval $$(call BuildPackage,strongswan4-mod-$(1)))
251 endef
252
253
254 CONFIGURE_ARGS+= \
255 $(if $(CONFIG_STRONGSWAN4_ENABLE_CISCO_QUIRKS),--enable-cisco-quirks,--disable-cisco-quirks) \
256 $(if $(CONFIG_STRONGSWAN4_ENABLE_NAT_TRANSPORT),--enable-nat-transport,--disable-nat-transport) \
257 --disable-scripts \
258 --disable-static \
259 $(if $(CONFIG_PACKAGE_strongswan4-utils),--enable-tools,--disable-tools) \
260 --with-random-device="$(call qstrip,$(CONFIG_STRONGSWAN4_DEVICE_RANDOM))" \
261 --with-urandom-device="$(call qstrip,$(CONFIG_STRONGSWAN4_DEVICE_RANDOM))" \
262 --with-routing-table="$(call qstrip,$(CONFIG_STRONGSWAN4_ROUTING_TABLE))" \
263 --with-routing-table-prio="$(call qstrip,$(CONFIG_STRONGSWAN4_ROUTING_TABLE_PRIO))" \
264 $(foreach m,$(PKG_MOD_AVAILABLE), \
265 $(if $(CONFIG_PACKAGE_strongswan4-mod-$(m)),--enable-$(m),--disable-$(m)) \
266 ) \
267
268 EXTRA_CPPFLAGS+= -I$(STAGING_DIR)/usr/include/ClearSilver
269
270 EXTRA_LDFLAGS+= -Wl,-rpath-link,$(STAGING_DIR)/usr/lib
271
272
273 define Package/strongswan4/conffiles
274 /etc/ipsec.conf
275 /etc/ipsec.secrets
276 /etc/strongswan.conf
277 endef
278
279 define Package/strongswan4/install
280 $(INSTALL_DIR) $(1)/etc
281 $(CP) -R $(PKG_INSTALL_DIR)/etc/ipsec.d $(1)/etc/
282 $(INSTALL_DIR) $(1)/usr/lib
283 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libstrongswan.so.* $(1)/usr/lib/
284 $(INSTALL_DIR) $(1)/usr/sbin
285 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/ipsec $(1)/usr/sbin/
286 $(INSTALL_DIR) $(1)/usr/lib/ipsec
287 $(CP) \
288 $(PKG_INSTALL_DIR)/usr/lib/ipsec/_copyright \
289 $(PKG_INSTALL_DIR)/usr/lib/ipsec/starter \
290 $(PKG_INSTALL_DIR)/usr/lib/ipsec/whack \
291 $(1)/usr/lib/ipsec/
292 $(INSTALL_CONF) \
293 ./files/ipsec.conf \
294 ./files/ipsec.secrets \
295 ./files/strongswan.conf \
296 $(1)/etc/
297 endef
298
299
300 define Package/strongswan4-full/install
301 true
302 endef
303
304
305 define Package/strongswan4-minimal/install
306 true
307 endef
308
309
310 define Package/strongswan4-app-charon/install
311 $(INSTALL_DIR) $(1)/usr/lib/ipsec
312 $(CP) \
313 $(PKG_INSTALL_DIR)/usr/lib/ipsec/charon \
314 $(PKG_INSTALL_DIR)/usr/lib/ipsec/stroke \
315 $(1)/usr/lib/ipsec/
316 endef
317
318
319 define Package/strongswan4-app-pluto/install
320 $(INSTALL_DIR) $(1)/usr/lib/ipsec
321 $(CP) \
322 $(PKG_INSTALL_DIR)/usr/lib/ipsec/pluto \
323 $(PKG_INSTALL_DIR)/usr/lib/ipsec/_pluto_adns \
324 $(1)/usr/lib/ipsec/
325 endef
326
327
328 define Package/strongswan4-utils/install
329 $(INSTALL_DIR) $(1)/usr/lib/ipsec
330 $(CP) \
331 $(PKG_INSTALL_DIR)/usr/lib/ipsec/openac \
332 $(PKG_INSTALL_DIR)/usr/lib/ipsec/pki \
333 $(PKG_INSTALL_DIR)/usr/lib/ipsec/scepclient \
334 $(1)/usr/lib/ipsec/
335 endef
336
337
338 define Plugin/attr-sql/install
339 $(INSTALL_DIR) $(1)/usr/lib/ipsec
340 $(CP) \
341 $(PKG_INSTALL_DIR)/usr/lib/ipsec/pool \
342 $(1)/usr/lib/ipsec/
343 endef
344
345 define Plugin/updown/install
346 $(INSTALL_DIR) $(1)/usr/lib/ipsec
347 $(CP) \
348 $(PKG_INSTALL_DIR)/usr/lib/ipsec/_updown \
349 $(PKG_INSTALL_DIR)/usr/lib/ipsec/_updown_espmark \
350 $(1)/usr/lib/ipsec/
351 endef
352
353
354 $(eval $(call BuildPackage,strongswan4))
355 $(eval $(call BuildPackage,strongswan4-full))
356 $(eval $(call BuildPackage,strongswan4-minimal))
357 $(eval $(call BuildPackage,strongswan4-app-charon))
358 $(eval $(call BuildPackage,strongswan4-app-pluto))
359 $(eval $(call BuildPackage,strongswan4-utils))
360
361 $(eval $(call BuildPlugin,aes,AES crypto,))
362 $(eval $(call BuildPlugin,agent,SSH agent signing,))
363 $(eval $(call BuildPlugin,attr,File-based config attr,))
364 $(eval $(call BuildPlugin,attr-sql,SQL-based config attrib,+strongswan4-mod-sql))
365 $(eval $(call BuildPlugin,blowfish,Blowfish crypto,))
366 $(eval $(call BuildPlugin,curl,cURL,+libcurl))
367 $(eval $(call BuildPlugin,des,DES crypto,))
368 $(eval $(call BuildPlugin,dnskey,DNS RR key decoding,))
369 $(eval $(call BuildPlugin,eap-md5,MD5 EAP (CHAP) auth,))
370 $(eval $(call BuildPlugin,eap-mschapv2,MS-CHAPv2 EAP auth,))
371 $(eval $(call BuildPlugin,eap-radius,RADIUS proxy auth,))
372 $(eval $(call BuildPlugin,fips-prf,FIPS PRF crypto,))
373 $(eval $(call BuildPlugin,gcrypt,libgcrypt,+libgcrypt))
374 $(eval $(call BuildPlugin,gmp,libgmp,+libgmp))
375 $(eval $(call BuildPlugin,hmac,HMAC crypto,))
376 $(eval $(call BuildPlugin,kernel-klips,KLIPS kernel interface,))
377 $(eval $(call BuildPlugin,kernel-netlink,netlink kernel interface,))
378 $(eval $(call BuildPlugin,kernel-pfkey,PK_KEY kernel interface,))
379 $(eval $(call BuildPlugin,ldap,LDAP,+libopenldap))
380 $(eval $(call BuildPlugin,load-tester,load testing,))
381 $(eval $(call BuildPlugin,md5,MD5 crypto,))
382 $(eval $(call BuildPlugin,medcli,mediation client configuration database,))
383 $(eval $(call BuildPlugin,medsrv,mediation server configuration database,))
384 $(eval $(call BuildPlugin,mysql,MySQL database interface,+strongswan4-mod-sql +libmysqlclient))
385 $(eval $(call BuildPlugin,padlock,VIA PadLock crypto,))
386 $(eval $(call BuildPlugin,pem,PEM decoding,))
387 $(eval $(call BuildPlugin,pgp,PGP key decoding,))
388 $(eval $(call BuildPlugin,pkcs1,PKCS1 key decoding,))
389 $(eval $(call BuildPlugin,pubkey,raw public key,))
390 $(eval $(call BuildPlugin,random,RNG,))
391 $(eval $(call BuildPlugin,resolve,DNS resolver,))
392 $(eval $(call BuildPlugin,sha1,SHA1 crypto,))
393 $(eval $(call BuildPlugin,sha2,SHA2 crypto,))
394 $(eval $(call BuildPlugin,smp,SMP configuration and control interface,+libxml2))
395 $(eval $(call BuildPlugin,sql,SQL database interface,))
396 $(eval $(call BuildPlugin,sqlite,SQLite database interface,+strongswan4-mod-sql +libsqlite3))
397 $(eval $(call BuildPlugin,stroke,Stroke,))
398 $(eval $(call BuildPlugin,uci,UCI config interface,+libuci))
399 $(eval $(call BuildPlugin,updown,updown firewall,))
400 $(eval $(call BuildPlugin,x509,x509 certificate,))
401 $(eval $(call BuildPlugin,xcbc,xcbc crypto,))