ucode: update to latest Git HEAD
[openwrt/staging/noltari.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-07-30
16 PKG_SOURCE_VERSION:=929c8627cf077c3e348fb12b02553d4a444c5e48
17 PKG_MIRROR_HASH:=
18 PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
19 PKG_LICENSE:=ISC
20
21 PKG_ABI_VERSION:=20210730
22
23 include $(INCLUDE_DIR)/package.mk
24 include $(INCLUDE_DIR)/cmake.mk
25
26 CMAKE_OPTIONS += -DSOVERSION=$(PKG_ABI_VERSION)
27
28 define Package/ucode/default
29 SECTION:=utils
30 CATEGORY:=Utilities
31 TITLE:=ucode - Tiny scripting and templating language
32 endef
33
34 define Package/ucode
35 $(Package/ucode/default)
36 DEPENDS:=+libucode
37 endef
38
39 define Package/ucode/description
40 ucode is a tiny script interpreter featuring an ECMAScript oriented
41 script language and Jinja-inspired templating.
42 endef
43
44
45 define Package/libucode
46 $(Package/ucode/default)
47 TITLE+= - runtime library
48 ABI_VERSION:=$(PKG_ABI_VERSION)
49 DEPENDS:=+libjson-c
50 endef
51
52 define Package/libucode/description
53 The libucode package provides the shared runtime library for the ucode interpreter.
54 endef
55
56
57 define Package/ucode-mod-fs
58 $(Package/ucode/default)
59 TITLE+= (filesystem module)
60 DEPENDS:=ucode
61 endef
62
63 define Package/ucode-mod-fs/description
64 The filesystem plugin module allows interaction with the local file system.
65 endef
66
67
68 define Package/ucode-mod-math
69 $(Package/ucode/default)
70 TITLE+= (math module)
71 DEPENDS:=ucode
72 endef
73
74 define Package/ucode-mod-math/description
75 The math plugin provides access to various <math.h> procedures.
76 endef
77
78
79 define Package/ucode-mod-ubus
80 $(Package/ucode/default)
81 TITLE+= (ubus module)
82 DEPENDS:=ucode +libubus +libblobmsg-json
83 endef
84
85 define Package/ucode-mod-ubus/description
86 The ubus module allows ucode template scripts to enumerate and invoke ubus
87 procedures.
88 endef
89
90
91 define Package/ucode-mod-uci
92 $(Package/ucode/default)
93 TITLE+= (uci module)
94 DEPENDS:=ucode +libuci
95 endef
96
97 define Package/ucode-mod-uci/description
98 The uci module allows templates to read and modify uci configuration.
99 endef
100
101
102 define Build/InstallDev
103 $(INSTALL_DIR) $(1)/usr/lib $(1)/usr/include/ucode
104 $(CP) $(PKG_INSTALL_DIR)/usr/include/ucode/*.h $(1)/usr/include/ucode/
105 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libucode.so* $(1)/usr/lib/
106 endef
107
108
109 define Package/ucode/install
110 $(INSTALL_DIR) $(1)/usr/bin
111 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ucode $(1)/usr/bin/ucode
112 endef
113
114 define Package/libucode/install
115 $(INSTALL_DIR) $(1)/usr/lib
116 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libucode.so.* $(1)/usr/lib/
117 endef
118
119 define Package/ucode-mod-fs/install
120 $(INSTALL_DIR) $(1)/usr/lib/ucode
121 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/fs.so $(1)/usr/lib/ucode/
122 endef
123
124 define Package/ucode-mod-math/install
125 $(INSTALL_DIR) $(1)/usr/lib/ucode
126 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/math.so $(1)/usr/lib/ucode/
127 endef
128
129 define Package/ucode-mod-ubus/install
130 $(INSTALL_DIR) $(1)/usr/lib/ucode
131 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/ubus.so $(1)/usr/lib/ucode/
132 endef
133
134 define Package/ucode-mod-uci/install
135 $(INSTALL_DIR) $(1)/usr/lib/ucode
136 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/uci.so $(1)/usr/lib/ucode/
137 endef
138
139
140 $(eval $(call BuildPackage,ucode))
141 $(eval $(call BuildPackage,libucode))
142 $(eval $(call BuildPackage,ucode-mod-fs))
143 $(eval $(call BuildPackage,ucode-mod-math))
144 $(eval $(call BuildPackage,ucode-mod-ubus))
145 $(eval $(call BuildPackage,ucode-mod-uci))