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
:=2022-12-02
16 PKG_SOURCE_VERSION
:=46d93c9cc5da6fce581df86159bd0fc4357de41c
17 PKG_MIRROR_HASH
:=970a47f1bef719f056d40d17398db492bd4de92b98ef9aba4582cb18b4c9b270
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
44 TITLE
:=ucode
- Tiny scripting and templating language
48 $(Package
/ucode
/default
)
52 define Package
/ucode
/description
53 ucode is a tiny script interpreter featuring an ECMAScript oriented
54 script language and Jinja-inspired templating.
58 define Package
/libucode
59 $(Package
/ucode
/default
)
60 TITLE
+= - runtime library
61 ABI_VERSION
:=$(PKG_ABI_VERSION
)
65 define Package
/libucode
/description
66 The libucode package provides the shared runtime library for the ucode interpreter.
70 define Package
/ucode-mod-fs
71 $(Package
/ucode
/default
)
72 TITLE
+= (filesystem module
)
76 define Package
/ucode-mod-fs
/description
77 The filesystem plugin module allows interaction with the local file system.
81 define Package
/ucode-mod-math
82 $(Package
/ucode
/default
)
87 define Package
/ucode-mod-math
/description
88 The math plugin provides access to various
<math.h
> procedures.
92 define Package
/ucode-mod-nl80211
93 $(Package
/ucode
/default
)
94 TITLE
+= (nl80211 module
)
95 DEPENDS
:=ucode
+libnl-tiny
98 define Package
/ucode-mod-nl80211
/description
99 The nl80211 plugin provides access to the Linux wireless
802.11 netlink API.
103 define Package
/ucode-mod-resolv
104 $(Package
/ucode
/default
)
105 TITLE
+= (resolv module
)
109 define Package
/ucode-mod-resolv
/description
110 The resolv plugin implements simple DNS resolving.
114 define Package
/ucode-mod-rtnl
115 $(Package
/ucode
/default
)
116 TITLE
+= (rtnl module
)
117 DEPENDS
:=ucode
+libnl-tiny
120 define Package
/ucode-mod-rtnl
/description
121 The rtnl plugin provides access to the Linux routing netlink API.
125 define Package
/ucode-mod-struct
126 $(Package
/ucode
/default
)
127 TITLE
+= (struct module
)
131 define Package
/ucode-mod-struct
/description
132 The struct plugin implemnts Python
3 compatible struct.pack
/unpack functionality.
136 define Package
/ucode-mod-ubus
137 $(Package
/ucode
/default
)
138 TITLE
+= (ubus module
)
139 DEPENDS
:=ucode
+libubus
+libblobmsg-json
142 define Package
/ucode-mod-ubus
/description
143 The ubus module allows ucode template scripts to enumerate and invoke ubus
148 define Package
/ucode-mod-uci
149 $(Package
/ucode
/default
)
151 DEPENDS
:=ucode
+libuci
154 define Package
/ucode-mod-uci
/description
155 The uci module allows templates to read and modify uci configuration.
159 define Package
/ucode-mod-uloop
160 $(Package
/ucode
/default
)
161 TITLE
+= (uloop module
)
162 DEPENDS
:=ucode
+libubox
165 define Package
/ucode-mod-uloop
/description
166 The uloop module allows ucode scripts to interact with OpenWrt uloop event
171 define Build
/InstallDev
172 $(INSTALL_DIR
) $(1)/usr
/lib
$(1)/usr
/include/ucode
173 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/ucode
/*.h
$(1)/usr
/include/ucode
/
174 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libucode.so
* $(1)/usr
/lib
/
178 define Package
/ucode
/install
179 $(INSTALL_DIR
) $(1)/usr
/bin
180 $(CP
) $(PKG_INSTALL_DIR
)/usr
/bin
/u
* $(1)/usr
/bin
/
183 define Package
/libucode
/install
184 $(INSTALL_DIR
) $(1)/usr
/lib
185 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libucode.so.
* $(1)/usr
/lib
/
188 define Package
/ucode-mod-fs
/install
189 $(INSTALL_DIR
) $(1)/usr
/lib
/ucode
190 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/lib
/ucode
/fs.so
$(1)/usr
/lib
/ucode
/
193 define Package
/ucode-mod-math
/install
194 $(INSTALL_DIR
) $(1)/usr
/lib
/ucode
195 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/lib
/ucode
/math.so
$(1)/usr
/lib
/ucode
/
198 define Package
/ucode-mod-nl80211
/install
199 $(INSTALL_DIR
) $(1)/usr
/lib
/ucode
200 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/lib
/ucode
/nl80211.so
$(1)/usr
/lib
/ucode
/
203 define Package
/ucode-mod-resolv
/install
204 $(INSTALL_DIR
) $(1)/usr
/lib
/ucode
205 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/lib
/ucode
/resolv.so
$(1)/usr
/lib
/ucode
/
208 define Package
/ucode-mod-rtnl
/install
209 $(INSTALL_DIR
) $(1)/usr
/lib
/ucode
210 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/lib
/ucode
/rtnl.so
$(1)/usr
/lib
/ucode
/
213 define Package
/ucode-mod-struct
/install
214 $(INSTALL_DIR
) $(1)/usr
/lib
/ucode
215 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/lib
/ucode
/struct.so
$(1)/usr
/lib
/ucode
/
218 define Package
/ucode-mod-ubus
/install
219 $(INSTALL_DIR
) $(1)/usr
/lib
/ucode
220 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/lib
/ucode
/ubus.so
$(1)/usr
/lib
/ucode
/
223 define Package
/ucode-mod-uci
/install
224 $(INSTALL_DIR
) $(1)/usr
/lib
/ucode
225 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/lib
/ucode
/uci.so
$(1)/usr
/lib
/ucode
/
228 define Package
/ucode-mod-uloop
/install
229 $(INSTALL_DIR
) $(1)/usr
/lib
/ucode
230 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/lib
/ucode
/uloop.so
$(1)/usr
/lib
/ucode
/
233 $(eval
$(call BuildPackage
,libucode
))
234 $(eval
$(call BuildPackage
,ucode
))
235 $(eval
$(call BuildPackage
,ucode-mod-fs
))
236 $(eval
$(call BuildPackage
,ucode-mod-math
))
237 $(eval
$(call BuildPackage
,ucode-mod-nl80211
))
238 $(eval
$(call BuildPackage
,ucode-mod-resolv
))
239 $(eval
$(call BuildPackage
,ucode-mod-rtnl
))
240 $(eval
$(call BuildPackage
,ucode-mod-struct
))
241 $(eval
$(call BuildPackage
,ucode-mod-ubus
))
242 $(eval
$(call BuildPackage
,ucode-mod-uci
))
243 $(eval
$(call BuildPackage
,ucode-mod-uloop
))
244 $(eval
$(call HostBuild
))