Merge pull request #4853 from StevenHessing/noddos
[feed/packages.git] / net / ipsec-tools / Makefile
1 #
2 # Copyright (C) 2006-2015 OpenWrt.org
3 # 2014 Noah Meyerhans <frodo@morgul.net>
4 #
5 # This is free software, licensed under the GNU General Public License v2.
6 # See /LICENSE for more information.
7 #
8
9 include $(TOPDIR)/rules.mk
10 include $(INCLUDE_DIR)/kernel.mk
11
12 PKG_NAME:=ipsec-tools
13 PKG_VERSION:=0.8.2
14 PKG_RELEASE:=7
15 PKG_MAINTAINER:=Noah Meyerhans <frodo@morgul.net>, \
16 Vitaly Protsko <villy@sft.ru>
17 PKG_LICENSE := BSD-3-Clause
18
19 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
20 PKG_SOURCE_URL:=@SF/ipsec-tools
21 PKG_HASH:=8eb6b38716e2f3a8a72f1f549c9444c2bc28d52c9536792690564c74fe722f2d
22
23 PKG_BUILD_PARALLEL:=1
24 PKG_INSTALL:=1
25
26 PKG_FIXUP:=autoreconf
27
28 include $(INCLUDE_DIR)/package.mk
29
30 define Package/ipsec-tools
31 SECTION:=net
32 CATEGORY:=Network
33 SUBMENU:=VPN
34 DEPENDS:=+libopenssl +kmod-ipsec
35 TITLE:=IPsec management tools
36 URL:=http://ipsec-tools.sourceforge.net/
37 MAINTAINER:=Noah Meyerhans <frodo@morgul.net>
38 endef
39
40 CONFIGURE_ARGS += \
41 --enable-shared \
42 --enable-static \
43 --with-kernel-headers="$(LINUX_DIR)/include" \
44 --without-readline \
45 --with-openssl="$(STAGING_DIR)/usr" \
46 --without-libradius \
47 --without-libpam \
48 --enable-dpd \
49 --enable-hybrid \
50 --enable-security-context=no \
51 --enable-natt \
52 --enable-adminport \
53 --enable-frag \
54 $(call autoconf_bool,CONFIG_IPV6,ipv6)
55
56 # override CFLAGS holding "-Werror" that break builds on compile warnings
57 MAKE_FLAGS+=\
58 CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)"
59
60 define Build/Prepare
61 $(call Build/Prepare/Default)
62 chmod -R u+w $(PKG_BUILD_DIR)
63 endef
64
65 define Build/Configure
66 (cd $(PKG_BUILD_DIR); touch \
67 configure.ac \
68 aclocal.m4 \
69 Makefile.in \
70 config.h.in \
71 configure \
72 );
73 $(call Build/Configure/Default)
74 ifndef CONFIG_SHADOW_PASSWORDS
75 echo "#undef HAVE_SHADOW_H" >> $(PKG_BUILD_DIR)/config.h
76 endif
77 endef
78
79 define Package/ipsec-tools/install
80 $(INSTALL_DIR) $(1)/etc/racoon
81 $(INSTALL_CONF) ./files/functions.sh $(1)/etc/racoon/
82 $(INSTALL_BIN) ./files/p1client-up $(1)/etc/racoon/
83 $(INSTALL_BIN) ./files/p1client-down $(1)/etc/racoon/
84 $(INSTALL_BIN) ./files/vpnctl $(1)/etc/racoon/
85 $(INSTALL_DIR) $(1)/etc/init.d
86 $(INSTALL_BIN) ./files/racoon.init $(1)/etc/init.d/racoon
87 $(INSTALL_DIR) $(1)/etc/config
88 $(INSTALL_CONF) ./files/racoon $(1)/etc/config/
89 $(INSTALL_DIR) $(1)/usr/lib
90 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libipsec.so.* $(1)/usr/lib/
91 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libracoon.so.* $(1)/usr/lib/
92 $(INSTALL_DIR) $(1)/usr/sbin
93 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/plainrsa-gen $(1)/usr/sbin/
94 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/racoon $(1)/usr/sbin/
95 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/racoonctl $(1)/usr/sbin/
96 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/setkey $(1)/usr/sbin/
97 endef
98
99 define Package/ipsec-tools/conffiles
100 /etc/config/racoon
101 endef
102
103 $(eval $(call BuildPackage,ipsec-tools))