Merge pull request #2777 from blogic/krb5
[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.1.0
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:=98f8d5b0304c357520c4343d983491e2
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-things-manager-lib \
30 CONFIG_PACKAGE_iotivity-oic-middle \
31 CONFIG_PACKAGE_iotivity-things-manager \
32 CONFIG_PACKAGE_iotivity-resource-container-lib \
33 CONFIG_PACKAGE_iotivity-resource-container-sample \
34 CONFIG_PACKAGE_iotivity-resource-container-hue \
35 CONFIG_PACKAGE_iotivity-example-garage \
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
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 default y
67 help
68 Activate security support.
69
70 endif
71 endef
72
73
74 define Package/iotivity-cpp
75 SECTION:=net
76 CATEGORY:=Network
77 DEPENDS:=+iotivity +libpthread +libstdcpp
78 TITLE:=IoTivity C++ Library
79 URL:=https://www.iotivity.org
80 endef
81
82 define Package/iotivity-cpp/description
83 IoTivity is a framework for the Internet of Things based on the
84 Open Interconnect Consortium Specification.
85 endef
86
87
88 define Package/iotivity-things-manager-lib
89 SECTION:=net
90 CATEGORY:=Network
91 DEPENDS:=+iotivity +iotivity-cpp +libstdcpp
92 TITLE:=IoTivity things manager lib
93 URL:=https://www.iotivity.org
94 endef
95
96 define Package/iotivity-things-manager-lib/description
97 IoTivity things-manager lib
98 endef
99
100
101 define Package/iotivity-oic-middle
102 SECTION:=net
103 CATEGORY:=Network
104 DEPENDS:=+iotivity +iotivity-cpp
105 TITLE:=IoTivity OIC Middle
106 URL:=https://www.iotivity.org
107 endef
108
109 define Package/iotivity-oic-middle/description
110 IoTivity OIC Middle
111 endef
112
113
114 define Package/iotivity-things-manager
115 SECTION:=net
116 CATEGORY:=Network
117 DEPENDS:=+iotivity +iotivity-cpp +iotivity-things-manager-lib
118 TITLE:=IoTivity things manager
119 URL:=https://www.iotivity.org
120 endef
121
122 define Package/iotivity-things-manager/description
123 IoTivity things manager
124 endef
125
126 define Package/iotivity-resource-container-lib
127 SECTION:=net
128 CATEGORY:=Network
129 DEPENDS:=+iotivity +iotivity-cpp +boost +boost-system +boost-thread +boost-date_time
130 TITLE:=IoTivity Resource Container library
131 URL:=https://www.iotivity.org
132 endef
133
134 define Package/iotivity-resource-container-sample
135 SECTION:=net
136 CATEGORY:=Network
137 DEPENDS:=+iotivity +iotivity-resource-container-lib
138 TITLE:=IoTivity Resource Container sample Application
139 URL:=https://www.iotivity.org
140 endef
141
142 define Package/iotivity-resource-container-hue
143 SECTION:=net
144 CATEGORY:=Network
145 DEPENDS:=+iotivity +iotivity-resource-container-lib +libcurl
146 TITLE:=IoTivity Resource Container Hue Bundle
147 URL:=https://www.iotivity.org
148 endef
149
150 define Package/iotivity-example-garage
151 SECTION:=net
152 CATEGORY:=Network
153 DEPENDS:=+iotivity +iotivity-cpp
154 TITLE:=IoTivity Garage example
155 URL:=https://www.iotivity.org
156 endef
157
158 define Package/iotivity-example-garage/description
159 An IoTivity example application
160 endef
161
162
163 PKG_TINYCBOR_NAME:=tinycbor
164 PKG_TINYCBOR_VERSION:=43e3ac9490cf19459ec7b7bd13df3b66810fb62a
165 PKG_TINYCBOR_SOURCE:=$(PKG_TINYCBOR_NAME)-$(PKG_TINYCBOR_VERSION).tar.bz2
166 PKG_TINYCBOR_PROTO:=git
167 PKG_TINYCBOR_SOURCE_URL:=https://github.com/01org/tinycbor.git
168 PKG_TINYCBOR_SUBDIR:=$(PKG_TINYCBOR_NAME)
169 #PKG_TINYCBOR_MIRROR_MD5SUM:=?
170
171 define Download/iotivity-tinycbor
172 FILE:=$(PKG_TINYCBOR_SOURCE)
173 URL:=$(PKG_TINYCBOR_SOURCE_URL)
174 PROTO:=$(PKG_TINYCBOR_PROTO)
175 VERSION:=$(PKG_TINYCBOR_VERSION)
176 SUBDIR:=$(PKG_TINYCBOR_SUBDIR)
177 #MIRROR_MD5SUM:=$(PKG_TINYCBOR_MIRROR_MD5SUM)
178 endef
179 $(eval $(call Download,iotivity-tinycbor))
180
181 PKG_SQLITE_NAME:=sqlite
182 PKG_SQLITE_VERSION:=3081101
183 PKG_SQLITE_SOURCE:=$(PKG_SQLITE_NAME)-amalgamation-$(PKG_SQLITE_VERSION).zip
184 PKG_SQLITE_SOURCE_URL:=http://www.sqlite.org/2015/
185 PKG_SQLITE_SUBDIR:=$(PKG_SQLITE_NAME)
186 PKG_SQLITE_MD5SUM:=94907e831502e2080b76e281cfa24dde
187
188 define Download/iotivity-sqlite
189 FILE:=$(PKG_SQLITE_SOURCE)
190 URL:=$(PKG_SQLITE_SOURCE_URL)
191 VERSION:=$(PKG_SQLITE_VERSION)
192 SUBDIR:=$(PKG_SQLITE_SUBDIR)
193 MD5SUM:=$(PKG_SQLITE_MD5SUM)
194 endef
195 $(eval $(call Download,iotivity-sqlite))
196
197
198 SCONS_OPTIONS += \
199 TARGET_OS=linux \
200 TARGET_TRANSPORT=IP \
201 TARGET_ARCH=$(ARCH) \
202 STAGING_DIR=$(STAGING_DIR) \
203 LOGGING=true \
204 $(if $(CONFIG_PACKAGE_iotivity),liboctbstack) \
205 $(if $(CONFIG_PACKAGE_iotivity-cpp),liboc) \
206 $(if $(CONFIG_PACKAGE_iotivity-things-manager-lib),libTGMSDK) \
207 $(if $(CONFIG_PACKAGE_iotivity-oic-middle),examples) \
208 $(if $(CONFIG_PACKAGE_iotivity-things-manager),ConServerApp ConClientApp BootstrapServerApp) \
209 $(if $(CONFIG_PACKAGE_iotivity-resource-container-lib),libResContainer) \
210 $(if $(CONFIG_PACKAGE_iotivity-resource-container-sample),containersample) \
211 $(if $(CONFIG_PACKAGE_iotivity-resource-container-hue),libHueBundle) \
212 $(if $(CONFIG_PACKAGE_iotivity-example-garage),examples) \
213
214 ifeq ($(CONFIG_PACKAGE_iotivity_DEBUG),y)
215 SCONS_OPTIONS += RELEASE=false
216 APP_OPTIM:=debug
217 else
218 SCONS_OPTIONS += RELEASE=true
219 APP_OPTIM:=release
220 endif
221
222 ifeq ($(CONFIG_PACKAGE_iotivity_SECURE),y)
223 SCONS_OPTIONS += SECURED=1
224 else
225 SCONS_OPTIONS += SECURED=0
226 endif
227
228 ifneq ($(findstring c,$(OPENWRT_VERBOSE)),)
229 SCONS_OPTIONS += VERBOSE=true
230 endif
231
232 define Build/Prepare
233 $(call Build/Prepare/Default)
234 $(TAR) -C $(PKG_BUILD_DIR)/extlibs/tinycbor/ -xjf $(DL_DIR)/$(PKG_TINYCBOR_SOURCE)
235 unzip -d $(PKG_BUILD_DIR)/extlibs/sqlite3/ $(DL_DIR)/$(PKG_SQLITE_SOURCE)
236 mv $(PKG_BUILD_DIR)/extlibs/sqlite3/$(PKG_SQLITE_NAME)-amalgamation-$(PKG_SQLITE_VERSION)/sqlite3.h $(PKG_BUILD_DIR)/extlibs/sqlite3/
237 mv $(PKG_BUILD_DIR)/extlibs/sqlite3/$(PKG_SQLITE_NAME)-amalgamation-$(PKG_SQLITE_VERSION)/sqlite3.c $(PKG_BUILD_DIR)/extlibs/sqlite3/
238 endef
239
240
241 define Build/Configure
242 (cd $(PKG_BUILD_DIR); \
243 $(SCONS_VARS) \
244 scons \
245 $(SCONS_OPTIONS) \
246 )
247 endef
248
249
250 define Package/iotivity/install
251 $(INSTALL_DIR) $(1)/usr/lib
252 $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/liboctbstack.so $(1)/usr/lib/
253 ifeq ($(CONFIG_PACKAGE_iotivity_SECURE),y)
254 $(INSTALL_DIR) $(1)/etc/iotivity/
255 $(INSTALL_DATA) ./files/etc/iotivity/oic_svr_db.cbor $(1)/etc/iotivity/
256 endif
257 endef
258
259 define Package/iotivity-cpp/install
260 $(INSTALL_DIR) $(1)/usr/lib
261 $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/liboc.so $(1)/usr/lib/
262 $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/liboc_logger.so $(1)/usr/lib/
263 endef
264
265 define Package/iotivity-things-manager-lib/install
266 $(INSTALL_DIR) $(1)/usr/lib
267 $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/libTGMSDKLibrary.so $(1)/usr/lib/
268 endef
269
270 define Package/iotivity-oic-middle/install
271 $(INSTALL_DIR) $(1)/usr/bin
272 $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/examples/OICMiddle/OICMiddle $(1)/usr/bin/
273 endef
274
275 define Package/iotivity-things-manager/install
276 $(INSTALL_DIR) $(1)/usr/bin
277 $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/service/things-manager/sampleapp/linux/configuration/bootstrapserver $(1)/usr/bin/
278 $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/service/things-manager/sampleapp/linux/configuration/con-server $(1)/usr/bin/
279 $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/service/things-manager/sampleapp/linux/configuration/con-client $(1)/usr/bin/
280 endef
281
282 define Package/iotivity-resource-container-lib/install
283 $(INSTALL_DIR) $(1)/usr/lib
284 $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/librcs_common.so $(1)/usr/lib/
285 $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/librcs_client.so $(1)/usr/lib/
286 $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/librcs_server.so $(1)/usr/lib/
287 $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/librcs_container.so $(1)/usr/lib/
288 endef
289
290 define Package/iotivity-resource-container-sample/install
291 $(INSTALL_DIR) $(1)/usr/bin
292 $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/service/resource-container/ContainerSample $(1)/usr/bin/
293 endef
294
295 define Package/iotivity-resource-container-hue/install
296 $(INSTALL_DIR) $(1)/usr/lib
297 $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/libHueBundle.so $(1)/usr/lib/
298 endef
299
300 define Package/iotivity-example-garage/install
301 $(INSTALL_DIR) $(1)/usr/bin
302 $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/resource/examples/garageclient $(1)/usr/bin/
303 $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/resource/examples/garageserver $(1)/usr/bin/
304 endef
305
306
307 $(eval $(call BuildPackage,iotivity))
308 $(eval $(call BuildPackage,iotivity-cpp))
309 $(eval $(call BuildPackage,iotivity-things-manager-lib))
310 $(eval $(call BuildPackage,iotivity-oic-middle))
311 $(eval $(call BuildPackage,iotivity-things-manager))
312 $(eval $(call BuildPackage,iotivity-resource-container-lib))
313 $(eval $(call BuildPackage,iotivity-resource-container-sample))
314 $(eval $(call BuildPackage,iotivity-resource-container-hue))
315 $(eval $(call BuildPackage,iotivity-example-garage))