f85f75332028005855189c607ebe706edf67ce05
[project/luci.git] / modules / luci-base / Makefile
1 #
2 # Copyright (C) 2022 Jo-Philipp Wich <jo@mein.io>
3 #
4 # This is free software, licensed under the Apache License, Version 2.0 .
5 #
6
7 include $(TOPDIR)/rules.mk
8
9 PKG_NAME:=luci-base
10
11 LUCI_TYPE:=mod
12 LUCI_BASENAME:=base
13
14 LUCI_TITLE:=LuCI core runtime
15 LUCI_DEPENDS:=\
16 +rpcd \
17 +rpcd-mod-file \
18 +rpcd-mod-luci \
19 +rpcd-mod-ucode \
20 +cgi-io \
21 +ucode \
22 +ucode-mod-fs \
23 +ucode-mod-uci \
24 +ucode-mod-ubus \
25 +ucode-mod-math \
26 +ucode-mod-html \
27 +liblucihttp-ucode
28
29 PKG_LICENSE:=MIT
30
31 HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)
32
33 include $(INCLUDE_DIR)/host-build.mk
34
35 define Package/luci-base/conffiles
36 /etc/luci-uploads
37 /etc/config/luci
38 /etc/config/ucitrack
39 endef
40
41 define Package/luci-base/postinst
42 #!/bin/sh
43
44 if [ -z "$${PKG_INSTROOT}" ] && [ -f /etc/config/uhttpd ]; then
45 if ! uci -q get uhttpd.main.ucode_prefix | grep -sq /cgi-bin/luci; then
46 uci add_list uhttpd.main.ucode_prefix='/cgi-bin/luci=/usr/share/ucode/luci/uhttpd.uc'
47 uci commit uhttpd
48 service uhttpd reload
49 fi
50 fi
51
52 exit 0
53 endef
54
55 include ../../luci.mk
56
57 define Host/Configure
58 endef
59
60 define Host/Compile
61 $(MAKE) -C src/ clean po2lmo jsmin
62 endef
63
64 define Host/Install
65 $(INSTALL_DIR) $(1)/bin
66 $(INSTALL_BIN) src/po2lmo $(1)/bin/po2lmo
67 $(INSTALL_BIN) src/jsmin $(1)/bin/jsmin
68 endef
69
70 $(eval $(call HostBuild))
71
72 # call BuildPackage - OpenWrt buildroot signature