2 # Copyright (C) 2015 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
14 PKG_SOURCE
:=${PKG_NAME}-${PKG_VERSION}.
tar.gz
15 PKG_SOURCE_URL
:=http
://mirrors.kernel.org
/${PKG_NAME}/${PKG_VERSION}/
16 PKG_MD5SUM
:=7dcd9f0f48263c6b27a2c3d085dd7278b5c0feed1dfec8872a04899707fa23d8
19 PKG_BUILD_DEPENDS
:=boost
21 PKG_MAINTAINER
:=Hauke Mehrtens
<hauke.mehrtens@intel.com
>
23 PKG_LICENSE
:=Apache-2.0
24 PKG_LICENSE_FILES
:=LICENSE.md
26 PKG_CONFIG_DEPENDS
:= \
27 CONFIG_PACKAGE_iotivity \
28 CONFIG_PACKAGE_iotivity-cpp \
29 CONFIG_PACKAGE_iotivity-resource-directory-lib \
30 CONFIG_PACKAGE_iotivity-oic-middle \
31 CONFIG_PACKAGE_iotivity-resource-container-lib \
32 CONFIG_PACKAGE_iotivity-resource-container-sample \
33 CONFIG_PACKAGE_iotivity-resource-container-hue \
34 CONFIG_PACKAGE_iotivity-example-garage \
35 CONFIG_PACKAGE_iotivity-example-simple \
36 CONFIG_PACKAGE_iotivity_DEBUG \
37 CONFIG_PACKAGE_iotivity_SECURE
39 include $(INCLUDE_DIR
)/package.mk
40 include $(INCLUDE_DIR
)/scons.mk
43 define Package
/iotivity
46 DEPENDS
:=@
!USE_UCLIBC
+libpthread
+librt
+libuuid
+libsqlite3
+PACKAGE_iotivity_SECURE
:libmbedtls
47 TITLE
:=IoTivity C Library
48 URL
:=https
://www.iotivity.org
52 define Package
/iotivity
/description
53 IoTivity is a framework for the Internet of Things based on the
54 Open Interconnect Consortium Specification.
57 define Package
/iotivity
/config
59 config PACKAGE_iotivity_DEBUG
60 bool
"IoTivity with debug support"
62 Build IoTivity with debuging support.
64 config PACKAGE_iotivity_SECURE
65 bool
"IoTivity with security support"
67 Activate security support.
69 config PACKAGE_iotivity_LOGGING
70 bool
"IoTivity with logging support"
73 Activate logging support.
74 This will make IoTivity write a lot of log messages to stdout.
79 define Package
/iotivity-cpp
82 DEPENDS
:=+iotivity
+libpthread
+libstdcpp
83 TITLE
:=IoTivity C
++ Library
84 URL
:=https
://www.iotivity.org
87 define Package
/iotivity-cpp
/description
88 IoTivity is a framework for the Internet of Things based on the
89 Open Interconnect Consortium Specification.
92 define Package
/iotivity-resource-directory-lib
95 DEPENDS
:=+iotivity
+iotivity-cpp
96 TITLE
:=IoTivity Resource Directory library
97 URL
:=https
://www.iotivity.org
101 define Package
/iotivity-oic-middle
104 DEPENDS
:=+iotivity
+iotivity-cpp
+iotivity-resource-directory-lib
105 TITLE
:=IoTivity OIC Middle
106 URL
:=https
://www.iotivity.org
109 define Package
/iotivity-oic-middle
/description
113 define Package
/iotivity-resource-container-lib
116 DEPENDS
:=+iotivity
+iotivity-cpp
+boost
+boost-system
+boost-thread
+boost-date_time
117 TITLE
:=IoTivity Resource Container library
118 URL
:=https
://www.iotivity.org
121 define Package
/iotivity-resource-container-sample
124 DEPENDS
:=+iotivity
+iotivity-resource-container-lib
125 TITLE
:=IoTivity Resource Container sample Application
126 URL
:=https
://www.iotivity.org
129 define Package
/iotivity-resource-container-hue
132 DEPENDS
:=+iotivity
+iotivity-resource-container-lib
+libcurl
133 TITLE
:=IoTivity Resource Container Hue Bundle
134 URL
:=https
://www.iotivity.org
137 define Package
/iotivity-example-garage
140 DEPENDS
:=+iotivity
+iotivity-cpp
+iotivity-resource-directory-lib
141 TITLE
:=IoTivity Garage example
142 URL
:=https
://www.iotivity.org
145 define Package
/iotivity-example-garage
/description
146 An IoTivity example application
149 define Package
/iotivity-example-simple
152 DEPENDS
:=+iotivity
+iotivity-cpp
+iotivity-resource-directory-lib
153 TITLE
:=IoTivity simple client
+ server
154 URL
:=https
://www.iotivity.org
157 define Package
/iotivity-example-simple
/description
158 The IoTivity simple client and simple server exmaple
162 PKG_TINYCBOR_NAME
:=tinycbor
163 PKG_TINYCBOR_PROTO
:=git
164 PKG_TINYCBOR_VERSION
:=0.4
165 PKG_TINYCBOR_SOURCE_VERSION
:=a088996aa5f59b4f27f20fadad053d88bee357d4
166 PKG_TINYCBOR_SOURCE
:=$(PKG_TINYCBOR_NAME
)-$(PKG_TINYCBOR_VERSION
).
tar.bz2
167 PKG_TINYCBOR_SOURCE_URL
:=https
://github.com
/01org
/tinycbor.git
168 PKG_TINYCBOR_SUBDIR
:=$(PKG_TINYCBOR_NAME
)
170 define Download
/iotivity-tinycbor
171 FILE
:=$(PKG_TINYCBOR_SOURCE
)
172 URL
:=$(PKG_TINYCBOR_SOURCE_URL
)
173 PROTO
:=$(PKG_TINYCBOR_PROTO
)
174 VERSION
:=$(PKG_TINYCBOR_SOURCE_VERSION
)
175 SUBDIR
:=$(PKG_TINYCBOR_SUBDIR
)
177 $(eval
$(call Download
,iotivity-tinycbor
))
180 EXTRA_CXXFLAGS
+= -std
=gnu
++11
184 TARGET_TRANSPORT
=IP \
185 TARGET_ARCH
=$(ARCH
) \
186 STAGING_DIR
=$(STAGING_DIR
) \
189 $(if
$(CONFIG_PACKAGE_iotivity-oic-middle
),examples
) \
190 $(if
$(CONFIG_PACKAGE_iotivity-resource-container-lib
),libResContainer
) \
191 $(if
$(CONFIG_PACKAGE_iotivity-resource-container-sample
),containersample
) \
192 $(if
$(CONFIG_PACKAGE_iotivity-resource-container-hue
),libHueBundle
) \
193 $(if
$(CONFIG_PACKAGE_iotivity-example-garage
),examples
) \
194 $(if
$(CONFIG_PACKAGE_iotivity-example-simple
),examples
) \
197 ifeq ($(CONFIG_PACKAGE_iotivity_DEBUG
),y
)
198 SCONS_OPTIONS
+= RELEASE
=false
201 SCONS_OPTIONS
+= RELEASE
=true
205 ifeq ($(CONFIG_PACKAGE_iotivity_SECURE
),y
)
206 SCONS_OPTIONS
+= SECURED
=1
208 SCONS_OPTIONS
+= SECURED
=0
211 ifeq ($(CONFIG_PACKAGE_iotivity_LOGGING
),y
)
212 SCONS_OPTIONS
+= LOGGING
=true
215 ifneq ($(findstring c
,$(OPENWRT_VERBOSE
)),)
216 SCONS_OPTIONS
+= VERBOSE
=true
220 $(call Build
/Prepare
/Default
)
221 $(TAR
) -C
$(PKG_BUILD_DIR
)/extlibs
/tinycbor
/ -xjf
$(DL_DIR
)/$(PKG_TINYCBOR_SOURCE
)
225 define Build
/Configure
226 (cd
$(PKG_BUILD_DIR
); \
234 define Package
/iotivity
/install
235 $(INSTALL_DIR
) $(1)/usr
/lib
236 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/out
/linux
/$(ARCH
)/$(APP_OPTIM
)/libconnectivity_abstraction.so
$(1)/usr
/lib
/
237 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/out
/linux
/$(ARCH
)/$(APP_OPTIM
)/liboctbstack.so
$(1)/usr
/lib
/
238 ifeq ($(CONFIG_PACKAGE_iotivity_SECURE
),y
)
239 $(INSTALL_DIR
) $(1)/etc
/iotivity
/
240 $(INSTALL_DATA
) .
/files
/etc
/iotivity
/oic_svr_db.cbor
$(1)/etc
/iotivity
/
244 define Package
/iotivity-cpp
/install
245 $(INSTALL_DIR
) $(1)/usr
/lib
246 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/out
/linux
/$(ARCH
)/$(APP_OPTIM
)/liboc.so
$(1)/usr
/lib
/
247 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/out
/linux
/$(ARCH
)/$(APP_OPTIM
)/liboc_logger.so
$(1)/usr
/lib
/
250 define Package
/iotivity-resource-directory-lib
/install
251 $(INSTALL_DIR
) $(1)/usr
/lib
252 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/out
/linux
/$(ARCH
)/$(APP_OPTIM
)/libresource_directory.so
$(1)/usr
/lib
/
255 define Package
/iotivity-oic-middle
/install
256 $(INSTALL_DIR
) $(1)/usr
/bin
257 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/out
/linux
/$(ARCH
)/$(APP_OPTIM
)/examples
/OICMiddle
/OICMiddle
$(1)/usr
/bin
/
260 define Package
/iotivity-resource-container-lib
/install
261 $(INSTALL_DIR
) $(1)/usr
/lib
262 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/out
/linux
/$(ARCH
)/$(APP_OPTIM
)/librcs_common.so
$(1)/usr
/lib
/
263 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/out
/linux
/$(ARCH
)/$(APP_OPTIM
)/librcs_client.so
$(1)/usr
/lib
/
264 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/out
/linux
/$(ARCH
)/$(APP_OPTIM
)/librcs_server.so
$(1)/usr
/lib
/
265 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/out
/linux
/$(ARCH
)/$(APP_OPTIM
)/librcs_container.so
$(1)/usr
/lib
/
268 define Package
/iotivity-resource-container-sample
/install
269 $(INSTALL_DIR
) $(1)/usr
/bin
270 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/out
/linux
/$(ARCH
)/$(APP_OPTIM
)/service
/resource-container
/ContainerSample
$(1)/usr
/bin
/
273 define Package
/iotivity-resource-container-hue
/install
274 $(INSTALL_DIR
) $(1)/usr
/lib
275 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/out
/linux
/$(ARCH
)/$(APP_OPTIM
)/libHueBundle.so
$(1)/usr
/lib
/
278 define Package
/iotivity-example-garage
/install
279 $(INSTALL_DIR
) $(1)/usr
/bin
280 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/out
/linux
/$(ARCH
)/$(APP_OPTIM
)/resource
/examples
/garageclient
$(1)/usr
/bin
/
281 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/out
/linux
/$(ARCH
)/$(APP_OPTIM
)/resource
/examples
/garageserver
$(1)/usr
/bin
/
284 define Package
/iotivity-example-simple
/install
285 $(INSTALL_DIR
) $(1)/usr
/bin
286 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/out
/linux
/$(ARCH
)/$(APP_OPTIM
)/resource
/examples
/simpleclient
$(1)/usr
/bin
/
287 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/out
/linux
/$(ARCH
)/$(APP_OPTIM
)/resource
/examples
/simpleserver
$(1)/usr
/bin
/
290 define Build
/InstallDev
291 $(INSTALL_DIR
) $(1)/usr
/include
292 $(CP
) $(PKG_BUILD_DIR
)/out
/linux
/$(ARCH
)/$(APP_OPTIM
)/include $(1)/usr
/include/iotivity
294 $(INSTALL_DIR
) $(1)/usr
/lib
295 $(CP
) $(PKG_BUILD_DIR
)/out
/linux
/$(ARCH
)/$(APP_OPTIM
)/libconnectivity_abstraction.so
$(1)/usr
/lib
/
296 $(CP
) $(PKG_BUILD_DIR
)/out
/linux
/$(ARCH
)/$(APP_OPTIM
)/liboctbstack.so
$(1)/usr
/lib
/
297 $(CP
) $(PKG_BUILD_DIR
)/out
/linux
/$(ARCH
)/$(APP_OPTIM
)/liboc.so
$(1)/usr
/lib
/
298 $(CP
) $(PKG_BUILD_DIR
)/out
/linux
/$(ARCH
)/$(APP_OPTIM
)/liboc_logger.so
$(1)/usr
/lib
/
299 $(CP
) $(PKG_BUILD_DIR
)/out
/linux
/$(ARCH
)/$(APP_OPTIM
)/libresource_directory.so
$(1)/usr
/lib
/
303 $(eval
$(call BuildPackage
,iotivity
))
304 $(eval
$(call BuildPackage
,iotivity-cpp
))
305 $(eval
$(call BuildPackage
,iotivity-resource-directory-lib
))
306 $(eval
$(call BuildPackage
,iotivity-oic-middle
))
307 $(eval
$(call BuildPackage
,iotivity-resource-container-lib
))
308 $(eval
$(call BuildPackage
,iotivity-resource-container-sample
))
309 $(eval
$(call BuildPackage
,iotivity-resource-container-hue
))
310 $(eval
$(call BuildPackage
,iotivity-example-garage
))
311 $(eval
$(call BuildPackage
,iotivity-example-simple
))