2 # Copyright (C) 2010-2012 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
12 PKG_REV:=56cffde5d5320e0b1ec364d3e486aca9
16 PKG_SOURCE_URL:=http://swupdate.openvpn.net/community/releases
17 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
19 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
25 include $(INCLUDE_DIR)/package.mk
27 define Package/openvpn/Default
28 TITLE:=Open source VPN solution using $(2)
31 URL:=http://openvpn.net
34 DEPENDS:=+kmod-tun +OPENVPN_$(1)_ENABLE_LZO:liblzo +OPENVPN_$(1)_ENABLE_IPROUTE2:ip $(3)
36 MAINTAINER:=Mirko Vogt <mirko@openwrt.org>
39 Package/openvpn-openssl=$(call Package/openvpn/Default,openssl,OpenSSL,+libopenssl)
40 Package/openvpn-polarssl=$(call Package/openvpn/Default,polarssl,PolarSSL,+libpolarssl)
41 Package/openvpn-nossl=$(call Package/openvpn/Default,nossl,plaintext (no SSL))
43 define Package/openvpn/config/Default
44 source "$(SOURCE)/Config-$(1).in"
47 Package/openvpn-openssl/config=$(call Package/openvpn/config/Default,openssl)
48 Package/openvpn-polarssl/config=$(call Package/openvpn/config/Default,polarssl)
49 Package/openvpn-nossl/config=$(call Package/openvpn/config/Default,nossl)
51 define Package/openvpn-easy-rsa
52 $(call Package/openvpn)
53 DEPENDS:=+openssl-util
54 TITLE:=Simple shell scripts to manage a Certificate Authority
57 define Package/openvpn-easy-rsa/conffiles
58 /etc/easy-rsa/keys/serial
59 /etc/easy-rsa/keys/index.txt
64 ifeq ($(BUILD_VARIANT),polarssl)
65 CONFIG_OPENVPN_POLARSSL:=y
67 ifeq ($(BUILD_VARIANT),openssl)
68 CONFIG_OPENVPN_OPENSSL:=y
70 ifeq ($(BUILD_VARIANT),nossl)
71 CONFIG_OPENVPN_NOSSL:=y
75 IFCONFIG=/sbin/ifconfig \
77 IPROUTE=/usr/sbin/ip \
80 define Build/Configure
81 $(call Build/Configure/Default, \
89 $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_LZO),--enable,--disable)-lzo \
90 $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_X509_ALT_USERNAME),enable,disable-x509-alt-username)-ssl \
91 $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_SERVER),--enable,--disable)-server \
92 $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_MANAGEMENT),--enable,--disable)-management \
93 $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_SOCKS),--enable,--disable)-socks \
94 $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_HTTP),--enable,--disable)-http \
95 $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_FRAGMENT),--enable,--disable)-fragment \
96 $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_MULTIHOME),--enable,--disable)-multihome \
97 $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_IPROUTE2),--enable,--disable)-iproute2 \
98 $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_DEF_AUTH),--enable,--disable)-def-auth \
99 $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_PF),--enable,--disable)-pf \
100 $(if $(CONFIG_OPENVPN_NOSSL),--disable-ssl --disable-crypto,--enable-ssl --enable-crypto) \
101 $(if $(CONFIG_OPENVPN_OPENSSL),--with-crypto-library=openssl) \
102 $(if $(CONFIG_OPENVPN_POLARSSL),--with-crypto-library=polarssl) \
106 define Package/openvpn-$(BUILD_VARIANT)/conffiles
110 define Package/openvpn-$(BUILD_VARIANT)/install
116 $(1)/lib/upgrade/keep.d
119 $(PKG_INSTALL_DIR)/usr/sbin/openvpn \
124 $(1)/etc/init.d/openvpn
126 $(INSTALL_CONF) files/openvpn.config \
127 $(1)/etc/config/openvpn
130 files/openvpn.upgrade \
131 $(1)/lib/upgrade/keep.d/openvpn
134 define Package/openvpn-easy-rsa/install
135 $(INSTALL_DIR) $(1)/usr/sbin
136 $(CP) $(PKG_BUILD_DIR)/easy-rsa/2.0/{build-*,clean-all,inherit-inter,list-crl,pkitool,revoke-full,sign-req,whichopensslcnf} $(1)/usr/sbin/
137 $(INSTALL_DIR) $(1)/etc/easy-rsa
138 $(INSTALL_DATA) $(PKG_BUILD_DIR)/easy-rsa/2.0/openssl-1.0.0.cnf $(1)/etc/easy-rsa/openssl-1.0.0.cnf
139 $(INSTALL_DATA) $(PKG_BUILD_DIR)/easy-rsa/2.0/vars $(1)/etc/easy-rsa/vars
140 $(INSTALL_DIR) $(1)/etc/easy-rsa/keys
141 $(INSTALL_DATA) files/easy-rsa.index $(1)/etc/easy-rsa/keys/index.txt
142 $(INSTALL_DATA) files/easy-rsa.serial $(1)/etc/easy-rsa/keys/serial
145 $(eval $(call BuildPackage,openvpn-openssl))
146 $(eval $(call BuildPackage,openvpn-polarssl))
147 $(eval $(call BuildPackage,openvpn-nossl))
148 $(eval $(call BuildPackage,openvpn-easy-rsa))