2008-08-20 22:00:41 +00:00
|
|
|
#
|
2012-04-21 02:17:06 +00:00
|
|
|
# Copyright (C) 2006-2012 OpenWrt.org
|
2008-08-20 22:00:41 +00:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
|
|
|
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
include $(INCLUDE_DIR)/kernel.mk
|
|
|
|
|
|
|
|
PKG_NAME:=openswan
|
2012-04-21 02:17:06 +00:00
|
|
|
PKG_VERSION:=2.6.38
|
|
|
|
PKG_RELEASE:=1
|
2008-08-20 22:00:41 +00:00
|
|
|
|
|
|
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
|
|
|
PKG_SOURCE_URL:=http://www.openswan.org/download
|
2012-04-21 02:17:06 +00:00
|
|
|
PKG_MD5SUM:=13073eb5314b83a31be88e4117e8bbcd
|
2010-10-09 08:43:44 +00:00
|
|
|
|
|
|
|
PKG_BUILD_PARALLEL:=1
|
|
|
|
PKG_INSTALL:=1
|
2008-08-20 22:00:41 +00:00
|
|
|
|
|
|
|
include $(INCLUDE_DIR)/package.mk
|
|
|
|
|
|
|
|
define Package/openswan/Default
|
|
|
|
TITLE:=Openswan
|
|
|
|
URL:=http://www.openswan.org/
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/openswan/Default/description
|
|
|
|
Openswan is an IPsec implementation for Linux.
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/openswan
|
|
|
|
$(call Package/openswan/Default)
|
2010-04-19 02:48:02 +00:00
|
|
|
SUBMENU:=VPN
|
2008-08-20 22:00:41 +00:00
|
|
|
SECTION:=net
|
|
|
|
CATEGORY:=Network
|
|
|
|
TITLE+= (daemon)
|
2011-12-20 04:23:36 +00:00
|
|
|
DEPENDS+= +libgmp +ip
|
2008-08-20 22:00:41 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/openswan/description
|
|
|
|
$(call Package/openswan/Default/description)
|
|
|
|
This package contains the Openswan user-land daemon.
|
|
|
|
endef
|
|
|
|
|
|
|
|
define KernelPackage/openswan
|
|
|
|
$(call Package/openswan/Default)
|
|
|
|
SUBMENU:=Network Support
|
|
|
|
TITLE+= (kernel module)
|
2011-04-09 16:46:11 +00:00
|
|
|
DEPENDS+=+IPV6:kmod-ipv6
|
2008-08-20 22:00:41 +00:00
|
|
|
FILES:=$(PKG_BUILD_DIR)/modobj*/ipsec.$(LINUX_KMOD_SUFFIX)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define KernelPackage/openswan/description
|
|
|
|
$(call Package/openswan/Default/description)
|
|
|
|
This package contains the Openswan kernel module.
|
|
|
|
endef
|
|
|
|
|
2010-10-09 08:43:44 +00:00
|
|
|
TARGET_CPPFLAGS += -I$(LINUX_DIR)/include -D__EXPORTED_HEADERS__
|
2008-08-20 22:00:41 +00:00
|
|
|
|
2010-10-09 08:43:44 +00:00
|
|
|
OPENSWAN_MAKEFLAGS:= \
|
|
|
|
-C $(PKG_BUILD_DIR) \
|
2008-08-20 22:00:41 +00:00
|
|
|
$(TARGET_CONFIGURE_OPTS) \
|
|
|
|
LINUX_RELEASE="$(LINUX_RELEASE)" \
|
|
|
|
KERNELSRC="$(LINUX_DIR)" \
|
|
|
|
ARCH="$(LINUX_KARCH)" \
|
|
|
|
CROSS_COMPILE="$(TARGET_CROSS)" \
|
2009-07-06 13:16:38 +00:00
|
|
|
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)" \
|
2008-08-20 22:00:41 +00:00
|
|
|
IPSECDIR="/usr/lib/ipsec" \
|
|
|
|
INC_USRLOCAL="/usr" \
|
|
|
|
INC_RCDEFAULT="/etc/init.d" \
|
|
|
|
MODPROBE="/sbin/insmod" \
|
|
|
|
DESTDIR="$(PKG_INSTALL_DIR)"
|
|
|
|
|
|
|
|
define Build/Compile
|
2012-09-23 09:58:24 +00:00
|
|
|
+$(MAKE) $(PKG_JOBS) $(OPENSWAN_MAKEFLAGS) programs
|
|
|
|
+$(MAKE) $(PKG_JOBS) $(OPENSWAN_MAKEFLAGS) module
|
2010-10-09 08:43:44 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Build/Install
|
|
|
|
$(MAKE) $(OPENSWAN_MAKEFLAGS) install
|
2008-08-20 22:00:41 +00:00
|
|
|
endef
|
|
|
|
|
2011-02-20 16:01:16 +00:00
|
|
|
define Package/openswan/conffiles
|
|
|
|
/etc/ipsec.conf
|
|
|
|
/etc/ipsec.secrets
|
2011-12-20 04:36:42 +00:00
|
|
|
/etc/config/ipsec
|
2011-02-20 16:01:16 +00:00
|
|
|
endef
|
|
|
|
|
2008-08-20 22:00:41 +00:00
|
|
|
define Package/openswan/install
|
|
|
|
$(CP) $(PKG_INSTALL_DIR)/* $(1)
|
|
|
|
$(INSTALL_DIR) $(1)/etc/init.d
|
|
|
|
$(CP) ./files/ipsec.init $(1)/etc/init.d/ipsec
|
2011-12-20 04:36:42 +00:00
|
|
|
$(CP) ./files/ipsec.conf $(1)/etc/ipsec.conf
|
|
|
|
$(CP) ./files/ipsec.secrets $(1)/etc/ipsec.secrets
|
|
|
|
$(INSTALL_DIR) $(1)/etc/config
|
|
|
|
$(INSTALL_CONF) ./files/ipsec.config $(1)/etc/config/ipsec
|
2008-08-20 22:00:41 +00:00
|
|
|
rm -rf $(1)/usr/share
|
|
|
|
rm -rf $(1)/usr/man
|
|
|
|
rm -rf $(1)/var
|
|
|
|
rm -rf $(1)/etc/rc.d
|
|
|
|
find $(1) -name \*.old | xargs rm -rf
|
2011-12-20 04:36:40 +00:00
|
|
|
$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
|
|
|
|
$(INSTALL_DATA) files/ipsec.upgrade $(1)/lib/upgrade/keep.d/ipsec
|
2008-08-20 22:00:41 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(call BuildPackage,openswan))
|
|
|
|
$(eval $(call KernelPackage,openswan))
|