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.

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