5bd4056b10fddbb715ead55f76a92b2390145452
[feed/packages.git] / net / iotivity / Makefile
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
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=iotivity
11 PKG_VERSION:=1.2.1
12 PKG_RELEASE=1
13
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
17 PKG_USE_MIPS16:=0
18
19 PKG_BUILD_DEPENDS:=boost
20
21 PKG_MAINTAINER:=Hauke Mehrtens <hauke.mehrtens@intel.com>
22
23 PKG_LICENSE:=Apache-2.0
24 PKG_LICENSE_FILES:=LICENSE.md
25
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
38
39 include $(INCLUDE_DIR)/package.mk
40 include $(INCLUDE_DIR)/scons.mk
41
42
43 define Package/iotivity
44 SECTION:=net
45 CATEGORY:=Network
46 DEPENDS:=@!USE_UCLIBC +libpthread +librt +libuuid +libsqlite3 +PACKAGE_iotivity_SECURE:libmbedtls
47 TITLE:=IoTivity C Library
48 URL:=https://www.iotivity.org
49 MENU:=1
50 endef
51
52 define Package/iotivity/description
53 IoTivity is a framework for the Internet of Things based on the
54 Open Interconnect Consortium Specification.
55 endef
56
57 define Package/iotivity/config
58 if PACKAGE_iotivity
59 config PACKAGE_iotivity_DEBUG
60 bool "IoTivity with debug support"
61 help
62 Build IoTivity with debuging support.
63
64 config PACKAGE_iotivity_SECURE
65 bool "IoTivity with security support"
66 help
67 Activate security support.
68
69 endif
70 endef
71
72
73 define Package/iotivity-cpp
74 SECTION:=net
75 CATEGORY:=Network
76 DEPENDS:=+iotivity +libpthread +libstdcpp
77 TITLE:=IoTivity C++ Library
78 URL:=https://www.iotivity.org
79 endef
80
81 define Package/iotivity-cpp/description
82 IoTivity is a framework for the Internet of Things based on the
83 Open Interconnect Consortium Specification.
84 endef
85
86 define Package/iotivity-resource-directory-lib
87 SECTION:=net
88 CATEGORY:=Network
89 DEPENDS:=+iotivity +iotivity-cpp
90 TITLE:=IoTivity Resource Directory library
91 URL:=https://www.iotivity.org
92 endef
93
94
95 define Package/iotivity-oic-middle
96 SECTION:=net
97 CATEGORY:=Network
98 DEPENDS:=+iotivity +iotivity-cpp +iotivity-resource-directory-lib
99 TITLE:=IoTivity OIC Middle
100 URL:=https://www.iotivity.org
101 endef
102
103 define Package/iotivity-oic-middle/description
104 IoTivity OIC Middle
105 endef
106
107 define Package/iotivity-resource-container-lib
108 SECTION:=net
109 CATEGORY:=Network
110 DEPENDS:=+iotivity +iotivity-cpp +boost +boost-system +boost-thread +boost-date_time
111 TITLE:=IoTivity Resource Container library
112 URL:=https://www.iotivity.org
113 endef
114
115 define Package/iotivity-resource-container-sample
116 SECTION:=net
117 CATEGORY:=Network
118 DEPENDS:=+iotivity +iotivity-resource-container-lib
119 TITLE:=IoTivity Resource Container sample Application
120 URL:=https://www.iotivity.org
121 endef
122
123 define Package/iotivity-resource-container-hue
124 SECTION:=net
125 CATEGORY:=Network
126 DEPENDS:=+iotivity +iotivity-resource-container-lib +libcurl
127 TITLE:=IoTivity Resource Container Hue Bundle
128 URL:=https://www.iotivity.org
129 endef
130
131 define Package/iotivity-example-garage
132 SECTION:=net
133 CATEGORY:=Network
134 DEPENDS:=+iotivity +iotivity-cpp +iotivity-resource-directory-lib
135 TITLE:=IoTivity Garage example
136 URL:=https://www.iotivity.org
137 endef
138
139 define Package/iotivity-example-garage/description
140 An IoTivity example application
141 endef
142
143 define Package/iotivity-example-simple
144 SECTION:=net
145 CATEGORY:=Network
146 DEPENDS:=+iotivity +iotivity-cpp +iotivity-resource-directory-lib
147 TITLE:=IoTivity simple client + server
148 URL:=https://www.iotivity.org
149 endef
150
151 define Package/iotivity-example-simple/description
152 The IoTivity simple client and simple server exmaple
153 endef
154
155
156 PKG_TINYCBOR_NAME:=tinycbor
157 PKG_TINYCBOR_PROTO:=git
158 PKG_TINYCBOR_VERSION:=0.4
159 PKG_TINYCBOR_SOURCE_VERSION:=a088996aa5f59b4f27f20fadad053d88bee357d4
160 PKG_TINYCBOR_SOURCE:=$(PKG_TINYCBOR_NAME)-$(PKG_TINYCBOR_VERSION).tar.bz2
161 PKG_TINYCBOR_SOURCE_URL:=https://github.com/01org/tinycbor.git
162 PKG_TINYCBOR_SUBDIR:=$(PKG_TINYCBOR_NAME)
163
164 define Download/iotivity-tinycbor
165 FILE:=$(PKG_TINYCBOR_SOURCE)
166 URL:=$(PKG_TINYCBOR_SOURCE_URL)
167 PROTO:=$(PKG_TINYCBOR_PROTO)
168 VERSION:=$(PKG_TINYCBOR_SOURCE_VERSION)
169 SUBDIR:=$(PKG_TINYCBOR_SUBDIR)
170 endef
171 $(eval $(call Download,iotivity-tinycbor))
172
173
174 EXTRA_CXXFLAGS += -std=gnu++11
175
176 SCONS_OPTIONS += \
177 TARGET_OS=linux \
178 TARGET_TRANSPORT=IP \
179 TARGET_ARCH=$(ARCH) \
180 STAGING_DIR=$(STAGING_DIR) \
181 LOGGING=true \
182 $(if $(CONFIG_PACKAGE_iotivity),octbstack) \
183 $(if $(CONFIG_PACKAGE_iotivity-cpp),oc) \
184 $(if $(CONFIG_PACKAGE_iotivity-oic-middle),examples) \
185 $(if $(CONFIG_PACKAGE_iotivity-resource-container-lib),libResContainer) \
186 $(if $(CONFIG_PACKAGE_iotivity-resource-container-sample),containersample) \
187 $(if $(CONFIG_PACKAGE_iotivity-resource-container-hue),libHueBundle) \
188 $(if $(CONFIG_PACKAGE_iotivity-example-garage),examples) \
189 $(if $(CONFIG_PACKAGE_iotivity-example-simple),examples) \
190
191 ifeq ($(CONFIG_PACKAGE_iotivity_DEBUG),y)
192 SCONS_OPTIONS += RELEASE=false
193 APP_OPTIM:=debug
194 else
195 SCONS_OPTIONS += RELEASE=true
196 APP_OPTIM:=release
197 endif
198
199 ifeq ($(CONFIG_PACKAGE_iotivity_SECURE),y)
200 SCONS_OPTIONS += SECURED=1
201 else
202 SCONS_OPTIONS += SECURED=0
203 endif
204
205 ifneq ($(findstring c,$(OPENWRT_VERBOSE)),)
206 SCONS_OPTIONS += VERBOSE=true
207 endif
208
209 define Build/Prepare
210 $(call Build/Prepare/Default)
211 $(TAR) -C $(PKG_BUILD_DIR)/extlibs/tinycbor/ -xjf $(DL_DIR)/$(PKG_TINYCBOR_SOURCE)
212 endef
213
214
215 define Build/Configure
216 (cd $(PKG_BUILD_DIR); \
217 $(SCONS_VARS) \
218 scons \
219 $(SCONS_OPTIONS) \
220 )
221 endef
222
223
224 define Package/iotivity/install
225 $(INSTALL_DIR) $(1)/usr/lib
226 $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/libconnectivity_abstraction.so $(1)/usr/lib/
227 $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/liboctbstack.so $(1)/usr/lib/
228 ifeq ($(CONFIG_PACKAGE_iotivity_SECURE),y)
229 $(INSTALL_DIR) $(1)/etc/iotivity/
230 $(INSTALL_DATA) ./files/etc/iotivity/oic_svr_db.cbor $(1)/etc/iotivity/
231 endif
232 endef
233
234 define Package/iotivity-cpp/install
235 $(INSTALL_DIR) $(1)/usr/lib
236 $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/liboc.so $(1)/usr/lib/
237 $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/liboc_logger.so $(1)/usr/lib/
238 endef
239
240 define Package/iotivity-resource-directory-lib/install
241 $(INSTALL_DIR) $(1)/usr/lib
242 $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/libresource_directory.so $(1)/usr/lib/
243 endef
244
245 define Package/iotivity-oic-middle/install
246 $(INSTALL_DIR) $(1)/usr/bin
247 $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/examples/OICMiddle/OICMiddle $(1)/usr/bin/
248 endef
249
250 define Package/iotivity-resource-container-lib/install
251 $(INSTALL_DIR) $(1)/usr/lib
252 $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/librcs_common.so $(1)/usr/lib/
253 $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/librcs_client.so $(1)/usr/lib/
254 $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/librcs_server.so $(1)/usr/lib/
255 $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/librcs_container.so $(1)/usr/lib/
256 endef
257
258 define Package/iotivity-resource-container-sample/install
259 $(INSTALL_DIR) $(1)/usr/bin
260 $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/service/resource-container/ContainerSample $(1)/usr/bin/
261 endef
262
263 define Package/iotivity-resource-container-hue/install
264 $(INSTALL_DIR) $(1)/usr/lib
265 $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/libHueBundle.so $(1)/usr/lib/
266 endef
267
268 define Package/iotivity-example-garage/install
269 $(INSTALL_DIR) $(1)/usr/bin
270 $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/resource/examples/garageclient $(1)/usr/bin/
271 $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/resource/examples/garageserver $(1)/usr/bin/
272 endef
273
274 define Package/iotivity-example-simple/install
275 $(INSTALL_DIR) $(1)/usr/bin
276 $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/resource/examples/simpleclient $(1)/usr/bin/
277 $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/resource/examples/simpleserver $(1)/usr/bin/
278 endef
279
280
281 $(eval $(call BuildPackage,iotivity))
282 $(eval $(call BuildPackage,iotivity-cpp))
283 $(eval $(call BuildPackage,iotivity-resource-directory-lib))
284 $(eval $(call BuildPackage,iotivity-oic-middle))
285 $(eval $(call BuildPackage,iotivity-resource-container-lib))
286 $(eval $(call BuildPackage,iotivity-resource-container-sample))
287 $(eval $(call BuildPackage,iotivity-resource-container-hue))
288 $(eval $(call BuildPackage,iotivity-example-garage))
289 $(eval $(call BuildPackage,iotivity-example-simple))