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.

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