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.

111 lines
2.6 KiB

  1. #
  2. # Copyright (C) 2006-2014 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:=mwan3
  9. PKG_VERSION:=2.10.3
  10. PKG_RELEASE:=1
  11. PKG_MAINTAINER:=Florian Eckert <fe@dev.tdt.de>
  12. PKG_LICENSE:=GPL-2.0
  13. PKG_CONFIG_DEPENDS:=CONFIG_IPV6
  14. include $(INCLUDE_DIR)/package.mk
  15. define Package/mwan3
  16. SECTION:=net
  17. CATEGORY:=Network
  18. SUBMENU:=Routing and Redirection
  19. DEPENDS:= \
  20. +ip \
  21. +ipset \
  22. +iptables \
  23. +iptables-mod-conntrack-extra \
  24. +iptables-mod-ipopt \
  25. +jshn
  26. TITLE:=Multiwan hotplug script with connection tracking support
  27. MAINTAINER:=Florian Eckert <fe@dev.tdt.de>
  28. PKGARCH:=all
  29. endef
  30. define Package/mwan3/description
  31. Hotplug script which makes configuration of multiple WAN interfaces simple
  32. and manageable. With loadbalancing/failover support for up to 250 wan
  33. interfaces, connection tracking and an easy to manage traffic ruleset.
  34. endef
  35. define Package/mwan3/conffiles
  36. /etc/config/mwan3
  37. /etc/mwan3.user
  38. endef
  39. define Package/mwan3/postinst
  40. #!/bin/sh
  41. if [ -z "$${IPKG_INSTROOT}" ]; then
  42. /etc/init.d/rpcd restart
  43. fi
  44. exit 0
  45. endef
  46. define Package/mwan3/postrm
  47. #!/bin/sh
  48. if [ -z "$${IPKG_INSTROOT}" ]; then
  49. /etc/init.d/rpcd restart
  50. fi
  51. exit 0
  52. endef
  53. define Build/Compile
  54. $(TARGET_CC) $(CFLAGS) $(LDFLAGS) $(FPIC) \
  55. -shared \
  56. -o $(PKG_BUILD_DIR)/libwrap_mwan3_sockopt.so.1.0 \
  57. $(if $(CONFIG_IPV6),-DCONFIG_IPV6) \
  58. $(PKG_BUILD_DIR)/sockopt_wrap.c \
  59. -ldl
  60. endef
  61. define Package/mwan3/install
  62. $(INSTALL_DIR) $(1)/etc/config
  63. $(INSTALL_CONF) ./files/etc/config/mwan3 \
  64. $(1)/etc/config/
  65. $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
  66. $(INSTALL_DATA) ./files/etc/hotplug.d/iface/15-mwan3 \
  67. $(1)/etc/hotplug.d/iface/
  68. $(INSTALL_DATA) ./files/etc/hotplug.d/iface/16-mwan3-user \
  69. $(1)/etc/hotplug.d/iface/
  70. $(INSTALL_DIR) $(1)/etc/init.d
  71. $(INSTALL_BIN) ./files/etc/init.d/mwan3 \
  72. $(1)/etc/init.d/
  73. $(INSTALL_DIR) $(1)/lib/mwan3
  74. $(INSTALL_DATA) ./files/lib/mwan3/common.sh \
  75. $(1)/lib/mwan3/
  76. $(INSTALL_DATA) ./files/lib/mwan3/mwan3.sh \
  77. $(1)/lib/mwan3/
  78. $(INSTALL_DIR) $(1)/usr/libexec/rpcd
  79. $(INSTALL_BIN) ./files/usr/libexec/rpcd/mwan3 \
  80. $(1)/usr/libexec/rpcd/
  81. $(INSTALL_DIR) $(1)/usr/sbin
  82. $(INSTALL_BIN) ./files/usr/sbin/mwan3 \
  83. $(1)/usr/sbin/
  84. $(INSTALL_BIN) ./files/usr/sbin/mwan3rtmon \
  85. $(1)/usr/sbin/
  86. $(INSTALL_BIN) ./files/usr/sbin/mwan3track \
  87. $(1)/usr/sbin/
  88. $(CP) $(PKG_BUILD_DIR)/libwrap_mwan3_sockopt.so.1.0 $(1)/lib/mwan3/
  89. $(INSTALL_DIR) $(1)/etc/uci-defaults
  90. $(INSTALL_DATA) ./files/etc/uci-defaults/mwan3-migrate-flush_conntrack \
  91. $(1)/etc/uci-defaults/
  92. endef
  93. $(eval $(call BuildPackage,mwan3))