-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
62 lines (52 loc) · 1.78 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
# LuCI PeDitX Theme
# Copyright 2024 PeDitX <[email protected]>
#
# Licensed under the Apache License v2.0
# http://www.apache.org/licenses/LICENSE-2.0
include $(TOPDIR)/rules.mk
THEME_NAME:=peditx
THEME_TITLE:=PeDitX
PKG_NAME:=luci-theme-$(THEME_NAME)
PKG_VERSION:=1.2.3
PKG_RELEASE:=01
include $(INCLUDE_DIR)/package.mk
define Package/luci-theme-$(THEME_NAME)
SECTION:=luci
CATEGORY:=LuCI
SUBMENU:=4. Themes
DEPENDS:=+libc
TITLE:=LuCi Theme For OpenWrt - $(THEME_TITLE)
URL:=http://t.me/peditx
PKGARCH:=all
endef
define Build/Configure
endef
define Build/Compile
endef
define Package/luci-theme-$(THEME_NAME)/install
$(INSTALL_DIR) $(1)/etc/uci-defaults
echo "uci set luci.themes.$(THEME_TITLE)=/luci-static/$(THEME_NAME); uci commit luci" > $(1)/etc/uci-defaults/30-luci-theme-$(THEME_NAME)
$(INSTALL_DIR) $(1)/www/luci-static/$(THEME_NAME)
$(CP) -a ./luasrc/* $(1)/www/luci-static/$(THEME_NAME)/ 2>/dev/null || true
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/view/themes/$(THEME_NAME)
$(CP) -a ./template/* $(1)/usr/lib/lua/luci/view/themes/$(THEME_NAME)/ 2>/dev/null || true
$(INSTALL_DIR) $(1)/www/luci-static/resources
$(CP) -a ./js/* $(1)/www/luci-static/resources/ 2>/dev/null || true
$(INSTALL_DIR) $(1)/www/luci-static/$(THEME_NAME)
$(CP) -a ./luasrc/manifest.json $(1)/www/luci-static/$(THEME_NAME)/ 2>/dev/null || true
$(INSTALL_DIR) $(1)/etc/config
$(CP) -a ./root/etc/config/* $(1)/etc/config/ 2>/dev/null || true
endef
define Package/luci-theme-$(THEME_NAME)/postinst
#!/bin/sh
[ -n "$${IPKG_INSTROOT}" ] || {
uci get luci.themes.peditx >/dev/null 2>&1 || \
uci batch <<-EOF
set luci.themes.peditx=/luci-static/$(THEME_NAME)
set luci.main.mediaurlbase=/luci-static/$(THEME_NAME)
commit luci
EOF
}
exit 0
endef
$(eval $(call BuildPackage,luci-theme-$(THEME_NAME)))