forked from skyformat99/eqos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·100 lines (82 loc) · 2.41 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#
# Copyright (C) 2006-2017 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=eqos
PKG_RELEASE:=1
LUCI_DIR:=/usr/lib/lua/luci
PKG_MAINTAINER:=Jianhui Zhao <[email protected]>
include $(INCLUDE_DIR)/package.mk
define Package/eqos
SECTION:=net
CATEGORY:=Network
DEPENDS:=+tc +kmod-sched-core +kmod-ifb
TITLE:=Easy QoS(Support speed limit based on IP address)
PKGARCH:=all
endef
define Package/luci-app-eqos
SECTION:=luci
CATEGORY:=LuCI
TITLE:=EQOS - LuCI interface
PKGARCH:=all
DEPENDS:=+luci-base +eqos
SUBMENU:=3. Applications
endef
define Package/luci-app-eqos/description
Luci interface for the eqos.
endef
define Package/luci-i18n-eqos-zh-cn
SECTION:=luci
CATEGORY:=LuCI
TITLE:=luci-app-eqos - zh-cn translation
HIDDEN:=1
DEPENDS:=luci-app-eqos
DEFAULT:=LUCI_LANG_zh-cn
PKGARCH:=all
endef
define Build/Prepare
endef
define Build/Configure
endef
define Build/Compile
endef
define Package/eqos/install
$(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/config $(1)/etc/init.d $(1)/etc/hotplug.d/iface
$(INSTALL_BIN) ./files/eqos.sh $(1)/usr/sbin/eqos
$(INSTALL_BIN) ./files/eqos.init $(1)/etc/init.d/eqos
$(INSTALL_BIN) ./files/eqos.hotplug $(1)/etc/hotplug.d/iface/10-eqos
$(INSTALL_CONF) ./files/eqos.config $(1)/etc/config/eqos
endef
define Package/luci-app-eqos/install
$(INSTALL_DIR) $(1)$(LUCI_DIR)/controller $(1)$(LUCI_DIR)/model/cbi $(1)$(LUCI_DIR)/i18n $(1)/etc/uci-defaults
$(INSTALL_DATA) ./files/eqos-controller.lua $(1)$(LUCI_DIR)/controller/eqos.lua
$(INSTALL_DATA) ./files/eqos-cbi.lua $(1)$(LUCI_DIR)/model/cbi/eqos.lua
$(INSTALL_BIN) ./files/uci-defaults-eqos $(1)/etc/uci-defaults/luci-eqos
endef
define Package/luci-app-eqos/postinst
#!/bin/sh
which uci > /dev/null || exit 0
uci -q get ucitrack.@eqos[0] > /dev/null || {
uci add ucitrack eqos > /dev/null
uci set ucitrack.@eqos[0].init=eqos
uci commit
}
endef
define Package/luci-app-eqos/postrm
#!/bin/sh
which uci > /dev/null || exit 0
uci -q get ucitrack.@eqos[0] > /dev/null && {
uci delete ucitrack.@eqos[0]
uci commit
}
endef
define Package/luci-i18n-eqos-zh-cn/install
$(INSTALL_DIR) $(1)$(LUCI_DIR)/i18n
po2lmo ./files/po/zh-cn/eqos.po $(1)$(LUCI_DIR)/i18n/eqos.zh-cn.lmo
endef
$(eval $(call BuildPackage,eqos))
$(eval $(call BuildPackage,luci-app-eqos))
$(eval $(call BuildPackage,luci-i18n-eqos-zh-cn))