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.

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