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.

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