Makefile 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=openvpn
  9. PKG_VERSION:=2.3.11
  10. PKG_RELEASE:=1
  11. PKG_SOURCE_URL:=http://swupdate.openvpn.net/community/releases
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  13. PKG_MD5SUM:=0f5f1ca1dc5743fa166d93dd4ec952f014b5f33bafd88f0ea34b455cae1434a7
  14. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
  15. PKG_INSTALL:=1
  16. PKG_FIXUP:=autoreconf
  17. PKG_BUILD_PARALLEL:=1
  18. PKG_LICENSE:=GPL-2.0
  19. include $(INCLUDE_DIR)/package.mk
  20. define Package/openvpn/Default
  21. TITLE:=Open source VPN solution using $(2)
  22. SECTION:=net
  23. CATEGORY:=Network
  24. URL:=http://openvpn.net
  25. SUBMENU:=VPN
  26. MENU:=1
  27. DEPENDS:=+kmod-tun +OPENVPN_$(1)_ENABLE_LZO:liblzo +OPENVPN_$(1)_ENABLE_IPROUTE2:ip $(3)
  28. VARIANT:=$(1)
  29. MAINTAINER:=Mirko Vogt <mirko@openwrt.org>
  30. endef
  31. Package/openvpn-openssl=$(call Package/openvpn/Default,openssl,OpenSSL,+libopenssl)
  32. Package/openvpn-polarssl=$(call Package/openvpn/Default,polarssl,PolarSSL,+libpolarssl)
  33. Package/openvpn-nossl=$(call Package/openvpn/Default,nossl,plaintext (no SSL))
  34. define Package/openvpn/config/Default
  35. source "$(SOURCE)/Config-$(1).in"
  36. endef
  37. Package/openvpn-openssl/config=$(call Package/openvpn/config/Default,openssl)
  38. Package/openvpn-polarssl/config=$(call Package/openvpn/config/Default,polarssl)
  39. Package/openvpn-nossl/config=$(call Package/openvpn/config/Default,nossl)
  40. ifeq ($(BUILD_VARIANT),polarssl)
  41. CONFIG_OPENVPN_POLARSSL:=y
  42. endif
  43. ifeq ($(BUILD_VARIANT),openssl)
  44. CONFIG_OPENVPN_OPENSSL:=y
  45. endif
  46. ifeq ($(BUILD_VARIANT),nossl)
  47. CONFIG_OPENVPN_NOSSL:=y
  48. endif
  49. CONFIGURE_VARS += \
  50. IFCONFIG=/sbin/ifconfig \
  51. ROUTE=/sbin/route \
  52. IPROUTE=/sbin/ip \
  53. NETSTAT=/sbin/netstat
  54. define Build/Configure
  55. $(call Build/Configure/Default, \
  56. $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_SMALL),--enable-small) \
  57. --disable-selinux \
  58. --disable-systemd \
  59. --disable-plugins \
  60. --disable-debug \
  61. --disable-pkcs11 \
  62. $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_LZO),--enable,--disable)-lzo \
  63. $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_X509_ALT_USERNAME),enable,disable-x509-alt-username)-ssl \
  64. $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_SERVER),--enable,--disable)-server \
  65. $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_MANAGEMENT),--enable,--disable)-management \
  66. $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_SOCKS),--enable,--disable)-socks \
  67. $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_HTTP),--enable,--disable)-http-proxy \
  68. $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_FRAGMENT),--enable,--disable)-fragment \
  69. $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_MULTIHOME),--enable,--disable)-multihome \
  70. $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_IPROUTE2),--enable,--disable)-iproute2 \
  71. $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_DEF_AUTH),--enable,--disable)-def-auth \
  72. $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_PF),--enable,--disable)-pf \
  73. $(if $(CONFIG_OPENVPN_NOSSL),--disable-ssl --disable-crypto,--enable-ssl --enable-crypto) \
  74. $(if $(CONFIG_OPENVPN_OPENSSL),--with-crypto-library=openssl) \
  75. $(if $(CONFIG_OPENVPN_POLARSSL),--with-crypto-library=polarssl) \
  76. )
  77. endef
  78. define Package/openvpn-$(BUILD_VARIANT)/conffiles
  79. /etc/config/openvpn
  80. endef
  81. define Package/openvpn-$(BUILD_VARIANT)/install
  82. $(INSTALL_DIR) \
  83. $(1)/usr/sbin \
  84. $(1)/etc/init.d \
  85. $(1)/etc/config \
  86. $(1)/etc/openvpn \
  87. $(1)/lib/upgrade/keep.d
  88. $(INSTALL_BIN) \
  89. $(PKG_INSTALL_DIR)/usr/sbin/openvpn \
  90. $(1)/usr/sbin/
  91. $(INSTALL_BIN) \
  92. files/openvpn.init \
  93. $(1)/etc/init.d/openvpn
  94. $(INSTALL_CONF) files/openvpn.config \
  95. $(1)/etc/config/openvpn
  96. $(INSTALL_DATA) \
  97. files/openvpn.upgrade \
  98. $(1)/lib/upgrade/keep.d/openvpn
  99. endef
  100. $(eval $(call BuildPackage,openvpn-openssl))
  101. $(eval $(call BuildPackage,openvpn-polarssl))
  102. $(eval $(call BuildPackage,openvpn-nossl))