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