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.

67 lines
1.6 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:=luci-app-sqm
  9. PKG_VERSION:=3
  10. PKG_RELEASE:=5
  11. PKG_LICENSE:=GPLv2
  12. LUCI_DIR:=/usr/lib/lua/luci
  13. include $(INCLUDE_DIR)/package.mk
  14. define Package/luci-app-sqm
  15. SECTION:=luci
  16. CATEGORY:=LuCI
  17. TITLE:=SQM Scripts - LuCI interface
  18. MAINTAINER:=Toke Høiland-Jørgensen <toke@toke.dk>
  19. PKGARCH:=all
  20. DEPENDS:= lua luci-base +sqm-scripts
  21. SUBMENU:=3. Applications
  22. endef
  23. define Package/luci-app-sqm/description
  24. Control the simple_qos SQM script
  25. endef
  26. define Build/Compile
  27. endef
  28. define Build/Configure
  29. endef
  30. define Package/luci-app-sqm/install
  31. $(INSTALL_DIR) $(1)$(LUCI_DIR)/controller $(1)$(LUCI_DIR)/model/cbi
  32. $(INSTALL_DATA) ./files/sqm-controller.lua $(1)$(LUCI_DIR)/controller/sqm.lua
  33. $(INSTALL_DATA) ./files/sqm-cbi.lua $(1)$(LUCI_DIR)/model/cbi/sqm.lua
  34. $(INSTALL_DIR) $(1)/etc/uci-defaults
  35. $(INSTALL_BIN) ./files/uci-defaults-sqm $(1)/etc/uci-defaults/luci-sqm
  36. endef
  37. define Package/luci-app-sqm/postinst
  38. #!/bin/sh
  39. which uci > /dev/null || exit 0
  40. uci -q get ucitrack.@sqm[0] > /dev/null || {
  41. uci add ucitrack sqm > /dev/null
  42. uci set ucitrack.@sqm[0].init=sqm
  43. uci add_list ucitrack.@firewall[0].affects=sqm
  44. uci commit
  45. }
  46. endef
  47. define Package/luci-app-sqm/postrm
  48. #!/bin/sh
  49. which uci > /dev/null || exit 0
  50. uci -q get ucitrack.@sqm[0] > /dev/null && {
  51. uci delete ucitrack.@sqm[0]
  52. uci del_list ucitrack.@firewall[0].affects=sqm
  53. uci commit
  54. }
  55. endef
  56. $(eval $(call BuildPackage,luci-app-sqm))