ipsec-tools: fix compilation against Linux 3.7, refresh patches
[openwrt/svn-archive/archive.git] / net / ipsec-tools / Makefile
1 #
2 # Copyright (C) 2006-2011 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 include $(INCLUDE_DIR)/kernel.mk
10
11 PKG_NAME:=ipsec-tools
12 PKG_VERSION:=0.8.0
13 PKG_RELEASE:=2
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:=@SF/ipsec-tools
17 PKG_MD5SUM:=b79aae3055a51f8de5c0f1b8ca6cf619
18
19 PKG_BUILD_PARALLEL:=1
20 PKG_INSTALL:=1
21
22 PKG_FIXUP:=autoreconf
23
24 include $(INCLUDE_DIR)/package.mk
25
26 define Package/ipsec-tools
27 SECTION:=net
28 CATEGORY:=Network
29 SUBMENU:=VPN
30 DEPENDS:=+libopenssl +kmod-ipsec
31 TITLE:=IPsec management tools
32 URL:=http://ipsec-tools.sourceforge.net/
33 endef
34
35 CONFIGURE_ARGS += \
36 --enable-shared \
37 --enable-static \
38 --with-kernel-headers="$(LINUX_DIR)/include" \
39 --without-readline \
40 --with-openssl="$(STAGING_DIR)/usr" \
41 --without-libradius \
42 --without-libpam \
43 --enable-dpd \
44 --enable-hybrid \
45 --enable-security-context=no \
46 --enable-natt \
47 --enable-adminport \
48 --enable-frag \
49 $(call autoconf_bool,CONFIG_IPV6,ipv6)
50
51 # override CFLAGS holding "-Werror" that break builds on compile warnings
52 MAKE_FLAGS+=\
53 CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)"
54
55 define Build/Prepare
56 $(call Build/Prepare/Default)
57 chmod -R u+w $(PKG_BUILD_DIR)
58 endef
59
60 define Build/Configure
61 (cd $(PKG_BUILD_DIR); touch \
62 configure.ac \
63 aclocal.m4 \
64 Makefile.in \
65 config.h.in \
66 configure \
67 );
68 $(call Build/Configure/Default)
69 echo "#undef HAVE_SHADOW_H" >> $(PKG_BUILD_DIR)/config.h
70 endef
71
72 define Package/ipsec-tools/install
73 $(INSTALL_DIR) $(1)/etc
74 $(INSTALL_CONF) $(PKG_BUILD_DIR)/src/racoon/samples/racoon.conf $(1)/etc/
75 $(SED) 's|@sysconfdir_x@|/etc|g' $(1)/etc/racoon.conf
76 $(INSTALL_DIR) $(1)/etc/racoon
77 $(INSTALL_CONF) $(PKG_BUILD_DIR)/src/racoon/samples/psk.txt $(1)/etc/racoon/
78 $(INSTALL_DIR) $(1)/etc/init.d
79 $(INSTALL_BIN) ./files/racoon.init $(1)/etc/init.d/racoon
80 $(INSTALL_DIR) $(1)/usr/lib
81 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libipsec.so.* $(1)/usr/lib/
82 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libracoon.so.* $(1)/usr/lib/
83 $(INSTALL_DIR) $(1)/usr/sbin
84 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/plainrsa-gen $(1)/usr/sbin/
85 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/racoon $(1)/usr/sbin/
86 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/racoonctl $(1)/usr/sbin/
87 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/setkey $(1)/usr/sbin/
88 endef
89
90 define Package/ipsec-tools/conffiles
91 /etc/racoon.conf
92 /etc/racoon/psk.txt
93 endef
94
95 $(eval $(call BuildPackage,ipsec-tools))