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.

75 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:=9
  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. TITLE:=VPN Bypass Service
  14. DEPENDS:=+ipset +iptables
  15. PKGARCH:=all
  16. endef
  17. define Package/vpnbypass/description
  18. This service can be used to enable simple VPN split tunnelling.
  19. Supports accessing domains, IP ranges outside of your VPN tunnel.
  20. Also supports dedicating local ports/IP ranges for direct
  21. internet access (outside of your VPN tunnel).
  22. Please see the README for further information.
  23. endef
  24. define Package/vpnbypass/conffiles
  25. /etc/config/vpnbypass
  26. endef
  27. define Build/Prepare
  28. mkdir -p $(PKG_BUILD_DIR)/files/
  29. $(CP) ./files/vpnbypass.init $(PKG_BUILD_DIR)/files/vpnbypass.init
  30. sed -i "s|^\(PKG_VERSION\).*|\1='$(PKG_VERSION)-$(PKG_RELEASE)'|" $(PKG_BUILD_DIR)/files/vpnbypass.init
  31. endef
  32. define Build/Configure
  33. endef
  34. define Build/Compile
  35. endef
  36. define Package/vpnbypass/install
  37. $(INSTALL_DIR) $(1)/etc/init.d
  38. $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/vpnbypass.init $(1)/etc/init.d/vpnbypass
  39. $(INSTALL_DIR) $(1)/etc/config
  40. $(INSTALL_CONF) ./files/vpnbypass.conf $(1)/etc/config/vpnbypass
  41. $(INSTALL_DIR) $(1)/etc/hotplug.d/firewall
  42. $(INSTALL_DATA) ./files/vpnbypass.hotplug $(1)/etc/hotplug.d/firewall/94-vpnbypass
  43. endef
  44. define Package/vpnbypass/postinst
  45. #!/bin/sh
  46. # check if we are on real system
  47. if [ -z "$${IPKG_INSTROOT}" ]; then
  48. /etc/init.d/vpnbypass enable
  49. fi
  50. exit 0
  51. endef
  52. define Package/vpnbypass/prerm
  53. #!/bin/sh
  54. # check if we are on real system
  55. if [ -z "$${IPKG_INSTROOT}" ]; then
  56. echo "Stopping service and removing rc.d symlink for vpnbypass"
  57. /etc/init.d/vpnbypass stop || true
  58. /etc/init.d/vpnbypass disable || true
  59. fi
  60. exit 0
  61. endef
  62. $(eval $(call BuildPackage,vpnbypass))