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.

289 lines
8.7 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.2.1
  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:=7dcd9f0f48263c6b27a2c3d085dd7278b5c0feed1dfec8872a04899707fa23d8
  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-resource-directory-lib \
  23. CONFIG_PACKAGE_iotivity-oic-middle \
  24. CONFIG_PACKAGE_iotivity-resource-container-lib \
  25. CONFIG_PACKAGE_iotivity-resource-container-sample \
  26. CONFIG_PACKAGE_iotivity-resource-container-hue \
  27. CONFIG_PACKAGE_iotivity-example-garage \
  28. CONFIG_PACKAGE_iotivity-example-simple \
  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 +libsqlite3 +PACKAGE_iotivity_SECURE:libmbedtls
  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. help
  54. Activate security support.
  55. endif
  56. endef
  57. define Package/iotivity-cpp
  58. SECTION:=net
  59. CATEGORY:=Network
  60. DEPENDS:=+iotivity +libpthread +libstdcpp
  61. TITLE:=IoTivity C++ Library
  62. URL:=https://www.iotivity.org
  63. endef
  64. define Package/iotivity-cpp/description
  65. IoTivity is a framework for the Internet of Things based on the
  66. Open Interconnect Consortium Specification.
  67. endef
  68. define Package/iotivity-resource-directory-lib
  69. SECTION:=net
  70. CATEGORY:=Network
  71. DEPENDS:=+iotivity +iotivity-cpp
  72. TITLE:=IoTivity Resource Directory library
  73. URL:=https://www.iotivity.org
  74. endef
  75. define Package/iotivity-oic-middle
  76. SECTION:=net
  77. CATEGORY:=Network
  78. DEPENDS:=+iotivity +iotivity-cpp +iotivity-resource-directory-lib
  79. TITLE:=IoTivity OIC Middle
  80. URL:=https://www.iotivity.org
  81. endef
  82. define Package/iotivity-oic-middle/description
  83. IoTivity OIC Middle
  84. endef
  85. define Package/iotivity-resource-container-lib
  86. SECTION:=net
  87. CATEGORY:=Network
  88. DEPENDS:=+iotivity +iotivity-cpp +boost +boost-system +boost-thread +boost-date_time
  89. TITLE:=IoTivity Resource Container library
  90. URL:=https://www.iotivity.org
  91. endef
  92. define Package/iotivity-resource-container-sample
  93. SECTION:=net
  94. CATEGORY:=Network
  95. DEPENDS:=+iotivity +iotivity-resource-container-lib
  96. TITLE:=IoTivity Resource Container sample Application
  97. URL:=https://www.iotivity.org
  98. endef
  99. define Package/iotivity-resource-container-hue
  100. SECTION:=net
  101. CATEGORY:=Network
  102. DEPENDS:=+iotivity +iotivity-resource-container-lib +libcurl
  103. TITLE:=IoTivity Resource Container Hue Bundle
  104. URL:=https://www.iotivity.org
  105. endef
  106. define Package/iotivity-example-garage
  107. SECTION:=net
  108. CATEGORY:=Network
  109. DEPENDS:=+iotivity +iotivity-cpp +iotivity-resource-directory-lib
  110. TITLE:=IoTivity Garage example
  111. URL:=https://www.iotivity.org
  112. endef
  113. define Package/iotivity-example-garage/description
  114. An IoTivity example application
  115. endef
  116. define Package/iotivity-example-simple
  117. SECTION:=net
  118. CATEGORY:=Network
  119. DEPENDS:=+iotivity +iotivity-cpp +iotivity-resource-directory-lib
  120. TITLE:=IoTivity simple client + server
  121. URL:=https://www.iotivity.org
  122. endef
  123. define Package/iotivity-example-simple/description
  124. The IoTivity simple client and simple server exmaple
  125. endef
  126. PKG_TINYCBOR_NAME:=tinycbor
  127. PKG_TINYCBOR_PROTO:=git
  128. PKG_TINYCBOR_VERSION:=0.4
  129. PKG_TINYCBOR_SOURCE_VERSION:=a088996aa5f59b4f27f20fadad053d88bee357d4
  130. PKG_TINYCBOR_SOURCE:=$(PKG_TINYCBOR_NAME)-$(PKG_TINYCBOR_VERSION).tar.bz2
  131. PKG_TINYCBOR_SOURCE_URL:=https://github.com/01org/tinycbor.git
  132. PKG_TINYCBOR_SUBDIR:=$(PKG_TINYCBOR_NAME)
  133. define Download/iotivity-tinycbor
  134. FILE:=$(PKG_TINYCBOR_SOURCE)
  135. URL:=$(PKG_TINYCBOR_SOURCE_URL)
  136. PROTO:=$(PKG_TINYCBOR_PROTO)
  137. VERSION:=$(PKG_TINYCBOR_SOURCE_VERSION)
  138. SUBDIR:=$(PKG_TINYCBOR_SUBDIR)
  139. endef
  140. $(eval $(call Download,iotivity-tinycbor))
  141. EXTRA_CXXFLAGS += -std=gnu++11
  142. SCONS_OPTIONS += \
  143. TARGET_OS=linux \
  144. TARGET_TRANSPORT=IP \
  145. TARGET_ARCH=$(ARCH) \
  146. STAGING_DIR=$(STAGING_DIR) \
  147. LOGGING=true \
  148. $(if $(CONFIG_PACKAGE_iotivity),octbstack) \
  149. $(if $(CONFIG_PACKAGE_iotivity-cpp),oc) \
  150. $(if $(CONFIG_PACKAGE_iotivity-oic-middle),examples) \
  151. $(if $(CONFIG_PACKAGE_iotivity-resource-container-lib),libResContainer) \
  152. $(if $(CONFIG_PACKAGE_iotivity-resource-container-sample),containersample) \
  153. $(if $(CONFIG_PACKAGE_iotivity-resource-container-hue),libHueBundle) \
  154. $(if $(CONFIG_PACKAGE_iotivity-example-garage),examples) \
  155. $(if $(CONFIG_PACKAGE_iotivity-example-simple),examples) \
  156. ifeq ($(CONFIG_PACKAGE_iotivity_DEBUG),y)
  157. SCONS_OPTIONS += RELEASE=false
  158. APP_OPTIM:=debug
  159. else
  160. SCONS_OPTIONS += RELEASE=true
  161. APP_OPTIM:=release
  162. endif
  163. ifeq ($(CONFIG_PACKAGE_iotivity_SECURE),y)
  164. SCONS_OPTIONS += SECURED=1
  165. else
  166. SCONS_OPTIONS += SECURED=0
  167. endif
  168. ifneq ($(findstring c,$(OPENWRT_VERBOSE)),)
  169. SCONS_OPTIONS += VERBOSE=true
  170. endif
  171. define Build/Prepare
  172. $(call Build/Prepare/Default)
  173. $(TAR) -C $(PKG_BUILD_DIR)/extlibs/tinycbor/ -xjf $(DL_DIR)/$(PKG_TINYCBOR_SOURCE)
  174. endef
  175. define Build/Configure
  176. (cd $(PKG_BUILD_DIR); \
  177. $(SCONS_VARS) \
  178. scons \
  179. $(SCONS_OPTIONS) \
  180. )
  181. endef
  182. define Package/iotivity/install
  183. $(INSTALL_DIR) $(1)/usr/lib
  184. $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/libconnectivity_abstraction.so $(1)/usr/lib/
  185. $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/liboctbstack.so $(1)/usr/lib/
  186. ifeq ($(CONFIG_PACKAGE_iotivity_SECURE),y)
  187. $(INSTALL_DIR) $(1)/etc/iotivity/
  188. $(INSTALL_DATA) ./files/etc/iotivity/oic_svr_db.cbor $(1)/etc/iotivity/
  189. endif
  190. endef
  191. define Package/iotivity-cpp/install
  192. $(INSTALL_DIR) $(1)/usr/lib
  193. $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/liboc.so $(1)/usr/lib/
  194. $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/liboc_logger.so $(1)/usr/lib/
  195. endef
  196. define Package/iotivity-resource-directory-lib/install
  197. $(INSTALL_DIR) $(1)/usr/lib
  198. $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/libresource_directory.so $(1)/usr/lib/
  199. endef
  200. define Package/iotivity-oic-middle/install
  201. $(INSTALL_DIR) $(1)/usr/bin
  202. $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/examples/OICMiddle/OICMiddle $(1)/usr/bin/
  203. endef
  204. define Package/iotivity-resource-container-lib/install
  205. $(INSTALL_DIR) $(1)/usr/lib
  206. $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/librcs_common.so $(1)/usr/lib/
  207. $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/librcs_client.so $(1)/usr/lib/
  208. $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/librcs_server.so $(1)/usr/lib/
  209. $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/librcs_container.so $(1)/usr/lib/
  210. endef
  211. define Package/iotivity-resource-container-sample/install
  212. $(INSTALL_DIR) $(1)/usr/bin
  213. $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/service/resource-container/ContainerSample $(1)/usr/bin/
  214. endef
  215. define Package/iotivity-resource-container-hue/install
  216. $(INSTALL_DIR) $(1)/usr/lib
  217. $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/libHueBundle.so $(1)/usr/lib/
  218. endef
  219. define Package/iotivity-example-garage/install
  220. $(INSTALL_DIR) $(1)/usr/bin
  221. $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/resource/examples/garageclient $(1)/usr/bin/
  222. $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/resource/examples/garageserver $(1)/usr/bin/
  223. endef
  224. define Package/iotivity-example-simple/install
  225. $(INSTALL_DIR) $(1)/usr/bin
  226. $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/resource/examples/simpleclient $(1)/usr/bin/
  227. $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/resource/examples/simpleserver $(1)/usr/bin/
  228. endef
  229. $(eval $(call BuildPackage,iotivity))
  230. $(eval $(call BuildPackage,iotivity-cpp))
  231. $(eval $(call BuildPackage,iotivity-resource-directory-lib))
  232. $(eval $(call BuildPackage,iotivity-oic-middle))
  233. $(eval $(call BuildPackage,iotivity-resource-container-lib))
  234. $(eval $(call BuildPackage,iotivity-resource-container-sample))
  235. $(eval $(call BuildPackage,iotivity-resource-container-hue))
  236. $(eval $(call BuildPackage,iotivity-example-garage))
  237. $(eval $(call BuildPackage,iotivity-example-simple))