You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
2.0 KiB

  1. # Copyright 2017-2018 Stan Grishin (stangri@melmac.net)
  2. # This is free software, licensed under the GNU General Public License v3.
  3. include $(TOPDIR)/rules.mk
  4. PKG_NAME:=vpnbypass
  5. PKG_VERSION:=1.3.1
  6. PKG_RELEASE:=5
  7. PKG_LICENSE:=GPL-3.0-or-later
  8. PKG_MAINTAINER:=Stan Grishin <stangri@melmac.net>
  9. include $(INCLUDE_DIR)/package.mk
  10. define Package/vpnbypass
  11. SECTION:=net
  12. CATEGORY:=Network
  13. DEPENDS:=+ipset +iptables
  14. CONFLICTS:=vpn-policy-routing
  15. TITLE:=VPN Bypass Service
  16. PKGARCH:=all
  17. endef
  18. define Package/vpnbypass/description
  19. This service can be used to enable simple VPN split tunnelling.
  20. Supports accessing domains, IP ranges outside of your VPN tunnel.
  21. Also supports dedicating local ports/IP ranges for direct
  22. internet access (outside of your VPN tunnel).
  23. Please see the README for further information.
  24. endef
  25. define Package/vpnbypass/conffiles
  26. /etc/config/vpnbypass
  27. endef
  28. define Build/Prepare
  29. mkdir -p $(PKG_BUILD_DIR)/files/
  30. $(CP) ./files/vpnbypass.init $(PKG_BUILD_DIR)/files/vpnbypass.init
  31. sed -i "s|^\(PKG_VERSION\).*|\1='$(PKG_VERSION)-$(PKG_RELEASE)'|" $(PKG_BUILD_DIR)/files/vpnbypass.init
  32. endef
  33. define Build/Configure
  34. endef
  35. define Build/Compile
  36. endef
  37. define Package/vpnbypass/install
  38. $(INSTALL_DIR) $(1)/etc/init.d
  39. $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/vpnbypass.init $(1)/etc/init.d/vpnbypass
  40. $(INSTALL_DIR) $(1)/etc/config
  41. $(INSTALL_CONF) ./files/vpnbypass.conf $(1)/etc/config/vpnbypass
  42. $(INSTALL_DIR) $(1)/etc/hotplug.d/firewall
  43. $(INSTALL_DATA) ./files/vpnbypass.hotplug $(1)/etc/hotplug.d/firewall/94-vpnbypass
  44. endef
  45. define Package/vpnbypass/postinst
  46. #!/bin/sh
  47. # check if we are on real system
  48. if [ -z "$${IPKG_INSTROOT}" ]; then
  49. /etc/init.d/vpnbypass enable
  50. fi
  51. exit 0
  52. endef
  53. define Package/vpnbypass/prerm
  54. #!/bin/sh
  55. # check if we are on real system
  56. if [ -z "$${IPKG_INSTROOT}" ]; then
  57. echo "Stopping service and removing rc.d symlink for vpnbypass"
  58. /etc/init.d/vpnbypass stop || true
  59. /etc/init.d/vpnbypass disable || true
  60. fi
  61. exit 0
  62. endef
  63. $(eval $(call BuildPackage,vpnbypass))