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