replace ipkg-make-index with a shell script that works on bsd
[openwrt.git] / package / openswan / 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:=openswan
13 PKG_VERSION:=2.4.6
14 PKG_RELEASE:=1
15
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17 PKG_SOURCE_URL:=http://www.openswan.org/download
18 PKG_MD5SUM:=b34d71ca49dedad017879b0e912d40dd
19 PKG_CAT:=zcat
20
21 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
22 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
23
24 PKG_INIT_PRIO:=60
25
26 include $(INCLUDE_DIR)/package.mk
27
28 define Package/openswan/Default
29 TITLE:=Openswan
30 DESCRIPTION:=\
31 Openswan is an IPsec implementation for Linux.
32 URL:=http://www.openswan.org/
33 endef
34
35 define Package/openswan
36 $(call Package/openswan/Default)
37 SECTION:=net
38 CATEGORY:=Network
39 DEPENDS:=+kmod-openswan +libgmp
40 TITLE+= (daemon)
41 DESCRIPTION+=\\\
42 \\\
43 This package contains the Openswan user-land daemon.
44 URL:=http://www.openswan.org/
45 endef
46
47 define Package/kmod-openswan
48 $(call Package/openswan/Default)
49 SECTION:=kernel
50 CATEGORY:=Kernel drivers
51 TITLE+= (kernel module)
52 DESCRIPTION+=\\\
53 \\\
54 This package contains the Openswan kernel module.
55 VERSION:=$(LINUX_VERSION)+$(PKG_VERSION)-$(BOARD)-$(PKG_RELEASE)
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 -I$(STAGING_DIR)/usr/include -L$(STAGING_DIR)/usr/lib" \
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="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
72 DESTDIR="$(PKG_INSTALL_DIR)" \
73 programs module install
74 endef
75
76 define Package/openswan/install
77 $(CP) $(PKG_INSTALL_DIR)/* $(1)
78 install -d -m0755 $(1)/etc/init.d
79 $(CP) $(1)/etc/rc.d/init.d/ipsec $(1)/etc/init.d/S$(PKG_INIT_PRIO)ipsec
80 rm -rf $(1)/usr/share
81 rm -rf $(1)/usr/man
82 rm -rf $(1)/var
83 rm -rf $(1)/etc/rc.d
84 find $(1) -name \*.old | xargs rm -rf
85 endef
86
87 define Package/kmod-openswan/install
88 mkdir -p $(1)/lib/modules/$(LINUX_VERSION)
89 $(CP) $(PKG_BUILD_DIR)/modobj*/ipsec.$(LINUX_KMOD_SUFFIX) \
90 $(1)/lib/modules/$(LINUX_VERSION)/
91 endef
92
93 $(eval $(call BuildPackage,openswan))
94 $(eval $(call BuildPackage,kmod-openswan))
This page took 0.049226 seconds and 5 git commands to generate.