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.

268 lines
8.4 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.0.0
  10. PKG_RELEASE=1
  11. PKG_SOURCE:=${PKG_NAME}-${PKG_VERSION}.tar.gz
  12. PKG_SOURCE_URL:=https://downloads.iotivity.org/${PKG_VERSION}/ \
  13. http://mirrors.kernel.org/${PKG_NAME}/${PKG_VERSION}/
  14. PKG_MD5SUM:=4bcbabffc1734c664bbdf8fedfa60543
  15. PKG_USE_MIPS16:=0
  16. PKG_MAINTAINER:=Hauke Mehrtens <hauke.mehrtens@lantiq.com>
  17. PKG_LICENSE:=Apache-2.0
  18. PKG_LICENSE_FILES:=LICENSE.md
  19. include $(INCLUDE_DIR)/package.mk
  20. include $(INCLUDE_DIR)/scons.mk
  21. define Package/iotivity
  22. SECTION:=net
  23. CATEGORY:=Network
  24. DEPENDS:=@!USE_UCLIBC +libpthread +librt +libuuid
  25. TITLE:=IoTivity C Library
  26. URL:=https://www.iotivity.org
  27. endef
  28. define Package/iotivity/description
  29. IoTivity is a framework for the Internet of Things based on the
  30. Open Interconnect Consortium Specification.
  31. endef
  32. define Package/iotivity-cpp
  33. SECTION:=net
  34. CATEGORY:=Network
  35. DEPENDS:=iotivity +libpthread +libstdcpp
  36. TITLE:=IoTivity C++ Library
  37. URL:=https://www.iotivity.org
  38. endef
  39. define Package/iotivity-cpp/description
  40. IoTivity is a framework for the Internet of Things based on the
  41. Open Interconnect Consortium Specification.
  42. endef
  43. define Package/iotivity-things-manager-lib
  44. SECTION:=net
  45. CATEGORY:=Network
  46. DEPENDS:=iotivity +iotivity-cpp +libstdcpp
  47. TITLE:=IoTivity things manager lib
  48. URL:=https://www.iotivity.org
  49. endef
  50. define Package/iotivity-things-manager-lib/description
  51. IoTivity things-manager lib
  52. endef
  53. define Package/iotivity-oic-middle
  54. SECTION:=net
  55. CATEGORY:=Network
  56. DEPENDS:=iotivity +iotivity-cpp
  57. TITLE:=IoTivity OIC Middle
  58. URL:=https://www.iotivity.org
  59. endef
  60. define Package/iotivity-oic-middle/description
  61. IoTivity OIC Middle
  62. endef
  63. define Package/iotivity-things-manager
  64. SECTION:=net
  65. CATEGORY:=Network
  66. DEPENDS:=iotivity +iotivity-cpp +iotivity-things-manager-lib
  67. TITLE:=IoTivity things manager
  68. URL:=https://www.iotivity.org
  69. endef
  70. define Package/iotivity-things-manager/description
  71. IoTivity things manager
  72. endef
  73. define Package/iotivity-resource-container-lib
  74. SECTION:=net
  75. CATEGORY:=Network
  76. DEPENDS:=iotivity +iotivity-cpp +boost-system +boost-thread +boost-date_time
  77. TITLE:=IoTivity Resource Container library
  78. URL:=https://www.iotivity.org
  79. endef
  80. define Package/iotivity-resource-container-sample
  81. SECTION:=net
  82. CATEGORY:=Network
  83. DEPENDS:=iotivity +iotivity-resource-container-lib
  84. TITLE:=IoTivity Resource Container sample Application
  85. URL:=https://www.iotivity.org
  86. endef
  87. define Package/iotivity-resource-container-hue
  88. SECTION:=net
  89. CATEGORY:=Network
  90. DEPENDS:=iotivity +iotivity-resource-container-lib +libcurl
  91. TITLE:=IoTivity Resource Container Hue Bundle
  92. URL:=https://www.iotivity.org
  93. endef
  94. define Package/iotivity-example-garage
  95. SECTION:=net
  96. CATEGORY:=Network
  97. DEPENDS:=iotivity +iotivity-cpp
  98. TITLE:=IoTivity Garage example
  99. URL:=https://www.iotivity.org
  100. endef
  101. define Package/iotivity-example-garage/description
  102. An IoTivity example application
  103. endef
  104. PKG_TINYCBOR_NAME:=tinycbor
  105. PKG_TINYCBOR_VERSION:=43e3ac9490cf19459ec7b7bd13df3b66810fb62a
  106. PKG_TINYCBOR_SOURCE:=$(PKG_TINYCBOR_NAME)-$(PKG_TINYCBOR_VERSION).tar.bz2
  107. PKG_TINYCBOR_PROTO:=git
  108. PKG_TINYCBOR_SOURCE_URL:=https://github.com/01org/tinycbor.git
  109. PKG_TINYCBOR_SUBDIR:=$(PKG_TINYCBOR_NAME)
  110. #PKG_TINYCBOR_MIRROR_MD5SUM:=?
  111. define Download/iotivity-tinycbor
  112. FILE:=$(PKG_TINYCBOR_SOURCE)
  113. URL:=$(PKG_TINYCBOR_SOURCE_URL)
  114. PROTO:=$(PKG_TINYCBOR_PROTO)
  115. VERSION:=$(PKG_TINYCBOR_VERSION)
  116. SUBDIR:=$(PKG_TINYCBOR_SUBDIR)
  117. #MIRROR_MD5SUM:=$(PKG_TINYCBOR_MIRROR_MD5SUM)
  118. endef
  119. $(eval $(call Download,iotivity-tinycbor))
  120. PKG_SQLITE_NAME:=sqlite
  121. PKG_SQLITE_VERSION:=3081101
  122. PKG_SQLITE_SOURCE:=$(PKG_SQLITE_NAME)-amalgamation-$(PKG_SQLITE_VERSION).zip
  123. PKG_SQLITE_SOURCE_URL:=http://www.sqlite.org/2015/
  124. PKG_SQLITE_SUBDIR:=$(PKG_SQLITE_NAME)
  125. PKG_SQLITE_MD5SUM:=94907e831502e2080b76e281cfa24dde
  126. define Download/iotivity-sqlite
  127. FILE:=$(PKG_SQLITE_SOURCE)
  128. URL:=$(PKG_SQLITE_SOURCE_URL)
  129. VERSION:=$(PKG_SQLITE_VERSION)
  130. SUBDIR:=$(PKG_SQLITE_SUBDIR)
  131. MD5SUM:=$(PKG_SQLITE_MD5SUM)
  132. endef
  133. $(eval $(call Download,iotivity-sqlite))
  134. SCONS_OPTIONS += \
  135. TARGET_OS=linux \
  136. TARGET_TRANSPORT=IP \
  137. TARGET_ARCH=$(ARCH) \
  138. STAGING_DIR=$(STAGING_DIR) \
  139. LOGGING=true \
  140. SECURED=1 \
  141. $(if $(CONFIG_PACKAGE_iotivity),liboctbstack) \
  142. $(if $(CONFIG_PACKAGE_iotivity-cpp),liboc) \
  143. $(if $(CONFIG_PACKAGE_iotivity-things-manager-lib),libTGMSDK) \
  144. $(if $(CONFIG_PACKAGE_iotivity-oic-middle),samples) \
  145. $(if $(CONFIG_PACKAGE_iotivity-things-manager),ConServerApp ConClientApp BootstrapServerApp) \
  146. $(if $(CONFIG_PACKAGE_iotivity-resource-container-lib),libResContainer) \
  147. $(if $(CONFIG_PACKAGE_iotivity-resource-container-sample),containersample) \
  148. $(if $(CONFIG_PACKAGE_iotivity-resource-container-hue),libHueBundle) \
  149. $(if $(CONFIG_PACKAGE_iotivity-example-garage),examples) \
  150. ifneq ($(findstring c,$(OPENWRT_VERBOSE)),)
  151. SCONS_OPTIONS += VERBOSE=true
  152. endif
  153. define Build/Prepare
  154. $(call Build/Prepare/Default)
  155. $(TAR) -C $(PKG_BUILD_DIR)/extlibs/tinycbor/ -xjf $(DL_DIR)/$(PKG_TINYCBOR_SOURCE)
  156. unzip -d $(PKG_BUILD_DIR)/extlibs/sqlite3/ $(DL_DIR)/$(PKG_SQLITE_SOURCE)
  157. mv $(PKG_BUILD_DIR)/extlibs/sqlite3/$(PKG_SQLITE_NAME)-amalgamation-$(PKG_SQLITE_VERSION)/sqlite3.h $(PKG_BUILD_DIR)/extlibs/sqlite3/
  158. mv $(PKG_BUILD_DIR)/extlibs/sqlite3/$(PKG_SQLITE_NAME)-amalgamation-$(PKG_SQLITE_VERSION)/sqlite3.c $(PKG_BUILD_DIR)/extlibs/sqlite3/
  159. endef
  160. define Build/Configure
  161. (cd $(PKG_BUILD_DIR); \
  162. $(SCONS_VARS) \
  163. scons \
  164. $(SCONS_OPTIONS) \
  165. )
  166. endef
  167. define Package/iotivity/install
  168. $(INSTALL_DIR) $(1)/usr/lib
  169. $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/release/liboctbstack.so $(1)/usr/lib/
  170. endef
  171. define Package/iotivity-cpp/install
  172. $(INSTALL_DIR) $(1)/usr/lib
  173. $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/release/liboc.so $(1)/usr/lib/
  174. $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/release/liboc_logger.so $(1)/usr/lib/
  175. endef
  176. define Package/iotivity-things-manager-lib/install
  177. $(INSTALL_DIR) $(1)/usr/lib
  178. $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/release/libTGMSDKLibrary.so $(1)/usr/lib/
  179. endef
  180. define Package/iotivity-oic-middle/install
  181. $(INSTALL_DIR) $(1)/usr/bin
  182. $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/release/examples/OICMiddle/OICMiddle $(1)/usr/bin/
  183. endef
  184. define Package/iotivity-things-manager/install
  185. $(INSTALL_DIR) $(1)/usr/bin
  186. $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/release/service/things-manager/sampleapp/linux/configuration/bootstrapserver $(1)/usr/bin/
  187. $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/release/service/things-manager/sampleapp/linux/configuration/con-server $(1)/usr/bin/
  188. $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/release/service/things-manager/sampleapp/linux/configuration/con-client $(1)/usr/bin/
  189. endef
  190. define Package/iotivity-resource-container-lib/install
  191. $(INSTALL_DIR) $(1)/usr/lib
  192. $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/release/librcs_common.so $(1)/usr/lib/
  193. $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/release/librcs_client.so $(1)/usr/lib/
  194. $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/release/librcs_server.so $(1)/usr/lib/
  195. $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/release/librcs_container.so $(1)/usr/lib/
  196. endef
  197. define Package/iotivity-resource-container-sample/install
  198. $(INSTALL_DIR) $(1)/usr/bin
  199. $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/release/service/resource-container/ContainerSample $(1)/usr/bin/
  200. endef
  201. define Package/iotivity-resource-container-hue/install
  202. $(INSTALL_DIR) $(1)/usr/lib
  203. $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/release/libHueBundle.so $(1)/usr/lib/
  204. endef
  205. define Package/iotivity-example-garage/install
  206. $(INSTALL_DIR) $(1)/usr/bin
  207. $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/release/resource/examples/garageclient $(1)/usr/bin/
  208. $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/release/resource/examples/garageserver $(1)/usr/bin/
  209. endef
  210. $(eval $(call BuildPackage,iotivity))
  211. $(eval $(call BuildPackage,iotivity-cpp))
  212. $(eval $(call BuildPackage,iotivity-things-manager-lib))
  213. $(eval $(call BuildPackage,iotivity-oic-middle))
  214. $(eval $(call BuildPackage,iotivity-things-manager))
  215. $(eval $(call BuildPackage,iotivity-resource-container-lib))
  216. $(eval $(call BuildPackage,iotivity-resource-container-sample))
  217. $(eval $(call BuildPackage,iotivity-resource-container-hue))
  218. $(eval $(call BuildPackage,iotivity-example-garage))