d2a0e9601ff58dfe1bc5f0c4b79ad1396d648601
[feed/packages.git] / libs / elektra / Makefile
1 #
2 # Copyright (C) 2006-2016 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # No copyright by Harald Geyer as filling in a template doesn't constitute
8 # an original work in the sense of copyright law.
9
10 include $(TOPDIR)/rules.mk
11
12 PKG_MAINTAINER:=Harald Geyer <harald@ccbib.org>
13
14 PKG_NAME:=elektra
15 PKG_LICENSE:=BSD-3-Clause
16 PKG_LICENSE_FILES:=LICENSE.md
17 PKG_VERSION:=0.9.7
18 PKG_RELEASE:=4
19
20 # Use this for official releasees
21 PKG_HASH:=12b7b046004db29317b7b937dc794abf719c400ba3115af8d41849127b562681
22 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
23 PKG_SOURCE_URL:=http://ftp.libelektra.org/ftp/elektra/releases
24
25 # Use this to test versions still under development
26 #PKG_SOURCE_PROTO:=git
27 #PKG_SOURCE_URL:=https://github.com/ElektraInitiative/libelektra.git
28 #PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
29 #PKG_SOURCE_VERSION:=e97efb29a94f3a49cb952d06552fcf53708ea8c7
30 #PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
31
32 PKG_BUILD_DEPENDS:= lua
33
34 include $(INCLUDE_DIR)/package.mk
35 include $(INCLUDE_DIR)/cmake.mk
36 include $(INCLUDE_DIR)/nls.mk
37
38 define Package/libelektra/Default
39 SECTION:=libs
40 CATEGORY:=Libraries
41 TITLE:=Elektra
42 URL:=http://www.libelektra.org/
43 SUBMENU:=LibElektra
44 endef
45
46 define Package/libelektra/Default-description
47 Elektra provides an universal and secure framework to store
48 configuration parameters in a global, hierarchical key database.
49 endef
50
51 define Package/libelektra-core
52 $(call Package/libelektra/Default)
53 TITLE:=Elektra core library
54 DEPENDS:=+libpthread
55 endef
56
57 define Package/libelektra-core/description
58 $(call Package/libelektra/Default-description)
59
60 This package contains the core libraries, that all other parts of
61 elektra and all programs using elektra depend on, and an almost
62 minimal set of plugins to be actually useful.
63 endef
64
65 define Package/elektra-kdb
66 SECTION:=utils
67 CATEGORY:=Utilities
68 TITLE:=Elektra kdb tool
69 URL:=http://www.libelektra.org/
70 DEPENDS:=+libelektra-core +libstdcpp
71 endef
72
73 define Package/elektra-kdb/description
74 $(call Package/libelektra/Default-description)
75
76 This package contains the kdb tool, which allows to access and change
77 the content of the key database from the shell.
78 endef
79
80 define Package/libelektra-resolvers
81 $(call Package/libelektra/Default)
82 TITLE:=Elektra additional resolvers
83 DEPENDS:=+libelektra-core +libpthread
84 endef
85
86 define Package/libelektra-resolvers/description
87 $(call Package/libelektra/Default-description)
88
89 This package contains additional resolvers not included in the
90 libelektra-core package. Usually there is no reason to install this.
91 endef
92
93 define Package/libelektra-plugins
94 $(call Package/libelektra/Default)
95 TITLE:=Useful elektra plugins
96 DEPENDS:=+libelektra-core $(ICONV_DEPENDS)
97 endef
98
99 define CONTENT_ELEKTRA_PLUGINS_TEXT
100 base64 conditionals csvstorage date file filecheck glob hexcode
101 hexnumber hosts iconv ipaddr keytometa line lineendings list
102 mathcheck macaddr mini network path profile quickdump
103 range reference rgbcolor shell syslog type uname unit validation
104 endef
105
106 CONTENT_ELEKTRA_PLUGINS = $(strip $(CONTENT_ELEKTRA_PLUGINS_TEXT))
107
108 define Package/libelektra-plugins/description
109 $(call Package/libelektra/Default-description)
110
111 This package contains plugins for various common configuration file
112 format and optional features without heavy dependencies. Currently
113 these plugins are included:
114 $(CONTENT_ELEKTRA_PLUGINS_TEXT)
115 endef
116
117 define Package/libelektra-cpp
118 $(call Package/libelektra/Default)
119 TITLE:=Elektra plugins depending on libstdcpp
120 DEPENDS:=+libelektra-core +libstdcpp
121 endef
122
123 CONTENT_ELEKTRA_CPP=ccode directoryvalue dump
124
125 define Package/libelektra-cpp/description
126 $(call Package/libelektra/Default-description)
127
128 This package contains plugins written in C++.
129 Currently these are:
130 $(CONTENT_ELEKTRA_CPP)
131 endef
132
133 define Package/libelektra-crypto
134 $(call Package/libelektra/Default)
135 TITLE:=Elektra crypto plugin
136 DEPENDS:=+libelektra-core +libgcrypt
137 endef
138
139 define Package/libelektra-crypto/description
140 $(call Package/libelektra/Default-description)
141
142 This package contains support for encrypting values before storage.
143 endef
144
145 define Package/libelektra-curlget
146 $(call Package/libelektra/Default)
147 TITLE:=Elektra curlget plugin
148 DEPENDS:=+libelektra-core +libcurl +libopenssl
149 endef
150
151 define Package/libelektra-curlget/description
152 $(call Package/libelektra/Default-description)
153
154 This plugin can get configuration data from remote URLs before access.
155 endef
156
157 define Package/libelektra-dbus
158 $(call Package/libelektra/Default)
159 TITLE:=Elektra dbus plugin
160 DEPENDS:=+libelektra-core +libdbus
161 endef
162
163 define Package/libelektra-dbus/description
164 $(call Package/libelektra/Default-description)
165
166 This package contains support for dbus notification on configuration
167 changes.
168 endef
169
170 define Package/libelektra-ev
171 $(call Package/libelektra/Default)
172 TITLE:=Elektra libev binding plugin
173 DEPENDS:=+libelektra-core +libev
174 endef
175
176 define Package/libelektra-ev/description
177 $(call Package/libelektra/Default-description)
178
179 This package contains support for notification on configuration
180 changes via libev events.
181 endef
182
183 define Package/libelektra-uv
184 $(call Package/libelektra/Default)
185 TITLE:=Elektra libuv binding plugin
186 DEPENDS:=+libelektra-core +libuv
187 endef
188
189 define Package/libelektra-uv/description
190 $(call Package/libelektra/Default-description)
191
192 This package contains support for notification on configuration
193 changes via libuv events.
194 endef
195
196 define Package/libelektra-xerces
197 $(call Package/libelektra/Default)
198 TITLE:=Elektra xerces based xml plugin
199 DEPENDS:=+libelektra-core +libstdcpp +libxerces-c
200 endef
201
202 define Package/libelektra-xerces/description
203 $(call Package/libelektra/Default-description)
204
205 The xerces plugin supplants the xmltool plugin
206 and allows us to use XML files not following a specific schemata.
207 Attributes are mapped to Elektra's metadata, multiple keys with the
208 same names are mapped to arrays.
209 endef
210
211 define Package/libelektra-xml
212 $(call Package/libelektra/Default)
213 TITLE:=Elektra xmltool plugin
214 DEPENDS:=+libelektra-core +libxml2
215 endef
216
217 define Package/libelektra-xml/description
218 $(call Package/libelektra/Default-description)
219
220 This package contains a plugin for storing data with xml syntax.
221 endef
222
223 define Package/libelektra-yajl
224 $(call Package/libelektra/Default)
225 TITLE:=Elektra yajl (json) plugin
226 DEPENDS:=+libelektra-core +yajl
227 endef
228
229 define Package/libelektra-yajl/description
230 $(call Package/libelektra/Default-description)
231
232 This package contains support for storing the key database as json files.
233 endef
234
235 define Package/libelektra-yamlcpp
236 $(call Package/libelektra/Default)
237 TITLE:=Elektra yaml plugin
238 DEPENDS:=+libelektra-core +libyaml-cpp
239 endef
240
241 define Package/libelektra-yamlcpp/description
242 $(call Package/libelektra/Default-description)
243
244 This package contains support for storing the key database as yaml files.
245 endef
246
247 define Package/libelektra-zmq
248 $(call Package/libelektra/Default)
249 TITLE:=Elektra ZeroMQ transport plugins
250 DEPENDS:=+libelektra-core +libzmq
251 endef
252
253 define Package/libelektra-python3
254 $(call Package/libelektra/Default)
255 TITLE:=Elektra python3 plugin
256 DEPENDS:=+libelektra-core +python3-light +libstdcpp
257 endef
258
259 define Package/libelektra-python3/description
260 $(call Package/libelektra/Default-description)
261
262 This package adds python3 support to elektra.
263 endef
264
265 define Package/libelektra-lua
266 $(call Package/libelektra/Default)
267 TITLE:=Elektra lua plugin
268 DEPENDS:=+libelektra-core +lua5.3 +libstdcpp
269 endef
270
271 define Package/libelektra-lua/description
272 $(call Package/libelektra/Default-description)
273
274 This package adds lua support to elektra.
275 endef
276
277 define Package/libelektra-extra
278 $(call Package/libelektra/Default)
279 TITLE:=Additional elektra plugins
280 DEPENDS:=+libelektra-core +libstdcpp
281 endef
282
283 define CONTENT_EXTRA_PLUGINS_TEXT
284 blockresolver c constants counter desktop dpkg error fcrypt
285 fstab logchange mozprefs passwd process rename
286 timeofday tracer
287 endef
288
289 CONTENT_ELEKTRA_EXTRA:=$(strip $(CONTENT_EXTRA_PLUGINS_TEXT))
290
291 define Package/libelektra-extra/description
292 $(call Package/libelektra/Default-description)
293
294 This package contains extra plugins that are only useful for debugging
295 or as an example of what can be done. Also most experimental plugins
296 are included in this package. Currently this includes:
297 $(CONTENT_EXTRA_PLUGINS_TEXT)
298 endef
299
300 CMAKE_BINARY_SUBDIR=build
301
302 CMAKE_OPTIONS += \
303 -DTARGET_PLUGIN_FOLDER="" \
304 -DCARGO_EXECUTABLE=OFF \
305 -DBUILD_FULL=OFF \
306 -DBUILD_STATIC=OFF \
307 -DBUILD_DOCUMENTATION=OFF \
308 -DFORCE_IN_SOURCE_BUILD=ON \
309 -DBUILD_TESTING=OFF \
310 -DKDB_DEFAULT_RESOLVER=resolver_fm_pb_b \
311 -DKDB_DEFAULT_STORAGE=toml \
312 -DENABLE_OPTIMIZATIONS=OFF \
313 -DPLUGINS="ALL;-gpgme;-multifile;-simpleini" \
314 -DBINDINGS="MAINTAINED;-intercept_env;-intercept_fs;-io_glib"
315
316 define Package/libelektra-core/install
317 $(INSTALL_DIR) $(1)/etc/kdb/
318 $(INSTALL_DIR) $(1)/etc/profile.d/
319 $(INSTALL_DIR) $(1)/usr/lib/
320 $(INSTALL_DATA) files/elektra.profile $(1)/etc/profile.d/elektra.sh
321 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-core.so* $(1)/usr/lib/
322 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-ease.so* $(1)/usr/lib/
323 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-globbing.so* $(1)/usr/lib/
324 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-highlevel.so* $(1)/usr/lib/
325 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-invoke.so* $(1)/usr/lib/
326 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-io.so* $(1)/usr/lib/
327 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-kdb.so* $(1)/usr/lib/
328 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-merge.so* $(1)/usr/lib/
329 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-meta.so* $(1)/usr/lib/
330 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-notification.so* $(1)/usr/lib/
331 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-opts.so* $(1)/usr/lib/
332 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-plugin.so* $(1)/usr/lib/
333 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-pluginprocess.so* $(1)/usr/lib/
334 #The next is only supported with glibc, so skip it.
335 #$(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektraintercept-* $(1)/usr/lib/
336 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-resolver_fm_pb_b.so $(1)/usr/lib/
337 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-utility.so* $(1)/usr/lib/
338 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-cache.so $(1)/usr/lib/
339 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-internalnotification.so $(1)/usr/lib/
340 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-mmapstorage.so $(1)/usr/lib/
341 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-ni.so $(1)/usr/lib/
342 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-spec.so $(1)/usr/lib/
343 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-sync.so $(1)/usr/lib/
344 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-storage.so $(1)/usr/lib/
345 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-toml.so $(1)/usr/lib/
346 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-resolver.so $(1)/usr/lib/
347 endef
348
349 define Package/elektra-kdb/install
350 $(INSTALL_DIR) $(1)/usr/bin/
351 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/kdb $(1)/usr/bin
352 $(INSTALL_DIR) $(1)/usr/lib/elektra/
353 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektratools* $(1)/usr/lib/
354 $(CP) $(PKG_INSTALL_DIR)/usr/lib/elektra/tool_exec/ $(1)/usr/lib/elektra/
355 endef
356
357 define Package/libelektra-resolvers/install
358 $(INSTALL_DIR) $(1)/usr/lib/
359 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-resolver_* $(1)/usr/lib/
360 rm -f $(1)/usr/lib/libelektra-resolver_fm_pb_b.so
361 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-wresolver.so $(1)/usr/lib/
362 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-noresolver.so $(1)/usr/lib/
363 endef
364
365 define Package/libelektra-plugins/install
366 $(INSTALL_DIR) $(1)/usr/lib/
367 $(CP) $(foreach plugin,$(CONTENT_ELEKTRA_PLUGINS),$(PKG_INSTALL_DIR)/usr/lib/libelektra-$(plugin).so) $(1)/usr/lib/
368 endef
369
370 define Package/libelektra-cpp/install
371 $(INSTALL_DIR) $(1)/usr/lib/
372 $(CP) $(foreach plugin,$(CONTENT_ELEKTRA_CPP),$(PKG_INSTALL_DIR)/usr/lib/libelektra-$(plugin).so) $(1)/usr/lib/
373 endef
374
375 define Package/libelektra-crypto/install
376 $(INSTALL_DIR) $(1)/usr/lib/
377 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-crypto.so $(1)/usr/lib/
378 endef
379
380 define Package/libelektra-curlget/install
381 $(INSTALL_DIR) $(1)/usr/lib/
382 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-curlget.so $(1)/usr/lib/
383 endef
384
385 define Package/libelektra-dbus/install
386 $(INSTALL_DIR) $(1)/usr/lib/
387 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-dbus.so $(1)/usr/lib/
388 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-dbusrecv.so $(1)/usr/lib/
389 endef
390
391 define Package/libelektra-ev/install
392 $(INSTALL_DIR) $(1)/usr/lib/
393 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-io-ev.so $(1)/usr/lib/
394 endef
395
396 define Package/libelektra-uv/install
397 $(INSTALL_DIR) $(1)/usr/lib/
398 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-io-uv.so $(1)/usr/lib/
399 endef
400
401 define Package/libelektra-xerces/install
402 $(INSTALL_DIR) $(1)/usr/lib/
403 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-xerces.so $(1)/usr/lib/
404 endef
405
406 define Package/libelektra-xml/install
407 $(INSTALL_DIR) $(1)/usr/lib/
408 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-xmltool.so $(1)/usr/lib/
409 endef
410
411 define Package/libelektra-yajl/install
412 $(INSTALL_DIR) $(1)/usr/lib/
413 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-yajl.so $(1)/usr/lib/
414 endef
415
416 define Package/libelektra-yamlcpp/install
417 $(INSTALL_DIR) $(1)/usr/lib/
418 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-yamlcpp.so $(1)/usr/lib/
419 endef
420
421 define Package/libelektra-zmq/install
422 $(INSTALL_DIR) $(1)/usr/lib/
423 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-zeromqsend.so $(1)/usr/lib/
424 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-zeromqrecv.so $(1)/usr/lib/
425 endef
426
427 define Package/libelektra-python3/install
428 $(INSTALL_DIR) $(1)/usr/lib/
429 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-python.so $(1)/usr/lib/
430 endef
431
432 define Package/libelektra-lua/install
433 $(INSTALL_DIR) $(1)/usr/lib/
434 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-lua.so $(1)/usr/lib/
435 endef
436
437 define Package/libelektra-extra/install
438 $(INSTALL_DIR) $(1)/usr/lib/
439 $(CP) $(foreach plugin,$(CONTENT_ELEKTRA_EXTRA),$(PKG_INSTALL_DIR)/usr/lib/libelektra-$(plugin).so) $(1)/usr/lib/
440 endef
441
442 define Build/InstallDev
443 $(INSTALL_DIR) $(1)/usr/include/elektra/
444 $(CP) $(PKG_INSTALL_DIR)/usr/include/elektra/* $(1)/usr/include/elektra/
445 $(INSTALL_DIR) $(1)/usr/lib/
446 $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
447 endef
448
449 $(eval $(call BuildPackage,libelektra-core))
450 $(eval $(call BuildPackage,elektra-kdb))
451 $(eval $(call BuildPackage,libelektra-resolvers))
452 $(eval $(call BuildPackage,libelektra-plugins))
453 $(eval $(call BuildPackage,libelektra-cpp))
454 $(eval $(call BuildPackage,libelektra-curlget))
455 $(eval $(call BuildPackage,libelektra-crypto))
456 $(eval $(call BuildPackage,libelektra-dbus))
457 $(eval $(call BuildPackage,libelektra-ev))
458 $(eval $(call BuildPackage,libelektra-uv))
459 $(eval $(call BuildPackage,libelektra-xerces))
460 $(eval $(call BuildPackage,libelektra-xml))
461 $(eval $(call BuildPackage,libelektra-yajl))
462 $(eval $(call BuildPackage,libelektra-yamlcpp))
463 $(eval $(call BuildPackage,libelektra-python3))
464 $(eval $(call BuildPackage,libelektra-lua))
465 $(eval $(call BuildPackage,libelektra-zmq))
466 $(eval $(call BuildPackage,libelektra-extra))