2672f46e17382ca844eba0de21cd4a0fec6b57a1
[openwrt/staging/jow.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:=2022-05-31
16 PKG_SOURCE_VERSION:=ae62d7224c70d202a3d0ee3eecc25eb6551c92ef
17 PKG_MIRROR_HASH:=11e28bf90c122d07d02e92fdf10d2aad68b62f4ed1b383eb820a5a384d97adce
18 PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
19 PKG_LICENSE:=ISC
20
21 PKG_ABI_VERSION:=20220322
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-nl80211
80 $(Package/ucode/default)
81 TITLE+= (nl80211 module)
82 DEPENDS:=ucode +libnl-tiny
83 endef
84
85 define Package/ucode-mod-nl80211/description
86 The nl80211 plugin provides access to the Linux wireless 802.11 netlink API.
87 endef
88
89
90 define Package/ucode-mod-resolv
91 $(Package/ucode/default)
92 TITLE+= (resolv module)
93 DEPENDS:=ucode
94 endef
95
96 define Package/ucode-mod-resolv/description
97 The resolv plugin implements simple DNS resolving.
98 endef
99
100
101 define Package/ucode-mod-rtnl
102 $(Package/ucode/default)
103 TITLE+= (rtnl module)
104 DEPENDS:=ucode +libnl-tiny
105 endef
106
107 define Package/ucode-mod-rtnl/description
108 The rtnl plugin provides access to the Linux routing netlink API.
109 endef
110
111
112 define Package/ucode-mod-struct
113 $(Package/ucode/default)
114 TITLE+= (struct module)
115 DEPENDS:=ucode
116 endef
117
118 define Package/ucode-mod-struct/description
119 The struct plugin implemnts Python 3 compatible struct.pack/unpack functionality.
120 endef
121
122
123 define Package/ucode-mod-ubus
124 $(Package/ucode/default)
125 TITLE+= (ubus module)
126 DEPENDS:=ucode +libubus +libblobmsg-json
127 endef
128
129 define Package/ucode-mod-ubus/description
130 The ubus module allows ucode template scripts to enumerate and invoke ubus
131 procedures.
132 endef
133
134
135 define Package/ucode-mod-uci
136 $(Package/ucode/default)
137 TITLE+= (uci module)
138 DEPENDS:=ucode +libuci
139 endef
140
141 define Package/ucode-mod-uci/description
142 The uci module allows templates to read and modify uci configuration.
143 endef
144
145
146 define Build/InstallDev
147 $(INSTALL_DIR) $(1)/usr/lib $(1)/usr/include/ucode
148 $(CP) $(PKG_INSTALL_DIR)/usr/include/ucode/*.h $(1)/usr/include/ucode/
149 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libucode.so* $(1)/usr/lib/
150 endef
151
152
153 define Package/ucode/install
154 $(INSTALL_DIR) $(1)/usr/bin
155 $(CP) $(PKG_INSTALL_DIR)/usr/bin/u* $(1)/usr/bin/
156 endef
157
158 define Package/libucode/install
159 $(INSTALL_DIR) $(1)/usr/lib
160 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libucode.so.* $(1)/usr/lib/
161 endef
162
163 define Package/ucode-mod-fs/install
164 $(INSTALL_DIR) $(1)/usr/lib/ucode
165 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/fs.so $(1)/usr/lib/ucode/
166 endef
167
168 define Package/ucode-mod-math/install
169 $(INSTALL_DIR) $(1)/usr/lib/ucode
170 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/math.so $(1)/usr/lib/ucode/
171 endef
172
173 define Package/ucode-mod-nl80211/install
174 $(INSTALL_DIR) $(1)/usr/lib/ucode
175 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/nl80211.so $(1)/usr/lib/ucode/
176 endef
177
178 define Package/ucode-mod-resolv/install
179 $(INSTALL_DIR) $(1)/usr/lib/ucode
180 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/resolv.so $(1)/usr/lib/ucode/
181 endef
182
183 define Package/ucode-mod-rtnl/install
184 $(INSTALL_DIR) $(1)/usr/lib/ucode
185 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/rtnl.so $(1)/usr/lib/ucode/
186 endef
187
188 define Package/ucode-mod-struct/install
189 $(INSTALL_DIR) $(1)/usr/lib/ucode
190 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/struct.so $(1)/usr/lib/ucode/
191 endef
192
193 define Package/ucode-mod-ubus/install
194 $(INSTALL_DIR) $(1)/usr/lib/ucode
195 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/ubus.so $(1)/usr/lib/ucode/
196 endef
197
198 define Package/ucode-mod-uci/install
199 $(INSTALL_DIR) $(1)/usr/lib/ucode
200 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/uci.so $(1)/usr/lib/ucode/
201 endef
202
203
204 $(eval $(call BuildPackage,libucode))
205 $(eval $(call BuildPackage,ucode))
206 $(eval $(call BuildPackage,ucode-mod-fs))
207 $(eval $(call BuildPackage,ucode-mod-math))
208 $(eval $(call BuildPackage,ucode-mod-nl80211))
209 $(eval $(call BuildPackage,ucode-mod-resolv))
210 $(eval $(call BuildPackage,ucode-mod-rtnl))
211 $(eval $(call BuildPackage,ucode-mod-struct))
212 $(eval $(call BuildPackage,ucode-mod-ubus))
213 $(eval $(call BuildPackage,ucode-mod-uci))