2 # Copyright (C) 2020-2021 Jo-Philipp Wich <jo@mein.io>
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
14 PKG_SOURCE_URL
=https
://github.com
/jow-
/ucode.git
15 PKG_SOURCE_DATE
:=2023-02-13
16 PKG_SOURCE_VERSION
:=ab2f3f70257d381e075b4ec58366578af861c2b0
17 PKG_MIRROR_HASH
:=ac7c88a3bd65249253740942dbc9e4d8bc6d5a5e93e48c384d31c94dc7a891f9
18 PKG_MAINTAINER
:=Jo-Philipp Wich
<jo@mein.io
>
21 PKG_ABI_VERSION
:=20220812
23 include $(INCLUDE_DIR
)/package.mk
24 include $(INCLUDE_DIR
)/host-build.mk
25 include $(INCLUDE_DIR
)/cmake.mk
27 CMAKE_OPTIONS
+= -DSOVERSION
=$(PKG_ABI_VERSION
)
28 CMAKE_HOST_OPTIONS
+= \
29 -DSOVERSION
=$(PKG_ABI_VERSION
) \
32 -DNL80211_SUPPORT
=OFF \
33 -DRESOLV_SUPPORT
=OFF \
41 define Package
/ucode
/default
45 TITLE
:=Tiny scripting and templating language
49 $(Package
/ucode
/default
)
53 define Package
/ucode
/description
54 ucode is a tiny script interpreter featuring an ECMAScript oriented
55 script language and Jinja-inspired templating.
59 define Package
/libucode
60 $(Package
/ucode
/default
)
65 ABI_VERSION
:=$(PKG_ABI_VERSION
)
69 define Package
/libucode
/description
70 The libucode package provides the shared runtime library for the ucode interpreter.
74 define Package
/ucode-mod-fs
75 $(Package
/ucode
/default
)
76 TITLE
+= (filesystem module
)
80 define Package
/ucode-mod-fs
/description
81 The filesystem plugin module allows interaction with the local file system.
85 define Package
/ucode-mod-math
86 $(Package
/ucode
/default
)
91 define Package
/ucode-mod-math
/description
92 The math plugin provides access to various
<math.h
> procedures.
96 define Package
/ucode-mod-nl80211
97 $(Package
/ucode
/default
)
98 TITLE
+= (nl80211 module
)
99 DEPENDS
:=ucode
+libnl-tiny
+libubox
102 define Package
/ucode-mod-nl80211
/description
103 The nl80211 plugin provides access to the Linux wireless
802.11 netlink API.
107 define Package
/ucode-mod-resolv
108 $(Package
/ucode
/default
)
109 TITLE
+= (resolv module
)
113 define Package
/ucode-mod-resolv
/description
114 The resolv plugin implements simple DNS resolving.
118 define Package
/ucode-mod-rtnl
119 $(Package
/ucode
/default
)
120 TITLE
+= (rtnl module
)
121 DEPENDS
:=ucode
+libnl-tiny
+libubox
124 define Package
/ucode-mod-rtnl
/description
125 The rtnl plugin provides access to the Linux routing netlink API.
129 define Package
/ucode-mod-struct
130 $(Package
/ucode
/default
)
131 TITLE
+= (struct module
)
135 define Package
/ucode-mod-struct
/description
136 The struct plugin implements Python
3 compatible struct.pack
/unpack functionality.
140 define Package
/ucode-mod-ubus
141 $(Package
/ucode
/default
)
142 TITLE
+= (ubus module
)
143 DEPENDS
:=ucode
+libubus
+libblobmsg-json
146 define Package
/ucode-mod-ubus
/description
147 The ubus module allows ucode template scripts to enumerate and invoke ubus
152 define Package
/ucode-mod-uci
153 $(Package
/ucode
/default
)
155 DEPENDS
:=ucode
+libuci
158 define Package
/ucode-mod-uci
/description
159 The uci module allows templates to read and modify uci configuration.
163 define Package
/ucode-mod-uloop
164 $(Package
/ucode
/default
)
165 TITLE
+= (uloop module
)
166 DEPENDS
:=ucode
+libubox
169 define Package
/ucode-mod-uloop
/description
170 The uloop module allows ucode scripts to interact with OpenWrt uloop event
175 define Build
/InstallDev
176 $(INSTALL_DIR
) $(1)/usr
/lib
$(1)/usr
/include/ucode
177 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/ucode
/*.h
$(1)/usr
/include/ucode
/
178 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libucode.so
* $(1)/usr
/lib
/
182 define Package
/ucode
/install
183 $(INSTALL_DIR
) $(1)/usr
/bin
184 $(CP
) $(PKG_INSTALL_DIR
)/usr
/bin
/u
* $(1)/usr
/bin
/
187 define Package
/libucode
/install
188 $(INSTALL_DIR
) $(1)/usr
/lib
189 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libucode.so.
* $(1)/usr
/lib
/
192 define Package
/ucode-mod-fs
/install
193 $(INSTALL_DIR
) $(1)/usr
/lib
/ucode
194 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/lib
/ucode
/fs.so
$(1)/usr
/lib
/ucode
/
197 define Package
/ucode-mod-math
/install
198 $(INSTALL_DIR
) $(1)/usr
/lib
/ucode
199 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/lib
/ucode
/math.so
$(1)/usr
/lib
/ucode
/
202 define Package
/ucode-mod-nl80211
/install
203 $(INSTALL_DIR
) $(1)/usr
/lib
/ucode
204 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/lib
/ucode
/nl80211.so
$(1)/usr
/lib
/ucode
/
207 define Package
/ucode-mod-resolv
/install
208 $(INSTALL_DIR
) $(1)/usr
/lib
/ucode
209 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/lib
/ucode
/resolv.so
$(1)/usr
/lib
/ucode
/
212 define Package
/ucode-mod-rtnl
/install
213 $(INSTALL_DIR
) $(1)/usr
/lib
/ucode
214 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/lib
/ucode
/rtnl.so
$(1)/usr
/lib
/ucode
/
217 define Package
/ucode-mod-struct
/install
218 $(INSTALL_DIR
) $(1)/usr
/lib
/ucode
219 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/lib
/ucode
/struct.so
$(1)/usr
/lib
/ucode
/
222 define Package
/ucode-mod-ubus
/install
223 $(INSTALL_DIR
) $(1)/usr
/lib
/ucode
224 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/lib
/ucode
/ubus.so
$(1)/usr
/lib
/ucode
/
227 define Package
/ucode-mod-uci
/install
228 $(INSTALL_DIR
) $(1)/usr
/lib
/ucode
229 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/lib
/ucode
/uci.so
$(1)/usr
/lib
/ucode
/
232 define Package
/ucode-mod-uloop
/install
233 $(INSTALL_DIR
) $(1)/usr
/lib
/ucode
234 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/lib
/ucode
/uloop.so
$(1)/usr
/lib
/ucode
/
237 $(eval
$(call BuildPackage
,libucode
))
238 $(eval
$(call BuildPackage
,ucode
))
239 $(eval
$(call BuildPackage
,ucode-mod-fs
))
240 $(eval
$(call BuildPackage
,ucode-mod-math
))
241 $(eval
$(call BuildPackage
,ucode-mod-nl80211
))
242 $(eval
$(call BuildPackage
,ucode-mod-resolv
))
243 $(eval
$(call BuildPackage
,ucode-mod-rtnl
))
244 $(eval
$(call BuildPackage
,ucode-mod-struct
))
245 $(eval
$(call BuildPackage
,ucode-mod-ubus
))
246 $(eval
$(call BuildPackage
,ucode-mod-uci
))
247 $(eval
$(call BuildPackage
,ucode-mod-uloop
))
248 $(eval
$(call HostBuild
))