Name: iotivity
-Version: 1.0.0
+Version: 1.1.1
Release: 0
-Summary: IoTivity Base Stack & IoTivity Services
+Summary: IoT Connectivity sponsored by the OIC
Group: Network & Connectivity/Other
License: Apache-2.0
URL: https://www.iotivity.org/
Source0: %{name}-%{version}.tar.bz2
Source1001: %{name}.manifest
Source1002: %{name}-test.manifest
-BuildRequires: gettext, expat-devel
+BuildRequires: gettext-tools, expat-devel
BuildRequires: python, libcurl-devel
BuildRequires: scons
-BuildRequires: openssl-devel
BuildRequires: boost-devel
-BuildRequires: boost-thread
-BuildRequires: boost-system
-BuildRequires: boost-filesystem
BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(uuid)
BuildRequires: pkgconfig(capi-network-wifi)
BuildRequires: pkgconfig(capi-network-bluetooth)
-BuildRequires: pkgconfig(capi-appfw-app-common)
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(sqlite3)
Requires(postun): /sbin/ldconfig
Requires(post): /sbin/ldconfig
+%if 0%{?speedpython:1} && 0%{?en_speedpython:1}
+%en_speedpython
+%endif
-
-## If tizen 2.x, RELEASE follows tizen_build_binary_release_type_eng. ##
-## and if tizen 3.0, RELEASE follows tizen_build_devel_mode. ##
-%if 0%{?tizen_build_devel_mode} == 1 || 0%{?tizen_build_binary_release_type_eng} == 1
-%define RELEASE False
-%else
+# default is RELEASE mode.
+# If DEBUG mode is needed, please use tizen_build_devel_mode
%define RELEASE True
-%endif
-%{!?TARGET_TRANSPORT: %define TARGET_TRANSPORT IP,BT}
-%{!?SECURED: %define SECURED 0}
+%{!?TARGET_TRANSPORT: %define TARGET_TRANSPORT IP}
%{!?LOGGING: %define LOGGING True}
%{!?ROUTING: %define ROUTING GW}
+%{!?ES_TARGET_ENROLLEE: %define ES_TARGET_ENROLLEE tizen}
+%{!?ES_ROLE: %define ES_ROLE enrollee}
+%{!?ES_SOFTAP_MODE: %define ES_SOFTAP_MODE MEDIATOR_SOFTAP}
+%{!?VERBOSE: %define VERBOSE 0}
%description
-IoTivity Base (RICH & LITE) Stack & IoTivity Services
+An open source reference implementation of the OIC standard specifications
+IoTivity Base Libraries are included.
+
%package service
Summary: Development files for %{name}
developing applications that use %{name}.
%prep
-%setup -q -n %{name}-%{version}
+%setup -q
+chmod g-w %_sourcedir/*
+
cp LICENSE.md LICENSE.APLv2
cp %{SOURCE1001} .
%if 0%{?tizen_version_major} < 3
%define RPM_ARCH "x86"
%endif
+%define JOB "-j4"
-scons -j 4 --prefix=%{_prefix} \
- TARGET_OS=tizen TARGET_ARCH=%{RPM_ARCH} TARGET_TRANSPORT=%{TARGET_TRANSPORT} \
- RELEASE=%{RELEASE} SECURED=%{SECURED} LOGGING=%{LOGGING} ROUTING=%{ROUTING} \
- INSTALL_ROOT=%{buildroot}
+%if 0%{?speedpython}
+%define JOB %{?_smp_mflags}
+%endif
-%install
-rm -rf %{buildroot}
-scons install --prefix=%{_prefix} \
- TARGET_OS=tizen TARGET_ARCH=%{RPM_ARCH} TARGET_TRANSPORT=%{TARGET_TRANSPORT} \
- RELEASE=%{RELEASE} SECURED=%{SECURED} LOGGING=%{LOGGING} ROUTING=%{ROUTING} \
- INSTALL_ROOT=%{buildroot}
+scons %{JOB} --prefix=%{_prefix} \
+ VERBOSE=%{VERBOSE} \
+ TARGET_OS=tizen TARGET_ARCH=%{RPM_ARCH} TARGET_TRANSPORT=%{TARGET_TRANSPORT} \
+ RELEASE=%{RELEASE} SECURED=1 LOGGING=%{LOGGING} ROUTING=%{ROUTING} \
+ ES_TARGET_ENROLLEE=%{ES_TARGET_ENROLLEE} ES_ROLE=%{ES_ROLE} ES_SOFTAP_MODE=%{ES_SOFTAP_MODE} \
+ LIB_INSTALL_DIR=%{_libdir}
-mkdir -p %{buildroot}%{_includedir}
-mkdir -p %{buildroot}%{_libdir}
-mkdir -p %{buildroot}%{_libdir}/pkgconfig
-mkdir -p %{buildroot}%{_bindir}
+%install
+rm -rf %{buildroot}
+CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ;
+scons install --install-sandbox=%{buildroot} --prefix=%{_prefix} \
+ TARGET_OS=tizen TARGET_ARCH=%{RPM_ARCH} TARGET_TRANSPORT=%{TARGET_TRANSPORT} \
+ RELEASE=%{RELEASE} SECURED=1 LOGGING=%{LOGGING} ROUTING=%{ROUTING} \
+ ES_TARGET_ENROLLEE=%{ES_TARGET_ENROLLEE} ES_ROLE=%{ES_ROLE} ES_SOFTAP_MODE=%{ES_SOFTAP_MODE} \
+ LIB_INSTALL_DIR=%{_libdir}
+# For Example
%if %{RELEASE} == "True"
%define build_mode release
%else
%define build_mode debug
%endif
-
-# For Example
-cp out/tizen/*/%{build_mode}/examples/OICMiddle/OICMiddle %{buildroot}%{_bindir}
-cp out/tizen/*/%{build_mode}/resource/examples/devicediscoveryclient %{buildroot}%{_bindir}
-cp out/tizen/*/%{build_mode}/resource/examples/devicediscoveryserver %{buildroot}%{_bindir}
-cp out/tizen/*/%{build_mode}/resource/examples/fridgeclient %{buildroot}%{_bindir}
-cp out/tizen/*/%{build_mode}/resource/examples/fridgeserver %{buildroot}%{_bindir}
-cp out/tizen/*/%{build_mode}/resource/examples/garageclient %{buildroot}%{_bindir}
-cp out/tizen/*/%{build_mode}/resource/examples/garageserver %{buildroot}%{_bindir}
-cp out/tizen/*/%{build_mode}/resource/examples/groupclient %{buildroot}%{_bindir}
-cp out/tizen/*/%{build_mode}/resource/examples/groupserver %{buildroot}%{_bindir}
-cp out/tizen/*/%{build_mode}/resource/examples/lightserver %{buildroot}%{_bindir}
-cp out/tizen/*/%{build_mode}/resource/examples/presenceclient %{buildroot}%{_bindir}
-cp out/tizen/*/%{build_mode}/resource/examples/presenceserver %{buildroot}%{_bindir}
-cp out/tizen/*/%{build_mode}/resource/examples/roomclient %{buildroot}%{_bindir}
-cp out/tizen/*/%{build_mode}/resource/examples/roomserver %{buildroot}%{_bindir}
-cp out/tizen/*/%{build_mode}/resource/examples/simpleclient %{buildroot}%{_bindir}
-cp out/tizen/*/%{build_mode}/resource/examples/simpleclientHQ %{buildroot}%{_bindir}
-cp out/tizen/*/%{build_mode}/resource/examples/simpleclientserver %{buildroot}%{_bindir}
-cp out/tizen/*/%{build_mode}/resource/examples/simpleserver %{buildroot}%{_bindir}
-cp out/tizen/*/%{build_mode}/resource/examples/simpleserverHQ %{buildroot}%{_bindir}
-cp out/tizen/*/%{build_mode}/resource/examples/threadingsample %{buildroot}%{_bindir}
-cp out/tizen/*/%{build_mode}/resource/examples/oic_svr_db_server.json %{buildroot}%{_bindir}
-cp out/tizen/*/%{build_mode}/resource/examples/oic_svr_db_client.json %{buildroot}%{_bindir}
-
-# For iotcon
-cp resource/csdk/stack/include/ocpayload.h %{buildroot}%{_includedir}/resource
-cp resource/csdk/ocrandom/include/ocrandom.h %{buildroot}%{_includedir}/resource
+%define ex_install_dir %{buildroot}%{_bindir}
+mkdir -p %{ex_install_dir}
+cp out/tizen/*/%{build_mode}/examples/OICMiddle/OICMiddle %{ex_install_dir}
+cp out/tizen/*/%{build_mode}/resource/examples/devicediscoveryclient %{ex_install_dir}
+cp out/tizen/*/%{build_mode}/resource/examples/devicediscoveryserver %{ex_install_dir}
+cp out/tizen/*/%{build_mode}/resource/examples/fridgeclient %{ex_install_dir}
+cp out/tizen/*/%{build_mode}/resource/examples/fridgeserver %{ex_install_dir}
+cp out/tizen/*/%{build_mode}/resource/examples/garageclient %{ex_install_dir}
+cp out/tizen/*/%{build_mode}/resource/examples/garageserver %{ex_install_dir}
+cp out/tizen/*/%{build_mode}/resource/examples/groupclient %{ex_install_dir}
+cp out/tizen/*/%{build_mode}/resource/examples/groupserver %{ex_install_dir}
+cp out/tizen/*/%{build_mode}/resource/examples/lightserver %{ex_install_dir}
+cp out/tizen/*/%{build_mode}/resource/examples/presenceclient %{ex_install_dir}
+cp out/tizen/*/%{build_mode}/resource/examples/presenceserver %{ex_install_dir}
+cp out/tizen/*/%{build_mode}/resource/examples/roomclient %{ex_install_dir}
+cp out/tizen/*/%{build_mode}/resource/examples/roomserver %{ex_install_dir}
+cp out/tizen/*/%{build_mode}/resource/examples/simpleclient %{ex_install_dir}
+cp out/tizen/*/%{build_mode}/resource/examples/simpleclientHQ %{ex_install_dir}
+cp out/tizen/*/%{build_mode}/resource/examples/simpleclientserver %{ex_install_dir}
+cp out/tizen/*/%{build_mode}/resource/examples/simpleserver %{ex_install_dir}
+cp out/tizen/*/%{build_mode}/resource/examples/simpleserverHQ %{ex_install_dir}
+cp out/tizen/*/%{build_mode}/resource/examples/threadingsample %{ex_install_dir}
+cp out/tizen/*/%{build_mode}/resource/examples/oic_svr_db_server.dat %{ex_install_dir}
+cp out/tizen/*/%{build_mode}/resource/examples/oic_svr_db_client.dat %{ex_install_dir}
+mkdir -p %{ex_install_dir}/provisioning
+cp out/tizen/*/%{build_mode}/resource/csdk/security/provisioning/sample/provisioningclient %{ex_install_dir}/provisioning/
+cp out/tizen/*/%{build_mode}/resource/csdk/security/provisioning/sample/oic_svr_db_client.dat %{ex_install_dir}/provisioning/
+cp out/tizen/*/%{build_mode}/resource/csdk/security/provisioning/sample/sampleserver_justworks %{ex_install_dir}/provisioning/
+cp out/tizen/*/%{build_mode}/resource/csdk/security/provisioning/sample/oic_svr_db_server_justworks.dat %{ex_install_dir}/provisioning/
+cp out/tizen/*/%{build_mode}/resource/csdk/security/provisioning/sample/sampleserver_randompin %{ex_install_dir}/provisioning/
+cp out/tizen/*/%{build_mode}/resource/csdk/security/provisioning/sample/oic_svr_db_server_randompin.dat %{ex_install_dir}/provisioning/
+
+cp ./resource/csdk/security/include/pinoxmcommon.h %{buildroot}%{_includedir}
+cp ./resource/csdk/security/include/securevirtualresourcetypes.h %{buildroot}%{_includedir}
+cp ./resource/csdk/security/provisioning/include/oxm/*.h %{buildroot}%{_includedir}
+cp ./resource/csdk/security/provisioning/include/internal/*.h %{buildroot}%{_includedir}
+cp ./resource/csdk/security/provisioning/include/*.h %{buildroot}%{_includedir}
+cp ./resource/csdk/connectivity/api/casecurityinterface.h %{buildroot}%{_includedir}
+cp ./resource/csdk/connectivity/api/cacommon.h %{buildroot}%{_includedir}
+
+# For IoTCon
+cp ./resource/csdk/security/include/internal/doxmresource.h %{buildroot}%{_includedir}
+cp ./resource/csdk/security/include/internal/verresource.h %{buildroot}%{_includedir}
%if 0%{?tizen_version_major} < 3
mkdir -p %{buildroot}/%{_datadir}/license
cp LICENSE.APLv2 %{buildroot}/%{_datadir}/license/%{name}-test
%endif
+cp service/things-manager/sdk/inc/*.h %{buildroot}%{_includedir}
+cp service/easy-setup/inc/*.h %{buildroot}%{_includedir}
+cp service/easy-setup/enrollee/inc/*.h %{buildroot}%{_includedir}
+
+
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%{_libdir}/liboc_logger_core.so
%{_libdir}/liboctbstack.so
%{_libdir}/libconnectivity_abstraction.so
+%{_libdir}/libocpmapi.so
+%{_libdir}/libocprovision.so
%if 0%{?tizen_version_major} < 3
%{_datadir}/license/%{name}
%else
%{_libdir}/librcs_common.so
%{_libdir}/librcs_container.so
%{_libdir}/librcs_server.so
+%{_libdir}/libESEnrolleeSDK.so
%if 0%{?tizen_version_major} < 3
%{_datadir}/license/%{name}-service
%else
%files test
%manifest %{name}-test.manifest
%defattr(-,root,root,-)
-%{_bindir}/OICMiddle
-%{_bindir}/devicediscoveryclient
-%{_bindir}/devicediscoveryserver
-%{_bindir}/fridgeclient
-%{_bindir}/fridgeserver
-%{_bindir}/garageclient
-%{_bindir}/garageserver
-%{_bindir}/groupclient
-%{_bindir}/groupserver
-%{_bindir}/lightserver
-%{_bindir}/presenceclient
-%{_bindir}/presenceserver
-%{_bindir}/roomclient
-%{_bindir}/roomserver
-%{_bindir}/simpleclient
-%{_bindir}/simpleclientHQ
-%{_bindir}/simpleclientserver
-%{_bindir}/simpleserver
-%{_bindir}/simpleserverHQ
-%{_bindir}/threadingsample
-%{_bindir}/oic_svr_db_server.json
-%{_bindir}/oic_svr_db_client.json
+%{_bindir}/*
%if 0%{?tizen_version_major} < 3
%{_datadir}/license/%{name}-test
%else