summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/Makefile
blob: 3b3a0a4e5b9fe2651f41422e118b402316105e14 (plain)
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
#
# Copyright (C) 2022 Jo-Philipp Wich <jo@mein.io>
#
# This is free software, licensed under the Apache License, Version 2.0 .
#

include $(TOPDIR)/rules.mk

PKG_NAME:=luci-base
PKG_BUILD_FLAGS:=no-lto

LUCI_TYPE:=mod
LUCI_BASENAME:=base

LUCI_TITLE:=LuCI core runtime
LUCI_DEPENDS:=\
	+rpcd \
	+rpcd-mod-file \
	+rpcd-mod-luci \
	+rpcd-mod-ucode \
	+cgi-io \
	+ucode \
	+ucode-mod-fs \
	+ucode-mod-uci \
	+ucode-mod-ubus \
	+ucode-mod-math \
	+ucode-mod-html \
	+liblucihttp-ucode

PKG_LICENSE:=MIT

HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)

include $(INCLUDE_DIR)/host-build.mk

define Package/luci-base/conffiles
/etc/luci-uploads
/etc/config/luci
/etc/config/ucitrack
endef

define Package/luci-base/postinst
#!/bin/sh

if [ -z "$${PKG_INSTROOT}" ] && [ -f /etc/config/uhttpd ]; then
	if ! uci -q get uhttpd.main.ucode_prefix | grep -sq /cgi-bin/luci; then
		uci add_list uhttpd.main.ucode_prefix='/cgi-bin/luci=/usr/share/ucode/luci/uhttpd.uc'
		uci commit uhttpd
		service uhttpd reload
	fi
fi

exit 0
endef

include ../../luci.mk

define Host/Configure
endef

define Host/Compile
	$(MAKE) -C src/ clean po2lmo jsmin
endef

define Host/Install
	$(INSTALL_DIR) $(1)/bin
	$(INSTALL_BIN) src/po2lmo $(1)/bin/po2lmo
	$(INSTALL_BIN) src/jsmin $(1)/bin/jsmin
endef

$(eval $(call HostBuild))

# call BuildPackage - OpenWrt buildroot signature