2 # Copyright (C) 2010-2015 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR)/rules.mk
15 PKG_SOURCE_URL:=http://swupdate.openvpn.net/community/releases
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
17 PKG_MD5SUM:=8831ded42db4317e287157b6b8cba74c
19 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
26 include $(INCLUDE_DIR)/package.mk
28 define Package/openvpn/Default
29 TITLE:=Open source VPN solution using $(2)
32 URL:=http://openvpn.net
35 DEPENDS:=+kmod-tun +OPENVPN_$(1)_ENABLE_LZO:liblzo +OPENVPN_$(1)_ENABLE_IPROUTE2:ip $(3)
37 MAINTAINER:=Mirko Vogt <mirko@openwrt.org>
40 Package/openvpn-openssl=$(call Package/openvpn/Default,openssl,OpenSSL,+libopenssl)
41 Package/openvpn-polarssl=$(call Package/openvpn/Default,polarssl,PolarSSL,+libpolarssl)
42 Package/openvpn-nossl=$(call Package/openvpn/Default,nossl,plaintext (no SSL))
44 define Package/openvpn/config/Default
45 source "$(SOURCE)/Config-$(1).in"
48 Package/openvpn-openssl/config=$(call Package/openvpn/config/Default,openssl)
49 Package/openvpn-polarssl/config=$(call Package/openvpn/config/Default,polarssl)
50 Package/openvpn-nossl/config=$(call Package/openvpn/config/Default,nossl)
52 ifeq ($(BUILD_VARIANT),polarssl)
53 CONFIG_OPENVPN_POLARSSL:=y
55 ifeq ($(BUILD_VARIANT),openssl)
56 CONFIG_OPENVPN_OPENSSL:=y
58 ifeq ($(BUILD_VARIANT),nossl)
59 CONFIG_OPENVPN_NOSSL:=y
63 IFCONFIG=/sbin/ifconfig \
68 define Build/Configure
69 $(call Build/Configure/Default, \
70 $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_SMALL),--enable-small) \
76 --enable-password-save \
77 $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_LZO),--enable,--disable)-lzo \
78 $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_X509_ALT_USERNAME),enable,disable-x509-alt-username)-ssl \
79 $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_SERVER),--enable,--disable)-server \
80 $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_MANAGEMENT),--enable,--disable)-management \
81 $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_SOCKS),--enable,--disable)-socks \
82 $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_HTTP),--enable,--disable)-http-proxy \
83 $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_FRAGMENT),--enable,--disable)-fragment \
84 $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_MULTIHOME),--enable,--disable)-multihome \
85 $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_IPROUTE2),--enable,--disable)-iproute2 \
86 $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_DEF_AUTH),--enable,--disable)-def-auth \
87 $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_PF),--enable,--disable)-pf \
88 $(if $(CONFIG_OPENVPN_NOSSL),--disable-ssl --disable-crypto,--enable-ssl --enable-crypto) \
89 $(if $(CONFIG_OPENVPN_OPENSSL),--with-crypto-library=openssl) \
90 $(if $(CONFIG_OPENVPN_POLARSSL),--with-crypto-library=polarssl) \
94 define Package/openvpn-$(BUILD_VARIANT)/conffiles
98 define Package/openvpn-$(BUILD_VARIANT)/install
104 $(1)/lib/upgrade/keep.d
107 $(PKG_INSTALL_DIR)/usr/sbin/openvpn \
112 $(1)/etc/init.d/openvpn
114 $(INSTALL_CONF) files/openvpn.config \
115 $(1)/etc/config/openvpn
118 files/openvpn.upgrade \
119 $(1)/lib/upgrade/keep.d/openvpn
122 $(eval $(call BuildPackage,openvpn-openssl))
123 $(eval $(call BuildPackage,openvpn-polarssl))
124 $(eval $(call BuildPackage,openvpn-nossl))