4 Summary: Samsung IoT Connectivity
5 Group: Network & Connectivity / IoT Connectivity
7 URL: https://www.iotivity.org/
8 Source0: http://mirrors.kernel.org/%{name}/%{version}/%{name}-%{version}.tar.gz
9 Source1001: %{name}.manifest
10 Source1002: %{name}-test.manifest
13 %define TARGET_OS tizen
15 %define TARGET_OS linux
18 %if "%{tizen}" == "2.3"
19 %define TARGET_TRANSPORT IP
22 %if "%{profile}" == "ivi"
23 %define TARGET_TRANSPORT IP
26 %if "%{TARGET_OS}" == "linux"
27 %define TARGET_TRANSPORT IP
30 %define JOB %{?_smp_mflags}
32 # default is RELEASE mode.
33 # If DEBUG mode is needed, please use tizen_build_devel_mode
36 %if %{RELEASE} == "True"
37 %define build_mode release
39 %define build_mode debug
42 %ifarch armv7l armv7hl armv7nhl armv7tnhl armv7thl
43 %define TARGET_ARCH "armeabi-v7a"
46 %define TARGET_ARCH "arm64"
49 %define TARGET_ARCH "x86_64"
52 %define TARGET_ARCH "x86"
55 %define ex_install_dir %{buildroot}%{_bindir}
56 %define ex_lib_dir %{buildroot}%{_libdir}
57 %define ex_include_dir %{buildroot}%{_includedir}
59 %if 0%{?tizen_version_major} < 3
69 # Default values to be eventually overiden BEFORE or as gbs params:
70 %{!?ES_TARGET_ENROLLEE: %define ES_TARGET_ENROLLEE tizen}
71 %{!?LOGGING: %define LOGGING 1}
72 %{!?RD_MODE: %define RD_MODE CLIENT}
73 %{!?RELEASE: %define RELEASE 1}
74 %{!?ROUTING: %define ROUTING EP}
75 %{!?SECURED: %define SECURED 1}
76 %{!?TARGET_ARCH: %define TARGET_ARCH %{_arch}}
77 %{!?TARGET_OS: %define TARGET_OS tizen}
78 %{!?TARGET_TRANSPORT: %define TARGET_TRANSPORT IP,BLE}
79 %{!?VERBOSE: %define VERBOSE 1}
80 %{!?WITH_CLOUD: %define WITH_CLOUD 1}
81 %{!?WITH_MQ: %define WITH_MQ OFF}
82 %{!?WITH_PROXY: %define WITH_PROXY 0}
83 %{!?WITH_TCP: %define WITH_TCP 1}
84 %{!?DISABLE_TCP_SERVER: %define DISABLE_TCP_SERVER 1}
85 %{!?RD_MODE: %define RD_MODE CLIENT}
86 %{!?BLE_CUSTOM_ADV: %define BLE_CUSTOM_ADV False}
87 %{!?BLE_DIVISION: %define BLE_DIVISION VD}
88 %{!?BLE_TIZEN_30: %define BLE_TIZEN_30 True}
89 %{!?MULTIPLE_OWNER: %define MULTIPLE_OWNER 0}
91 BuildRequires: expat-devel
92 BuildRequires: python, libcurl-devel
94 BuildRequires: openssl-devel
95 BuildRequires: boost-devel
96 BuildRequires: boost-thread
97 BuildRequires: boost-system
98 BuildRequires: boost-filesystem
99 BuildRequires: pkgconfig(uuid)
100 BuildRequires: pkgconfig(glib-2.0)
101 BuildRequires: pkgconfig(sqlite3)
102 %if "%{TARGET_OS}" == "tizen"
103 BuildRequires: gettext-tools
104 BuildRequires: pkgconfig(dlog)
105 BuildRequires: pkgconfig(capi-network-connection)
106 BuildRequires: pkgconfig(capi-network-wifi)
107 BuildRequires: pkgconfig(capi-network-bluetooth) >= 0.1.52
110 BuildRequires: sqlite-devel
111 BuildRequires: gettext-devel
114 Requires(postun): /sbin/ldconfig
115 Requires(post): /sbin/ldconfig
118 An open source reference implementation of the OIC standard specifications
119 IoTivity Base Libraries are included.
123 Summary: Development files for %{name}
124 Group: Network & Connectivity/Service
125 Requires: %{name} = %{version}-%{release}
128 The %{name}-service package contains service libraries files for
129 developing applications that use %{name}-service.
132 Summary: Development files for %{name}
133 Group: Network & Connectivity/Testing
134 Requires: %{name} = %{version}-%{release}
137 The %{name}-test package contains example files to show
138 how the iotivity works using %{name}-test
141 Summary: Development files for %{name}
142 Group: Network & Connectivity/Development
143 Requires: %{name} = %{version}-%{release}
147 The %{name}-devel package contains libraries and header files for
148 developing applications that use %{name}.
152 chmod g-w %_sourcedir/*
154 cp LICENSE.md LICENSE
157 %if 0%{?tizen_version_major} < 3
160 cp %{SOURCE1001} ./%{name}-test.manifest
164 CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ;
165 scons %{JOB} --prefix=%{_prefix} \
166 ES_TARGET_ENROLLEE=%{ES_TARGET_ENROLLEE} \
167 LIB_INSTALL_DIR=%{_libdir} \
173 TARGET_ARCH=%{TARGET_ARCH} \
174 TARGET_OS=%{TARGET_OS} \
175 TARGET_TRANSPORT=%{TARGET_TRANSPORT} \
177 WITH_CLOUD=%{WITH_CLOUD} \
179 WITH_PROXY=%{WITH_PROXY} \
180 WITH_TCP=%{WITH_TCP} \
181 DISABLE_TCP_SERVER=%{DISABLE_TCP_SERVER} \
183 BLE_CUSTOM_ADV=%{BLE_CUSTOM_ADV} \
184 BLE_DIVISION=%{BLE_DIVISION} \
185 BLE_TIZEN_30=%{BLE_TIZEN_30} \
186 MULTIPLE_OWNER=%{MULTIPLE_OWNER} \
190 %if 0%{?tizen_version_major} < 3
191 mkdir -p %{buildroot}/%{_datadir}/license
192 cp LICENSE %{buildroot}/%{_datadir}/license/%{name}
195 mkdir -p %{ex_install_dir}
196 mkdir -p %{ex_include_dir}
197 mkdir -p %{ex_lib_dir}/pkgconfig
198 #cp out/%{TARGET_OS}/%{TARGET_ARCH}/%{build_mode}/examples/OICMiddle/OICMiddle %{ex_install_dir}
199 #cp out/%{TARGET_OS}/%{TARGET_ARCH}/%{build_mode}/resource/examples/devicediscoveryclient %{ex_install_dir}
200 #cp out/%{TARGET_OS}/%{TARGET_ARCH}/%{build_mode}/resource/examples/devicediscoveryserver %{ex_install_dir}
201 #cp out/%{TARGET_OS}/%{TARGET_ARCH}/%{build_mode}/resource/examples/fridgeclient %{ex_install_dir}
202 #cp out/%{TARGET_OS}/%{TARGET_ARCH}/%{build_mode}/resource/examples/fridgeserver %{ex_install_dir}
203 #cp out/%{TARGET_OS}/%{TARGET_ARCH}/%{build_mode}/resource/examples/garageclient %{ex_install_dir}
204 #cp out/%{TARGET_OS}/%{TARGET_ARCH}/%{build_mode}/resource/examples/garageserver %{ex_install_dir}
205 #cp out/%{TARGET_OS}/%{TARGET_ARCH}/%{build_mode}/resource/examples/groupclient %{ex_install_dir}
206 #cp out/%{TARGET_OS}/%{TARGET_ARCH}/%{build_mode}/resource/examples/groupserver %{ex_install_dir}
207 #cp out/%{TARGET_OS}/%{TARGET_ARCH}/%{build_mode}/resource/examples/lightserver %{ex_install_dir}
208 #cp out/%{TARGET_OS}/%{TARGET_ARCH}/%{build_mode}/resource/examples/presenceclient %{ex_install_dir}
209 #cp out/%{TARGET_OS}/%{TARGET_ARCH}/%{build_mode}/resource/examples/presenceserver %{ex_install_dir}
210 #cp out/%{TARGET_OS}/%{TARGET_ARCH}/%{build_mode}/resource/examples/roomclient %{ex_install_dir}
211 #cp out/%{TARGET_OS}/%{TARGET_ARCH}/%{build_mode}/resource/examples/roomserver %{ex_install_dir}
212 #cp out/%{TARGET_OS}/%{TARGET_ARCH}/%{build_mode}/resource/examples/simpleclient %{ex_install_dir}
213 #cp out/%{TARGET_OS}/%{TARGET_ARCH}/%{build_mode}/resource/examples/simpleclientHQ %{ex_install_dir}
214 #cp out/%{TARGET_OS}/%{TARGET_ARCH}/%{build_mode}/resource/examples/simpleclientserver %{ex_install_dir}
215 #cp out/%{TARGET_OS}/%{TARGET_ARCH}/%{build_mode}/resource/examples/simpleserver %{ex_install_dir}
216 #cp out/%{TARGET_OS}/%{TARGET_ARCH}/%{build_mode}/resource/examples/simpleserverHQ %{ex_install_dir}
217 #cp out/%{TARGET_OS}/%{TARGET_ARCH}/%{build_mode}/resource/examples/threadingsample %{ex_install_dir}
218 #cp out/%{TARGET_OS}/%{TARGET_ARCH}/%{build_mode}/resource/examples/oic_svr_db_server.dat %{ex_install_dir}
219 #cp out/%{TARGET_OS}/%{TARGET_ARCH}/%{build_mode}/resource/examples/oic_svr_db_client.dat %{ex_install_dir}
220 #cp out/%{TARGET_OS}/%{TARGET_ARCH}/%{build_mode}/libcoap.a %{buildroot}%{_libdir}
221 cp out/%{TARGET_OS}/%{TARGET_ARCH}/%{build_mode}/lib*.a %{buildroot}%{_libdir}
224 cp out/%{TARGET_OS}/%{TARGET_ARCH}/%{build_mode}/lib*.so %{buildroot}%{_libdir}
225 cp out/%{TARGET_OS}/%{TARGET_ARCH}/%{build_mode}/resource/src/lib*.so %{buildroot}%{_libdir}
226 cp out/%{TARGET_OS}/%{TARGET_ARCH}/%{build_mode}/resource/csdk/lib*.so %{buildroot}%{_libdir}
227 cp out/%{TARGET_OS}/%{TARGET_ARCH}/%{build_mode}/resource/oc_logger/lib*.so %{buildroot}%{_libdir}
228 cp out/%{TARGET_OS}/%{TARGET_ARCH}/%{build_mode}/service/easy-setup/mediator/richsdk/lib*.so %{buildroot}%{_libdir}
231 cp ./*.pc %{buildroot}%{_libdir}/pkgconfig
233 %if 0%{?WITH_PROXY} == 1
234 mkdir -p %{ex_install_dir}/proxy-sample
235 cp out/%{TARGET_OS}/%{TARGET_ARCH}/%{build_mode}/service/coap-http-proxy/samples/proxy_main %{ex_install_dir}/proxy-sample/
236 cp out/%{TARGET_OS}/%{TARGET_ARCH}/%{build_mode}/service/coap-http-proxy/samples/proxy_client %{ex_install_dir}/proxy-sample/
239 %if 0%{?SECURED} == 1
240 mkdir -p %{ex_install_dir}/provisioning
241 mkdir -p %{ex_install_dir}/provision-sample
242 mkdir -p %{ex_include_dir}/mbedtls
244 cp -R ./extlibs/mbedtls/mbedtls/include/mbedtls/ %{buildroot}%{_includedir}/mbedtls
245 cp ./resource/csdk/security/include/*.h %{buildroot}%{_includedir}
246 cp ./resource/csdk/connectivity/api/*.h %{buildroot}%{_includedir}/
247 cp ./resource/csdk/security/include/internal/*.h %{buildroot}%{_includedir}/
248 cp ./resource/csdk/security/provisioning/include/oxm/*.h %{buildroot}%{_includedir}
249 cp ./resource/csdk/security/provisioning/include/internal/*.h %{buildroot}%{_includedir}
250 cp ./resource/csdk/security/provisioning/include/*.h %{buildroot}%{_includedir}
251 cp out/%{TARGET_OS}/%{TARGET_ARCH}/%{build_mode}/resource/csdk/security/provisioning/sample/sampleserver_justworks %{ex_install_dir}/provision-sample/
252 cp ./resource/csdk/security/provisioning/sample/oic_svr_db_server_justworks.dat %{ex_install_dir}/provision-sample/
253 cp out/%{TARGET_OS}/%{TARGET_ARCH}/%{build_mode}/resource/csdk/security/provisioning/sample/sampleserver_randompin %{ex_install_dir}/provision-sample/
254 cp ./resource/csdk/security/provisioning/sample/oic_svr_db_server_randompin.dat %{ex_install_dir}/provision-sample/
258 cp resource/c_common/*.h %{buildroot}%{_includedir}
259 cp resource/c_common/ocrandom/include/*.h %{buildroot}%{_includedir}
260 cp resource/c_common/oic_string/include/*.h %{buildroot}%{_includedir}
261 cp resource/c_common/oic_malloc/include/*.h %{buildroot}%{_includedir}
262 cp resource/csdk/stack/include/*.h %{buildroot}%{_includedir}
263 cp resource/csdk/logger/include/*.h %{buildroot}%{_includedir}
265 cp service/easy-setup/inc/*.h %{buildroot}%{_includedir}
266 cp service/easy-setup/enrollee/inc/*.h %{buildroot}%{_includedir}
267 cp service/easy-setup/mediator/richsdk/inc/*.h %{buildroot}%{_includedir}
268 cp service/easy-setup/enrollee/inc/samsung/*.h %{buildroot}%{_includedir}
270 install -d %{buildroot}%{_includedir}/iotivity
271 ln -fs ../resource %{buildroot}%{_includedir}/iotivity/
272 ln -fs ../service %{buildroot}%{_includedir}/iotivity/
273 ln -fs ../c_common %{buildroot}%{_includedir}/iotivity/
275 rm -rfv out %{buildroot}/out %{buildroot}/${HOME} ||:
278 %post -p /sbin/ldconfig
280 %postun -p /sbin/ldconfig
283 %manifest %{name}.manifest
284 %defattr(-,root,root,-)
285 %if 0%{?tizen_version_major} < 3
286 %{_datadir}/license/%{name}
291 %{_libdir}/liboc_logger.so
292 %{_libdir}/liboc_logger_core.so
293 %{_libdir}/liboctbstack.so
294 %{_libdir}/libconnectivity_abstraction.so
295 %if 0%{?SECURED} == 1
296 %{_libdir}/libmbedtls.so
297 %{_libdir}/libocpmapi.so
298 %{_libdir}/libocprovision.so
302 %manifest %{name}.manifest
303 %defattr(-,root,root,-)
304 %if 0%{?tizen_version_major} < 3
305 %{_datadir}/license/%{name}
309 #%{_libdir}/libBMISensorBundle.so
310 #%{_libdir}/libDISensorBundle.so
311 #%{_libdir}/libHueBundle.so
312 %{_libdir}/librcs_client.so
313 %{_libdir}/librcs_common.so
314 #%{_libdir}/librcs_container.so
315 %{_libdir}/librcs_server.so
316 %{_libdir}/libresource_directory.so
317 %{_libdir}/libESEnrolleeSDK.so
318 %{_libdir}/libESMediatorRich.so
319 %{_libdir}/libnotification*.so
320 %if 0%{?WITH_PROXY} == 1
321 %{_libdir}/libcoap_http_proxy.so
323 %if "%{TARGET_OS}" == "linux"
324 %{_libdir}/libnotification*.so
328 %manifest %{name}-test.manifest
329 %defattr(-,root,root,-)
330 %if 0%{?tizen_version_major} < 3
331 %{_datadir}/license/%{name}
338 %defattr(-,root,root,-)
339 %if 0%{?tizen_version_major} < 3
340 %{_datadir}/license/%{name}
344 %if 0%{?SECURED} == 1
347 %{_libdir}/pkgconfig/%{name}.pc