sqm-scripts: luci-app-sqm: init ucitrack with uci-defaults
authorYousong Zhou <yszhou4tech@gmail.com>
Sun, 1 Mar 2020 05:24:08 +0000 (13:24 +0800)
committerYousong Zhou <yszhou4tech@gmail.com>
Sun, 1 Mar 2020 05:53:19 +0000 (13:53 +0800)
To avoid build failure when luci-app-sqm is selected as builtin where
the ipk will be installed on build machine

While at it, switch to using $(MAKE) instead of plain "make"

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
net/sqm-scripts/Makefile
net/sqm-scripts/files/luci-app-sqm.defaults [new file with mode: 0644]

index 91fd8572aa33cb9af0aedf5aafd518a1e3d3b992..bab74678ee941ea91f16c6316ea540a9850f0d60 100644 (file)
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=sqm-scripts
 PKG_SOURCE_VERSION:=ab763cba8b1516b3afa99760e0ca884f8b8d93b8
 PKG_VERSION:=1.4.0
-PKG_RELEASE:=4
+PKG_RELEASE:=5
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/tohojo/sqm-scripts
@@ -57,18 +57,9 @@ define Package/luci-app-sqm/description
 endef
 
 define Package/luci-app-sqm/install
-       make -C $(PKG_BUILD_DIR) DESTDIR=$(1) PLATFORM=openwrt install-luci
-endef
-
-define Package/luci-app-sqm/postinst
-#!/bin/sh
-which uci > /dev/null || exit 0
-uci -q get ucitrack.@sqm[0] > /dev/null || {
-  uci add ucitrack sqm > /dev/null
-  uci set ucitrack.@sqm[0].init=sqm
-  uci add_list ucitrack.@firewall[0].affects=sqm
-  uci commit
-}
+       $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR=$(1) PLATFORM=openwrt install-luci
+       $(INSTALL_DIR) $(1)/etc/uci-defaults
+       $(INSTALL_BIN) ./files/luci-app-sqm.defaults $(1)/etc/uci-defaults
 endef
 
 define Package/luci-app-sqm/postrm
diff --git a/net/sqm-scripts/files/luci-app-sqm.defaults b/net/sqm-scripts/files/luci-app-sqm.defaults
new file mode 100644 (file)
index 0000000..117a117
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+uci -q get ucitrack.@sqm[0] >/dev/null || {
+       uci add ucitrack sqm > /dev/null
+       uci set ucitrack.@sqm[0].init=sqm
+       uci add_list ucitrack.@firewall[0].affects=sqm
+       uci commit
+}