You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

468 lines
15 KiB

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