b86afff8b39571e37a981425d71f91962fc56202
[openwrt/svn-archive/archive.git] / net / strongswan / Makefile
1 #
2 # Copyright (C) 2006 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:=strongswan
12 PKG_VERSION:=2.8.2
13 PKG_RELEASE:=2
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:=http://download.strongswan.org/
17 PKG_MD5SUM:=57427f5b48123851a73b10d78dd4f8d6
18
19 include $(INCLUDE_DIR)/package.mk
20
21 define Package/strongswan/Default
22 TITLE:=strongSwan
23 DEPENDS:=@LINUX_2_4
24 URL:=http://www.strongswan.org/
25 endef
26
27 define Package/strongswan/Default/description
28 strongSwan is an IPsec implementation for Linux.
29 endef
30
31 define Package/strongswan
32 $(call Package/strongswan/Default)
33 SECTION:=net
34 CATEGORY:=Network
35 DEPENDS:=+kmod-strongswan +libgmp @LINUX_2_4
36 TITLE+= (daemon)
37 endef
38
39 define Package/strongswan/description
40 $(call Package/strongswan/Default/description)
41 This package contains the strongSwan user-land daemon.
42 endef
43
44 define KernelPackage/strongswan
45 $(call Package/strongswan/Default)
46 SUBMENU:=Network Support
47 TITLE+= (kernel module)
48 DEPENDS:=@LINUX_2_4
49 FILES:=$(PKG_BUILD_DIR)/linux/net/ipsec/ipsec.$(LINUX_KMOD_SUFFIX)
50 AUTOLOAD:=$(call AutoLoad,50,ipsec)
51 endef
52
53 define KernelPackage/strongswan/description
54 $(call Package/strongswan/Default/description)
55 This package contains the strongSwan kernel module.
56 endef
57
58 PKG_MAKE_OPTS:= \
59 LINUX_RELEASE="$(LINUX_RELEASE)" \
60 KERNELSRC="$(LINUX_DIR)" \
61 ARCH="$(LINUX_KARCH)" \
62 CROSS_COMPILE="$(TARGET_CROSS)" \
63 USERCOMPILE="$(TARGET_CFLAGS) -I./linux/include $(TARGET_CPPFLAGS) $(TARGET_LDFLAGS)" \
64 IPSECDIR="/usr/lib/ipsec" \
65 INC_USRLOCAL="/usr" \
66
67 define Build/Compile
68 $(MAKE) -C $(PKG_BUILD_DIR) \
69 $(TARGET_CONFIGURE_OPTS) \
70 $(PKG_MAKE_OPTS) \
71 LDFLAGS="$(TARGET_LDFLAGS)" \
72 DESTDIR="$(PKG_INSTALL_DIR)" \
73 programs module install
74 endef
75
76 define Package/strongswan/install
77 $(CP) $(PKG_INSTALL_DIR)/* $(1)
78 $(INSTALL_DIR) $(1)/etc/init.d
79 $(INSTALL_DIR) $(1)/etc/config
80 $(INSTALL_DIR) $(1)/etc/cron.tick
81 $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
82 $(INSTALL_DIR) $(1)/etc/hotplug.d/button
83 $(INSTALL_BIN) ./files/ipsec.init $(1)/etc/init.d/ipsec
84 $(INSTALL_BIN) ./files/ipsec.cron $(1)/etc/cron.tick/ipsec-wakeup
85 $(INSTALL_BIN) ./files/ipsec.iface $(1)/etc/hotplug.d/iface/65-ipsec
86 $(INSTALL_BIN) ./files/ipsec.button $(1)/etc/hotplug.d/button/65-ipsec
87 $(INSTALL_DATA) ./files/ipsec.config $(1)/etc/config/ipsec
88 $(INSTALL_DATA) ./files/ipsec.conf $(1)/etc/ipsec.conf
89 rm -rf $(1)/usr/share
90 rm -rf $(1)/usr/man
91 rm -rf $(1)/var
92 rm -rf $(1)/etc/rc.d
93 find $(1) -name \*.old | xargs rm -rf
94 endef
95
96 $(eval $(call BuildPackage,strongswan))
97 $(eval $(call KernelPackage,strongswan))