ucode: introduce package
[openwrt/openwrt.git] / package / utils / ucode / Makefile
1 #
2 # Copyright (C) 2020-2021 Jo-Philipp Wich <jo@mein.io>
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=ucode
11 PKG_RELEASE:=1
12
13 PKG_SOURCE_PROTO:=git
14 PKG_SOURCE_URL=https://github.com/jow-/ucode.git
15 PKG_SOURCE_DATE:=2021-03-19
16 PKG_SOURCE_VERSION:=4a5b9010ccc56fdf288fe758023af445feb93fad
17 PKG_MIRROR_HASH:=145a2ce69e14cae9b448de85b94c7a817ba3aea04b1611399186ad36fb88958e
18 PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
19 PKG_LICENSE:=ISC
20
21 include $(INCLUDE_DIR)/package.mk
22 include $(INCLUDE_DIR)/cmake.mk
23
24 define Package/ucode/default
25 SECTION:=utils
26 CATEGORY:=Utilities
27 TITLE:=ucode - Tiny scripting and templating language
28 endef
29
30 define Package/ucode
31 $(Package/ucode/default)
32 DEPENDS:=+libjson-c
33 endef
34
35 define Package/ucode/description
36 ucode is a tiny script interpreter featuring an ECMAScript oriented
37 script language and Jinja-inspired templating.
38 endef
39
40
41 define Package/ucode-mod-fs
42 $(Package/ucode/default)
43 TITLE+= (filesystem module)
44 DEPENDS:=ucode
45 endef
46
47 define Package/ucode-mod-fs/description
48 The filesystem plugin module allows interaction with the local file system.
49 endef
50
51
52 define Package/ucode-mod-math
53 $(Package/ucode/default)
54 TITLE+= (math module)
55 DEPENDS:=ucode
56 endef
57
58 define Package/ucode-mod-math/description
59 The math plugin provides access to various <math.h> procedures.
60 endef
61
62
63 define Package/ucode-mod-ubus
64 $(Package/ucode/default)
65 TITLE+= (ubus module)
66 DEPENDS:=ucode +libubus +libblobmsg-json
67 endef
68
69 define Package/ucode-mod-ubus/description
70 The ubus module allows ucode template scripts to enumerate and invoke ubus
71 procedures.
72 endef
73
74
75 define Package/ucode-mod-uci
76 $(Package/ucode/default)
77 TITLE+= (uci module)
78 DEPENDS:=ucode +libuci
79 endef
80
81 define Package/ucode-mod-uci/description
82 The uci module allows templates to read and modify uci configuration.
83 endef
84
85
86 define Package/ucode/install
87 $(INSTALL_DIR) $(1)/usr/bin
88 $(INSTALL_BIN) $(PKG_BUILD_DIR)/ucode $(1)/usr/bin/ucode
89 endef
90
91 define Package/ucode-mod-fs/install
92 $(INSTALL_DIR) $(1)/usr/lib/ucode
93 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/fs.so $(1)/usr/lib/ucode/
94 endef
95
96 define Package/ucode-mod-math/install
97 $(INSTALL_DIR) $(1)/usr/lib/ucode
98 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/math.so $(1)/usr/lib/ucode/
99 endef
100
101 define Package/ucode-mod-ubus/install
102 $(INSTALL_DIR) $(1)/usr/lib/ucode
103 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/ubus.so $(1)/usr/lib/ucode/
104 endef
105
106 define Package/ucode-mod-uci/install
107 $(INSTALL_DIR) $(1)/usr/lib/ucode
108 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/uci.so $(1)/usr/lib/ucode/
109 endef
110
111
112 $(eval $(call BuildPackage,ucode))
113 $(eval $(call BuildPackage,ucode-mod-fs))
114 $(eval $(call BuildPackage,ucode-mod-math))
115 $(eval $(call BuildPackage,ucode-mod-ubus))
116 $(eval $(call BuildPackage,ucode-mod-uci))