add a default for PKG_BUILD_DIR and PKG_INSTALL_DIR (will use KERNEL_BUILD_DIR if...
[openwrt.git] / package / 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 # $Id$
8
9 include $(TOPDIR)/rules.mk
10 include $(INCLUDE_DIR)/kernel.mk
11
12 PKG_NAME:=strongswan
13 PKG_VERSION:=2.8.2
14 PKG_RELEASE:=1
15
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
17 PKG_SOURCE_URL:=http://download.strongswan.org/
18 PKG_MD5SUM:=57427f5b48123851a73b10d78dd4f8d6
19 PKG_CAT:=bzcat
20
21 include $(INCLUDE_DIR)/package.mk
22
23 define Package/strongswan/Default
24 TITLE:=strongSwan
25 DEPENDS:=@LINUX_2_4
26 DESCRIPTION:=\
27 strongSwan is an IPsec implementation for Linux.
28 URL:=http://www.strongswan.org/
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 DESCRIPTION+=\\\
38 \\\
39 This package contains the strongSwan user-land daemon.
40 URL:=http://www.strongswan.org/
41 endef
42
43 define KernelPackage/strongswan
44 SUBMENU:=Network Support
45 $(call Package/strongswan/Default)
46 TITLE+= (kernel module)
47 DEPENDS:=@LINUX_2_4
48 DESCRIPTION+=\\\
49 \\\
50 This package contains the strongSwan kernel module.
51 VERSION:=$(LINUX_VERSION)+$(PKG_VERSION)-$(BOARD)-$(PKG_RELEASE)
52 FILES:=$(PKG_BUILD_DIR)/linux/net/ipsec/ipsec.$(LINUX_KMOD_SUFFIX)
53 AUTOLOAD:=$(call AutoLoad,50,ipsec)
54 endef
55
56 PKG_MAKE_OPTS:= \
57 LINUX_RELEASE="$(LINUX_RELEASE)" \
58 KERNELSRC="$(LINUX_DIR)" \
59 ARCH="$(LINUX_KARCH)" \
60 CROSS_COMPILE="$(TARGET_CROSS)" \
61 USERCOMPILE="$(TARGET_CFLAGS) -I./linux/include -I$(STAGING_DIR)/usr/include -L$(STAGING_DIR)/usr/lib" \
62 IPSECDIR="/usr/lib/ipsec" \
63 INC_USRLOCAL="/usr" \
64
65 define Build/Compile
66 $(MAKE) -C $(PKG_BUILD_DIR) \
67 $(TARGET_CONFIGURE_OPTS) \
68 $(PKG_MAKE_OPTS) \
69 LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
70 DESTDIR="$(PKG_INSTALL_DIR)" \
71 programs module install
72 endef
73
74 define Package/strongswan/install
75 $(CP) $(PKG_INSTALL_DIR)/* $(1)
76 $(INSTALL_DIR) $(1)/etc/init.d
77 $(INSTALL_DIR) $(1)/etc/config
78 $(INSTALL_DIR) $(1)/etc/cron.tick
79 $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
80 $(INSTALL_DIR) $(1)/etc/hotplug.d/button
81 $(INSTALL_BIN) ./files/ipsec.init $(1)/etc/init.d/ipsec
82 $(INSTALL_BIN) ./files/ipsec.cron $(1)/etc/cron.tick/ipsec-wakeup
83 $(INSTALL_BIN) ./files/ipsec.iface $(1)/etc/hotplug.d/iface/65-ipsec
84 $(INSTALL_BIN) ./files/ipsec.button $(1)/etc/hotplug.d/button/65-ipsec
85 $(INSTALL_DATA) ./files/ipsec.config $(1)/etc/config/ipsec
86 $(INSTALL_DATA) ./files/ipsec.conf $(1)/etc/ipsec.conf
87 rm -rf $(1)/usr/share
88 rm -rf $(1)/usr/man
89 rm -rf $(1)/var
90 rm -rf $(1)/etc/rc.d
91 find $(1) -name \*.old | xargs rm -rf
92 endef
93
94 $(eval $(call BuildPackage,strongswan))
95 $(eval $(call KernelPackage,strongswan))
This page took 0.064097 seconds and 5 git commands to generate.