2013-01-30 20:07:15 +00:00
|
|
|
#
|
2015-01-06 12:41:22 +00:00
|
|
|
# Copyright (C) 2010-2015 OpenWrt.org
|
2013-01-30 20:07:15 +00:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
|
|
|
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
|
|
|
|
PKG_NAME:=openvpn
|
|
|
|
|
2018-11-28 20:23:03 +00:00
|
|
|
PKG_VERSION:=2.4.6
|
|
|
|
PKG_RELEASE:=1
|
2013-01-30 20:07:15 +00:00
|
|
|
|
2017-03-27 12:51:44 +00:00
|
|
|
PKG_SOURCE_URL:=\
|
|
|
|
https://build.openvpn.net/downloads/releases/ \
|
2017-09-27 17:45:32 +00:00
|
|
|
https://swupdate.openvpn.net/community/releases/
|
2016-01-11 18:37:28 +00:00
|
|
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
2018-11-28 20:23:03 +00:00
|
|
|
PKG_HASH:=4f6434fa541cc9e363434ea71a16a62cf2615fb2f16af5b38f43ab5939998c26
|
2013-01-30 20:07:15 +00:00
|
|
|
|
|
|
|
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
|
2017-04-03 07:00:32 +00:00
|
|
|
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
2013-01-30 20:07:15 +00:00
|
|
|
|
|
|
|
PKG_INSTALL:=1
|
|
|
|
PKG_FIXUP:=autoreconf
|
|
|
|
PKG_BUILD_PARALLEL:=1
|
2014-11-02 12:20:54 +00:00
|
|
|
PKG_LICENSE:=GPL-2.0
|
2017-09-28 02:55:46 +00:00
|
|
|
PKG_CPE_ID:=cpe:/a:openvpn:openvpn
|
2013-01-30 20:07:15 +00:00
|
|
|
|
|
|
|
include $(INCLUDE_DIR)/package.mk
|
|
|
|
|
|
|
|
define Package/openvpn/Default
|
|
|
|
TITLE:=Open source VPN solution using $(2)
|
|
|
|
SECTION:=net
|
|
|
|
CATEGORY:=Network
|
|
|
|
URL:=http://openvpn.net
|
|
|
|
SUBMENU:=VPN
|
|
|
|
MENU:=1
|
|
|
|
DEPENDS:=+kmod-tun +OPENVPN_$(1)_ENABLE_LZO:liblzo +OPENVPN_$(1)_ENABLE_IPROUTE2:ip $(3)
|
|
|
|
VARIANT:=$(1)
|
2017-01-22 18:00:51 +00:00
|
|
|
ifeq ($(1),nossl)
|
2017-01-21 22:03:36 +00:00
|
|
|
PROVIDES:=openvpn
|
2017-01-22 18:00:51 +00:00
|
|
|
else
|
|
|
|
PROVIDES:=openvpn openvpn-crypto
|
|
|
|
endif
|
2013-01-30 20:07:15 +00:00
|
|
|
endef
|
|
|
|
|
2016-12-17 09:35:32 +00:00
|
|
|
Package/openvpn-openssl=$(call Package/openvpn/Default,openssl,OpenSSL,+PACKAGE_openvpn-openssl:libopenssl)
|
|
|
|
Package/openvpn-mbedtls=$(call Package/openvpn/Default,mbedtls,mbedTLS,+PACKAGE_openvpn-mbedtls:libmbedtls)
|
2013-01-30 20:07:15 +00:00
|
|
|
Package/openvpn-nossl=$(call Package/openvpn/Default,nossl,plaintext (no SSL))
|
|
|
|
|
|
|
|
define Package/openvpn/config/Default
|
|
|
|
source "$(SOURCE)/Config-$(1).in"
|
|
|
|
endef
|
|
|
|
|
|
|
|
Package/openvpn-openssl/config=$(call Package/openvpn/config/Default,openssl)
|
2016-12-10 11:11:33 +00:00
|
|
|
Package/openvpn-mbedtls/config=$(call Package/openvpn/config/Default,mbedtls)
|
2013-01-30 20:07:15 +00:00
|
|
|
Package/openvpn-nossl/config=$(call Package/openvpn/config/Default,nossl)
|
|
|
|
|
2016-12-10 11:11:33 +00:00
|
|
|
ifeq ($(BUILD_VARIANT),mbedtls)
|
|
|
|
CONFIG_OPENVPN_MBEDTLS:=y
|
2013-01-30 20:07:15 +00:00
|
|
|
endif
|
|
|
|
ifeq ($(BUILD_VARIANT),openssl)
|
|
|
|
CONFIG_OPENVPN_OPENSSL:=y
|
|
|
|
endif
|
|
|
|
ifeq ($(BUILD_VARIANT),nossl)
|
|
|
|
CONFIG_OPENVPN_NOSSL:=y
|
|
|
|
endif
|
|
|
|
|
|
|
|
CONFIGURE_VARS += \
|
|
|
|
IFCONFIG=/sbin/ifconfig \
|
|
|
|
ROUTE=/sbin/route \
|
2015-09-08 17:44:24 +00:00
|
|
|
IPROUTE=/sbin/ip \
|
2013-01-30 20:07:15 +00:00
|
|
|
NETSTAT=/sbin/netstat
|
|
|
|
|
2016-12-10 11:39:54 +00:00
|
|
|
TARGET_CFLAGS += -ffunction-sections -fdata-sections
|
|
|
|
TARGET_LDFLAGS += -Wl,--gc-sections
|
|
|
|
|
2013-01-30 20:07:15 +00:00
|
|
|
define Build/Configure
|
|
|
|
$(call Build/Configure/Default, \
|
2014-03-11 12:07:17 +00:00
|
|
|
$(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_SMALL),--enable-small) \
|
2013-01-30 20:07:15 +00:00
|
|
|
--disable-selinux \
|
|
|
|
--disable-systemd \
|
|
|
|
--disable-plugins \
|
|
|
|
--disable-debug \
|
|
|
|
--disable-pkcs11 \
|
|
|
|
$(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_LZO),--enable,--disable)-lzo \
|
2016-12-10 11:11:33 +00:00
|
|
|
$(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_LZ4),--enable,--disable)-lz4 \
|
2018-11-28 20:23:03 +00:00
|
|
|
$(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_X509_ALT_USERNAME),--enable,--disable)-x509-alt-username \
|
2013-01-30 20:07:15 +00:00
|
|
|
$(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_SERVER),--enable,--disable)-server \
|
|
|
|
$(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_MANAGEMENT),--enable,--disable)-management \
|
|
|
|
$(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_FRAGMENT),--enable,--disable)-fragment \
|
|
|
|
$(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_MULTIHOME),--enable,--disable)-multihome \
|
|
|
|
$(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_IPROUTE2),--enable,--disable)-iproute2 \
|
|
|
|
$(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_DEF_AUTH),--enable,--disable)-def-auth \
|
|
|
|
$(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_PF),--enable,--disable)-pf \
|
2018-11-28 20:23:03 +00:00
|
|
|
$(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_PORT_SHARE),--enable,--disable)-port-share \
|
|
|
|
$(if $(CONFIG_OPENVPN_NOSSL),--disable-crypto,--enable-crypto) \
|
2013-01-30 20:07:15 +00:00
|
|
|
$(if $(CONFIG_OPENVPN_OPENSSL),--with-crypto-library=openssl) \
|
2016-12-10 11:11:33 +00:00
|
|
|
$(if $(CONFIG_OPENVPN_MBEDTLS),--with-crypto-library=mbedtls) \
|
2013-01-30 20:07:15 +00:00
|
|
|
)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/openvpn-$(BUILD_VARIANT)/conffiles
|
|
|
|
/etc/config/openvpn
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/openvpn-$(BUILD_VARIANT)/install
|
|
|
|
$(INSTALL_DIR) \
|
|
|
|
$(1)/usr/sbin \
|
2017-02-26 07:22:04 +00:00
|
|
|
$(1)/usr/share/openvpn \
|
2013-01-30 20:07:15 +00:00
|
|
|
$(1)/etc/init.d \
|
|
|
|
$(1)/etc/config \
|
|
|
|
$(1)/etc/openvpn \
|
|
|
|
$(1)/lib/upgrade/keep.d
|
|
|
|
|
|
|
|
$(INSTALL_BIN) \
|
|
|
|
$(PKG_INSTALL_DIR)/usr/sbin/openvpn \
|
|
|
|
$(1)/usr/sbin/
|
|
|
|
|
|
|
|
$(INSTALL_BIN) \
|
|
|
|
files/openvpn.init \
|
|
|
|
$(1)/etc/init.d/openvpn
|
2017-02-26 07:22:04 +00:00
|
|
|
$(INSTALL_DATA) \
|
|
|
|
files/openvpn.options \
|
|
|
|
$(1)/usr/share/openvpn/openvpn.options
|
2013-01-30 20:07:15 +00:00
|
|
|
|
|
|
|
$(INSTALL_CONF) files/openvpn.config \
|
|
|
|
$(1)/etc/config/openvpn
|
|
|
|
|
|
|
|
$(INSTALL_DATA) \
|
|
|
|
files/openvpn.upgrade \
|
|
|
|
$(1)/lib/upgrade/keep.d/openvpn
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(call BuildPackage,openvpn-openssl))
|
2016-12-10 11:11:33 +00:00
|
|
|
$(eval $(call BuildPackage,openvpn-mbedtls))
|
2013-01-30 20:07:15 +00:00
|
|
|
$(eval $(call BuildPackage,openvpn-nossl))
|