Makefile 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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.7
  10. PKG_RELEASE:=1
  11. PKG_SOURCE_URL:=http://swupdate.openvpn.net/community/releases
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  13. PKG_MD5SUM:=070bca95e478f88dff9ec6a221e2c3f7
  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=/usr/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-eurephia \
  62. --disable-pkcs11 \
  63. --enable-password-save \
  64. $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_LZO),--enable,--disable)-lzo \
  65. $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_X509_ALT_USERNAME),enable,disable-x509-alt-username)-ssl \
  66. $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_SERVER),--enable,--disable)-server \
  67. $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_MANAGEMENT),--enable,--disable)-management \
  68. $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_SOCKS),--enable,--disable)-socks \
  69. $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_HTTP),--enable,--disable)-http \
  70. $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_FRAGMENT),--enable,--disable)-fragment \
  71. $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_MULTIHOME),--enable,--disable)-multihome \
  72. $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_IPROUTE2),--enable,--disable)-iproute2 \
  73. $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_DEF_AUTH),--enable,--disable)-def-auth \
  74. $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_PF),--enable,--disable)-pf \
  75. $(if $(CONFIG_OPENVPN_NOSSL),--disable-ssl --disable-crypto,--enable-ssl --enable-crypto) \
  76. $(if $(CONFIG_OPENVPN_OPENSSL),--with-crypto-library=openssl) \
  77. $(if $(CONFIG_OPENVPN_POLARSSL),--with-crypto-library=polarssl) \
  78. )
  79. endef
  80. define Package/openvpn-$(BUILD_VARIANT)/conffiles
  81. /etc/config/openvpn
  82. endef
  83. define Package/openvpn-$(BUILD_VARIANT)/install
  84. $(INSTALL_DIR) \
  85. $(1)/usr/sbin \
  86. $(1)/etc/init.d \
  87. $(1)/etc/config \
  88. $(1)/etc/openvpn \
  89. $(1)/lib/upgrade/keep.d
  90. $(INSTALL_BIN) \
  91. $(PKG_INSTALL_DIR)/usr/sbin/openvpn \
  92. $(1)/usr/sbin/
  93. $(INSTALL_BIN) \
  94. files/openvpn.init \
  95. $(1)/etc/init.d/openvpn
  96. $(INSTALL_CONF) files/openvpn.config \
  97. $(1)/etc/config/openvpn
  98. $(INSTALL_DATA) \
  99. files/openvpn.upgrade \
  100. $(1)/lib/upgrade/keep.d/openvpn
  101. endef
  102. $(eval $(call BuildPackage,openvpn-openssl))
  103. $(eval $(call BuildPackage,openvpn-polarssl))
  104. $(eval $(call BuildPackage,openvpn-nossl))