forked from zhaojh329/oui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoui.mk
47 lines (39 loc) · 1.11 KB
/
oui.mk
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
#
# Copyright (C) 2022 Jianhui Zhao <[email protected]>
#
# This is free software, licensed under the MIT.
#
include ${CURDIR}/../../version.mk
include ${CURDIR}/../../node.mk
PKG_NAME:=$(notdir ${CURDIR})
PKG_VERSION:=$(strip $(call findrev))
PKG_RELEASE?=1
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
SECTION:=oui
CATEGORY:=Oui
SUBMENU:=Applications
TITLE:=$(APP_TITLE)
DEPENDS:=+oui-ui-core $(APP_DEPENDS)
PKGARCH:=all
endef
define Build/Prepare
$(CP) ./htdoc $(PKG_BUILD_DIR)
echo "VITE_APP_NAME=$(APP_NAME)" > $(PKG_BUILD_DIR)/htdoc/.env.local
$(NPM) --prefix $(PKG_BUILD_DIR)/htdoc install
endef
define Build/Compile
$(NPM) --prefix $(PKG_BUILD_DIR)/htdoc run build
endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/www/views
$(CP) $(PKG_BUILD_DIR)//htdoc/dist/* $(1)/www/views
if [ -f ./files/menu.json ]; then \
$(INSTALL_DIR) $(1)/usr/share/oui/menu.d; \
$(INSTALL_CONF) ./files/menu.json $(1)/usr/share/oui/menu.d/$(APP_NAME).json; \
fi
if [ -d ./files/rpc ]; then \
$(CP) ./files/rpc $(1)/usr/share/oui/rpc; \
fi
endef
$(eval $(call BuildPackage,$(PKG_NAME)))