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