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.

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