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.

85 lines
2.0 KiB

  1. #
  2. # Copyright (C) 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:=sqm-scripts
  9. PKG_SOURCE_VERSION:=ab763cba8b1516b3afa99760e0ca884f8b8d93b8
  10. PKG_VERSION:=1.4.0
  11. PKG_RELEASE:=4
  12. PKG_SOURCE_PROTO:=git
  13. PKG_SOURCE_URL:=https://github.com/tohojo/sqm-scripts
  14. PKG_MIRROR_HASH:=43f59dd4c74c5f1634498c18e370c5185110be1084597df37773cecf306e3a24
  15. PKG_MAINTAINER:=Toke Høiland-Jørgensen <toke@toke.dk>
  16. PKG_LICENSE:=GPL-2.0-only
  17. include $(INCLUDE_DIR)/package.mk
  18. define Package/sqm-scripts
  19. SECTION:=net
  20. CATEGORY:=Base system
  21. DEPENDS:=+tc +kmod-sched-core +kmod-sched-cake +kmod-ifb +iptables \
  22. +iptables-mod-ipopt +iptables-mod-conntrack-extra
  23. TITLE:=SQM Scripts (QoS)
  24. PKGARCH:=all
  25. endef
  26. define Package/sqm-scripts/description
  27. A set of scripts that does simple SQM configuration.
  28. endef
  29. define Package/sqm-scripts/conffiles
  30. /etc/config/sqm
  31. /etc/sqm/sqm.conf
  32. endef
  33. define Package/sqm-scripts/install
  34. make -C $(PKG_BUILD_DIR) DESTDIR=$(1) PLATFORM=openwrt install
  35. endef
  36. define Package/luci-app-sqm
  37. SECTION:=luci
  38. CATEGORY:=LuCI
  39. TITLE:=SQM Scripts - LuCI interface
  40. PKGARCH:=all
  41. DEPENDS:=+luci-compat +sqm-scripts
  42. SUBMENU:=3. Applications
  43. endef
  44. define Package/luci-app-sqm/description
  45. Luci interface for the SQM scripts queue management configuration package.
  46. endef
  47. define Package/luci-app-sqm/install
  48. make -C $(PKG_BUILD_DIR) DESTDIR=$(1) PLATFORM=openwrt install-luci
  49. endef
  50. define Package/luci-app-sqm/postinst
  51. #!/bin/sh
  52. which uci > /dev/null || exit 0
  53. uci -q get ucitrack.@sqm[0] > /dev/null || {
  54. uci add ucitrack sqm > /dev/null
  55. uci set ucitrack.@sqm[0].init=sqm
  56. uci add_list ucitrack.@firewall[0].affects=sqm
  57. uci commit
  58. }
  59. endef
  60. define Package/luci-app-sqm/postrm
  61. #!/bin/sh
  62. which uci > /dev/null || exit 0
  63. uci -q get ucitrack.@sqm[0] > /dev/null && {
  64. uci delete ucitrack.@sqm[0]
  65. uci del_list ucitrack.@firewall[0].affects=sqm
  66. uci commit
  67. } || exit 0
  68. endef
  69. $(eval $(call BuildPackage,sqm-scripts))
  70. $(eval $(call BuildPackage,luci-app-sqm))