rpcd: iwinfo plugin fixes
[openwrt.git] / package / network / services / openvpn / Makefile
1 #
2 # Copyright (C) 2010-2015 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=openvpn
11
12 PKG_VERSION:=2.3.10
13 PKG_RELEASE:=1
14
15 PKG_SOURCE_URL:=http://swupdate.openvpn.net/community/releases
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
17 PKG_MD5SUM:=8831ded42db4317e287157b6b8cba74c
18
19 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
20
21 PKG_INSTALL:=1
22 PKG_FIXUP:=autoreconf
23 PKG_BUILD_PARALLEL:=1
24 PKG_LICENSE:=GPL-2.0
25
26 include $(INCLUDE_DIR)/package.mk
27
28 define Package/openvpn/Default
29   TITLE:=Open source VPN solution using $(2)
30   SECTION:=net
31   CATEGORY:=Network
32   URL:=http://openvpn.net
33   SUBMENU:=VPN
34   MENU:=1
35   DEPENDS:=+kmod-tun +OPENVPN_$(1)_ENABLE_LZO:liblzo +OPENVPN_$(1)_ENABLE_IPROUTE2:ip $(3)
36   VARIANT:=$(1)
37   MAINTAINER:=Mirko Vogt <mirko@openwrt.org>
38 endef
39
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))
43
44 define Package/openvpn/config/Default
45         source "$(SOURCE)/Config-$(1).in"
46 endef
47
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)
51
52 ifeq ($(BUILD_VARIANT),polarssl)
53 CONFIG_OPENVPN_POLARSSL:=y
54 endif
55 ifeq ($(BUILD_VARIANT),openssl)
56 CONFIG_OPENVPN_OPENSSL:=y
57 endif
58 ifeq ($(BUILD_VARIANT),nossl)
59 CONFIG_OPENVPN_NOSSL:=y
60 endif
61
62 CONFIGURE_VARS += \
63         IFCONFIG=/sbin/ifconfig \
64         ROUTE=/sbin/route \
65         IPROUTE=/sbin/ip \
66         NETSTAT=/sbin/netstat
67
68 define Build/Configure
69         $(call Build/Configure/Default, \
70                 $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_SMALL),--enable-small) \
71                 --disable-selinux \
72                 --disable-systemd \
73                 --disable-plugins \
74                 --disable-debug \
75                 --disable-pkcs11 \
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) \
91         )
92 endef
93
94 define Package/openvpn-$(BUILD_VARIANT)/conffiles
95 /etc/config/openvpn
96 endef
97
98 define Package/openvpn-$(BUILD_VARIANT)/install
99         $(INSTALL_DIR) \
100                 $(1)/usr/sbin \
101                 $(1)/etc/init.d \
102                 $(1)/etc/config \
103                 $(1)/etc/openvpn \
104                 $(1)/lib/upgrade/keep.d
105
106         $(INSTALL_BIN) \
107                 $(PKG_INSTALL_DIR)/usr/sbin/openvpn \
108                 $(1)/usr/sbin/
109
110         $(INSTALL_BIN) \
111                 files/openvpn.init \
112                 $(1)/etc/init.d/openvpn
113
114         $(INSTALL_CONF) files/openvpn.config \
115                 $(1)/etc/config/openvpn
116
117         $(INSTALL_DATA) \
118                 files/openvpn.upgrade \
119                 $(1)/lib/upgrade/keep.d/openvpn
120 endef
121
122 $(eval $(call BuildPackage,openvpn-openssl))
123 $(eval $(call BuildPackage,openvpn-polarssl))
124 $(eval $(call BuildPackage,openvpn-nossl))