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.

315 lines
9.6 KiB

  1. #
  2. # Copyright (C) 2015 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=iotivity
  9. PKG_VERSION:=1.1.0
  10. PKG_RELEASE=1
  11. PKG_SOURCE:=${PKG_NAME}-${PKG_VERSION}.tar.gz
  12. PKG_SOURCE_URL:=http://mirrors.kernel.org/${PKG_NAME}/${PKG_VERSION}/
  13. PKG_MD5SUM:=98f8d5b0304c357520c4343d983491e2
  14. PKG_USE_MIPS16:=0
  15. PKG_BUILD_DEPENDS:=boost
  16. PKG_MAINTAINER:=Hauke Mehrtens <hauke.mehrtens@intel.com>
  17. PKG_LICENSE:=Apache-2.0
  18. PKG_LICENSE_FILES:=LICENSE.md
  19. PKG_CONFIG_DEPENDS := \
  20. CONFIG_PACKAGE_iotivity \
  21. CONFIG_PACKAGE_iotivity-cpp \
  22. CONFIG_PACKAGE_iotivity-things-manager-lib \
  23. CONFIG_PACKAGE_iotivity-oic-middle \
  24. CONFIG_PACKAGE_iotivity-things-manager \
  25. CONFIG_PACKAGE_iotivity-resource-container-lib \
  26. CONFIG_PACKAGE_iotivity-resource-container-sample \
  27. CONFIG_PACKAGE_iotivity-resource-container-hue \
  28. CONFIG_PACKAGE_iotivity-example-garage \
  29. CONFIG_PACKAGE_iotivity_DEBUG \
  30. CONFIG_PACKAGE_iotivity_SECURE
  31. include $(INCLUDE_DIR)/package.mk
  32. include $(INCLUDE_DIR)/scons.mk
  33. define Package/iotivity
  34. SECTION:=net
  35. CATEGORY:=Network
  36. DEPENDS:=@!USE_UCLIBC +libpthread +librt +libuuid
  37. TITLE:=IoTivity C Library
  38. URL:=https://www.iotivity.org
  39. MENU:=1
  40. endef
  41. define Package/iotivity/description
  42. IoTivity is a framework for the Internet of Things based on the
  43. Open Interconnect Consortium Specification.
  44. endef
  45. define Package/iotivity/config
  46. if PACKAGE_iotivity
  47. config PACKAGE_iotivity_DEBUG
  48. bool "IoTivity with debug support"
  49. help
  50. Build IoTivity with debuging support.
  51. config PACKAGE_iotivity_SECURE
  52. bool "IoTivity with security support"
  53. default y
  54. help
  55. Activate security support.
  56. endif
  57. endef
  58. define Package/iotivity-cpp
  59. SECTION:=net
  60. CATEGORY:=Network
  61. DEPENDS:=+iotivity +libpthread +libstdcpp
  62. TITLE:=IoTivity C++ Library
  63. URL:=https://www.iotivity.org
  64. endef
  65. define Package/iotivity-cpp/description
  66. IoTivity is a framework for the Internet of Things based on the
  67. Open Interconnect Consortium Specification.
  68. endef
  69. define Package/iotivity-things-manager-lib
  70. SECTION:=net
  71. CATEGORY:=Network
  72. DEPENDS:=+iotivity +iotivity-cpp +libstdcpp
  73. TITLE:=IoTivity things manager lib
  74. URL:=https://www.iotivity.org
  75. endef
  76. define Package/iotivity-things-manager-lib/description
  77. IoTivity things-manager lib
  78. endef
  79. define Package/iotivity-oic-middle
  80. SECTION:=net
  81. CATEGORY:=Network
  82. DEPENDS:=+iotivity +iotivity-cpp
  83. TITLE:=IoTivity OIC Middle
  84. URL:=https://www.iotivity.org
  85. endef
  86. define Package/iotivity-oic-middle/description
  87. IoTivity OIC Middle
  88. endef
  89. define Package/iotivity-things-manager
  90. SECTION:=net
  91. CATEGORY:=Network
  92. DEPENDS:=+iotivity +iotivity-cpp +iotivity-things-manager-lib
  93. TITLE:=IoTivity things manager
  94. URL:=https://www.iotivity.org
  95. endef
  96. define Package/iotivity-things-manager/description
  97. IoTivity things manager
  98. endef
  99. define Package/iotivity-resource-container-lib
  100. SECTION:=net
  101. CATEGORY:=Network
  102. DEPENDS:=+iotivity +iotivity-cpp +boost +boost-system +boost-thread +boost-date_time
  103. TITLE:=IoTivity Resource Container library
  104. URL:=https://www.iotivity.org
  105. endef
  106. define Package/iotivity-resource-container-sample
  107. SECTION:=net
  108. CATEGORY:=Network
  109. DEPENDS:=+iotivity +iotivity-resource-container-lib
  110. TITLE:=IoTivity Resource Container sample Application
  111. URL:=https://www.iotivity.org
  112. endef
  113. define Package/iotivity-resource-container-hue
  114. SECTION:=net
  115. CATEGORY:=Network
  116. DEPENDS:=+iotivity +iotivity-resource-container-lib +libcurl
  117. TITLE:=IoTivity Resource Container Hue Bundle
  118. URL:=https://www.iotivity.org
  119. endef
  120. define Package/iotivity-example-garage
  121. SECTION:=net
  122. CATEGORY:=Network
  123. DEPENDS:=+iotivity +iotivity-cpp
  124. TITLE:=IoTivity Garage example
  125. URL:=https://www.iotivity.org
  126. endef
  127. define Package/iotivity-example-garage/description
  128. An IoTivity example application
  129. endef
  130. PKG_TINYCBOR_NAME:=tinycbor
  131. PKG_TINYCBOR_VERSION:=43e3ac9490cf19459ec7b7bd13df3b66810fb62a
  132. PKG_TINYCBOR_SOURCE:=$(PKG_TINYCBOR_NAME)-$(PKG_TINYCBOR_VERSION).tar.bz2
  133. PKG_TINYCBOR_PROTO:=git
  134. PKG_TINYCBOR_SOURCE_URL:=https://github.com/01org/tinycbor.git
  135. PKG_TINYCBOR_SUBDIR:=$(PKG_TINYCBOR_NAME)
  136. #PKG_TINYCBOR_MIRROR_MD5SUM:=?
  137. define Download/iotivity-tinycbor
  138. FILE:=$(PKG_TINYCBOR_SOURCE)
  139. URL:=$(PKG_TINYCBOR_SOURCE_URL)
  140. PROTO:=$(PKG_TINYCBOR_PROTO)
  141. VERSION:=$(PKG_TINYCBOR_VERSION)
  142. SUBDIR:=$(PKG_TINYCBOR_SUBDIR)
  143. #MIRROR_MD5SUM:=$(PKG_TINYCBOR_MIRROR_MD5SUM)
  144. endef
  145. $(eval $(call Download,iotivity-tinycbor))
  146. PKG_SQLITE_NAME:=sqlite
  147. PKG_SQLITE_VERSION:=3081101
  148. PKG_SQLITE_SOURCE:=$(PKG_SQLITE_NAME)-amalgamation-$(PKG_SQLITE_VERSION).zip
  149. PKG_SQLITE_SOURCE_URL:=http://www.sqlite.org/2015/
  150. PKG_SQLITE_SUBDIR:=$(PKG_SQLITE_NAME)
  151. PKG_SQLITE_MD5SUM:=94907e831502e2080b76e281cfa24dde
  152. define Download/iotivity-sqlite
  153. FILE:=$(PKG_SQLITE_SOURCE)
  154. URL:=$(PKG_SQLITE_SOURCE_URL)
  155. VERSION:=$(PKG_SQLITE_VERSION)
  156. SUBDIR:=$(PKG_SQLITE_SUBDIR)
  157. MD5SUM:=$(PKG_SQLITE_MD5SUM)
  158. endef
  159. $(eval $(call Download,iotivity-sqlite))
  160. SCONS_OPTIONS += \
  161. TARGET_OS=linux \
  162. TARGET_TRANSPORT=IP \
  163. TARGET_ARCH=$(ARCH) \
  164. STAGING_DIR=$(STAGING_DIR) \
  165. LOGGING=true \
  166. $(if $(CONFIG_PACKAGE_iotivity),liboctbstack) \
  167. $(if $(CONFIG_PACKAGE_iotivity-cpp),liboc) \
  168. $(if $(CONFIG_PACKAGE_iotivity-things-manager-lib),libTGMSDK) \
  169. $(if $(CONFIG_PACKAGE_iotivity-oic-middle),examples) \
  170. $(if $(CONFIG_PACKAGE_iotivity-things-manager),ConServerApp ConClientApp BootstrapServerApp) \
  171. $(if $(CONFIG_PACKAGE_iotivity-resource-container-lib),libResContainer) \
  172. $(if $(CONFIG_PACKAGE_iotivity-resource-container-sample),containersample) \
  173. $(if $(CONFIG_PACKAGE_iotivity-resource-container-hue),libHueBundle) \
  174. $(if $(CONFIG_PACKAGE_iotivity-example-garage),examples) \
  175. ifeq ($(CONFIG_PACKAGE_iotivity_DEBUG),y)
  176. SCONS_OPTIONS += RELEASE=false
  177. APP_OPTIM:=debug
  178. else
  179. SCONS_OPTIONS += RELEASE=true
  180. APP_OPTIM:=release
  181. endif
  182. ifeq ($(CONFIG_PACKAGE_iotivity_SECURE),y)
  183. SCONS_OPTIONS += SECURED=1
  184. else
  185. SCONS_OPTIONS += SECURED=0
  186. endif
  187. ifneq ($(findstring c,$(OPENWRT_VERBOSE)),)
  188. SCONS_OPTIONS += VERBOSE=true
  189. endif
  190. define Build/Prepare
  191. $(call Build/Prepare/Default)
  192. $(TAR) -C $(PKG_BUILD_DIR)/extlibs/tinycbor/ -xjf $(DL_DIR)/$(PKG_TINYCBOR_SOURCE)
  193. unzip -d $(PKG_BUILD_DIR)/extlibs/sqlite3/ $(DL_DIR)/$(PKG_SQLITE_SOURCE)
  194. mv $(PKG_BUILD_DIR)/extlibs/sqlite3/$(PKG_SQLITE_NAME)-amalgamation-$(PKG_SQLITE_VERSION)/sqlite3.h $(PKG_BUILD_DIR)/extlibs/sqlite3/
  195. mv $(PKG_BUILD_DIR)/extlibs/sqlite3/$(PKG_SQLITE_NAME)-amalgamation-$(PKG_SQLITE_VERSION)/sqlite3.c $(PKG_BUILD_DIR)/extlibs/sqlite3/
  196. endef
  197. define Build/Configure
  198. (cd $(PKG_BUILD_DIR); \
  199. $(SCONS_VARS) \
  200. scons \
  201. $(SCONS_OPTIONS) \
  202. )
  203. endef
  204. define Package/iotivity/install
  205. $(INSTALL_DIR) $(1)/usr/lib
  206. $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/liboctbstack.so $(1)/usr/lib/
  207. ifeq ($(CONFIG_PACKAGE_iotivity_SECURE),y)
  208. $(INSTALL_DIR) $(1)/etc/iotivity/
  209. $(INSTALL_DATA) ./files/etc/iotivity/oic_svr_db.cbor $(1)/etc/iotivity/
  210. endif
  211. endef
  212. define Package/iotivity-cpp/install
  213. $(INSTALL_DIR) $(1)/usr/lib
  214. $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/liboc.so $(1)/usr/lib/
  215. $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/liboc_logger.so $(1)/usr/lib/
  216. endef
  217. define Package/iotivity-things-manager-lib/install
  218. $(INSTALL_DIR) $(1)/usr/lib
  219. $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/libTGMSDKLibrary.so $(1)/usr/lib/
  220. endef
  221. define Package/iotivity-oic-middle/install
  222. $(INSTALL_DIR) $(1)/usr/bin
  223. $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/examples/OICMiddle/OICMiddle $(1)/usr/bin/
  224. endef
  225. define Package/iotivity-things-manager/install
  226. $(INSTALL_DIR) $(1)/usr/bin
  227. $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/service/things-manager/sampleapp/linux/configuration/bootstrapserver $(1)/usr/bin/
  228. $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/service/things-manager/sampleapp/linux/configuration/con-server $(1)/usr/bin/
  229. $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/service/things-manager/sampleapp/linux/configuration/con-client $(1)/usr/bin/
  230. endef
  231. define Package/iotivity-resource-container-lib/install
  232. $(INSTALL_DIR) $(1)/usr/lib
  233. $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/librcs_common.so $(1)/usr/lib/
  234. $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/librcs_client.so $(1)/usr/lib/
  235. $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/librcs_server.so $(1)/usr/lib/
  236. $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/librcs_container.so $(1)/usr/lib/
  237. endef
  238. define Package/iotivity-resource-container-sample/install
  239. $(INSTALL_DIR) $(1)/usr/bin
  240. $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/service/resource-container/ContainerSample $(1)/usr/bin/
  241. endef
  242. define Package/iotivity-resource-container-hue/install
  243. $(INSTALL_DIR) $(1)/usr/lib
  244. $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/libHueBundle.so $(1)/usr/lib/
  245. endef
  246. define Package/iotivity-example-garage/install
  247. $(INSTALL_DIR) $(1)/usr/bin
  248. $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/resource/examples/garageclient $(1)/usr/bin/
  249. $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/resource/examples/garageserver $(1)/usr/bin/
  250. endef
  251. $(eval $(call BuildPackage,iotivity))
  252. $(eval $(call BuildPackage,iotivity-cpp))
  253. $(eval $(call BuildPackage,iotivity-things-manager-lib))
  254. $(eval $(call BuildPackage,iotivity-oic-middle))
  255. $(eval $(call BuildPackage,iotivity-things-manager))
  256. $(eval $(call BuildPackage,iotivity-resource-container-lib))
  257. $(eval $(call BuildPackage,iotivity-resource-container-sample))
  258. $(eval $(call BuildPackage,iotivity-resource-container-hue))
  259. $(eval $(call BuildPackage,iotivity-example-garage))