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.

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