Name: iotivity
-Version: 0.9.2
+Version: 1.0.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: 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
-%define release_mode true
+
+## 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
+%define RELEASE True
+%endif
+
+%{!?TARGET_TRANSPORT: %define TARGET_TRANSPORT IP,BT}
+%{!?SECURED: %define SECURED 0}
+%{!?LOGGING: %define LOGGING True}
+%{!?ROUTING: %define ROUTING GW}
%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}
Summary: Development files for %{name}
Group: Network & Connectivity/Development
Requires: %{name} = %{version}-%{release}
+Requires: pkgconfig
%description devel
The %{name}-devel package contains libraries and header files for
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
%build
%define RPM_ARCH %{_arch}
-%ifarch armv7l armv7l armv7hl armv7nhl armv7tnhl armv7thl
+%ifarch armv7l armv7hl armv7nhl armv7tnhl armv7thl
%define RPM_ARCH "armeabi-v7a"
%endif
%define RPM_ARCH "x86"
%endif
+#VERBOSE=1
+scons -j2 --prefix=%{_prefix} \
+ TARGET_OS=tizen TARGET_ARCH=%{RPM_ARCH} TARGET_TRANSPORT=%{TARGET_TRANSPORT} \
+ RELEASE=%{RELEASE} SECURED=%{SECURED} LOGGING=%{LOGGING} ROUTING=%{ROUTING} \
+ LIB_INSTALL_DIR=%{_libdir}
-scons -j 4 TARGET_OS=tizen TARGET_ARCH=%{RPM_ARCH} TARGET_TRANSPORT=IP RELEASE=%{release_mode}
%install
rm -rf %{buildroot}
-mkdir -p %{buildroot}%{_includedir}
-mkdir -p %{buildroot}%{_libdir}
-mkdir -p %{buildroot}%{_bindir}
-
-%if %{release_mode} == "true"
-
-cp out/tizen/*/release/resource/examples/devicediscoveryclient %{buildroot}%{_bindir}
-cp out/tizen/*/release/resource/examples/devicediscoveryserver %{buildroot}%{_bindir}
-cp out/tizen/*/release/resource/examples/fridgeclient %{buildroot}%{_bindir}
-cp out/tizen/*/release/resource/examples/fridgeserver %{buildroot}%{_bindir}
-cp out/tizen/*/release/resource/examples/garageclient %{buildroot}%{_bindir}
-cp out/tizen/*/release/resource/examples/garageserver %{buildroot}%{_bindir}
-cp out/tizen/*/release/resource/examples/groupclient %{buildroot}%{_bindir}
-cp out/tizen/*/release/resource/examples/groupserver %{buildroot}%{_bindir}
-cp out/tizen/*/release/resource/examples/lightserver %{buildroot}%{_bindir}
-cp out/tizen/*/release/resource/examples/presenceclient %{buildroot}%{_bindir}
-cp out/tizen/*/release/resource/examples/presenceserver %{buildroot}%{_bindir}
-cp out/tizen/*/release/resource/examples/roomclient %{buildroot}%{_bindir}
-cp out/tizen/*/release/resource/examples/roomserver %{buildroot}%{_bindir}
-cp out/tizen/*/release/resource/examples/simpleclient %{buildroot}%{_bindir}
-cp out/tizen/*/release/resource/examples/simpleclientHQ %{buildroot}%{_bindir}
-cp out/tizen/*/release/resource/examples/simpleclientserver %{buildroot}%{_bindir}
-cp out/tizen/*/release/resource/examples/simpleserver %{buildroot}%{_bindir}
-cp out/tizen/*/release/resource/examples/simpleserverHQ %{buildroot}%{_bindir}
-cp out/tizen/*/release/resource/examples/threadingsample %{buildroot}%{_bindir}
-cp out/tizen/*/release/lib*.so %{buildroot}%{_libdir}
-cp out/tizen/*/release/libSSMSDK.a %{buildroot}%{_libdir}
-cp out/tizen/*/release/libppm.a %{buildroot}%{_libdir}
-cp out/tizen/*/release/service/protocol-plugin/plugins/mqtt-fan/*.so %{buildroot}%{_libdir}
-cp out/tizen/*/release/service/protocol-plugin/plugins/mqtt-light/*.so %{buildroot}%{_libdir}
+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=%{SECURED} LOGGING=%{LOGGING} ROUTING=%{ROUTING} \
+ LIB_INSTALL_DIR=%{_libdir}
-%else
-
-cp out/tizen/*/debug/resource/examples/devicediscoveryclient %{buildroot}%{_bindir}
-cp out/tizen/*/debug/resource/examples/devicediscoveryserver %{buildroot}%{_bindir}
-cp out/tizen/*/debug/resource/examples/fridgeclient %{buildroot}%{_bindir}
-cp out/tizen/*/debug/resource/examples/fridgeserver %{buildroot}%{_bindir}
-cp out/tizen/*/debug/resource/examples/garageclient %{buildroot}%{_bindir}
-cp out/tizen/*/debug/resource/examples/garageserver %{buildroot}%{_bindir}
-cp out/tizen/*/debug/resource/examples/groupclient %{buildroot}%{_bindir}
-cp out/tizen/*/debug/resource/examples/groupserver %{buildroot}%{_bindir}
-cp out/tizen/*/debug/resource/examples/lightserver %{buildroot}%{_bindir}
-cp out/tizen/*/debug/resource/examples/presenceclient %{buildroot}%{_bindir}
-cp out/tizen/*/debug/resource/examples/presenceserver %{buildroot}%{_bindir}
-cp out/tizen/*/debug/resource/examples/roomclient %{buildroot}%{_bindir}
-cp out/tizen/*/debug/resource/examples/roomserver %{buildroot}%{_bindir}
-cp out/tizen/*/debug/resource/examples/simpleclient %{buildroot}%{_bindir}
-cp out/tizen/*/debug/resource/examples/simpleclientHQ %{buildroot}%{_bindir}
-cp out/tizen/*/debug/resource/examples/simpleclientserver %{buildroot}%{_bindir}
-cp out/tizen/*/debug/resource/examples/simpleserver %{buildroot}%{_bindir}
-cp out/tizen/*/debug/resource/examples/simpleserverHQ %{buildroot}%{_bindir}
-cp out/tizen/*/debug/resource/examples/threadingsample %{buildroot}%{_bindir}
-cp out/tizen/*/debug/lib*.so %{buildroot}%{_libdir}
-cp out/tizen/*/debug/libSSMSDK.a %{buildroot}%{_libdir}
-cp out/tizen/*/debug/libppm.a %{buildroot}%{_libdir}
-cp out/tizen/*/debug/service/protocol-plugin/plugins/mqtt-fan/*.so %{buildroot}%{_libdir}
-cp out/tizen/*/debug/service/protocol-plugin/plugins/mqtt-light/*.so %{buildroot}%{_libdir}
+# For Example
+%if %{RELEASE} == "True"
+%define build_mode release
+%else
+%define build_mode debug
+%endif
+%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.json %{ex_install_dir}
+cp out/tizen/*/%{build_mode}/resource/examples/oic_svr_db_client.json %{ex_install_dir}
+%if 0%{?SECURED} == 1
+mkdir -p %{ex_install_dir}/provisioning
+cp out/tizen/*/%{build_mode}/resource/provisioning/examples/oic_svr_db_client.json %{ex_install_dir}/provisioning/
+cp out/tizen/*/%{build_mode}/resource/provisioning/examples/provisioningclient %{ex_install_dir}/provisioning/
%endif
-cp resource/csdk/stack/include/*.h %{buildroot}%{_includedir}
-cp resource/csdk/logger/include/*.h %{buildroot}%{_includedir}
-cp resource/csdk/ocrandom/include/*.h %{buildroot}%{_includedir}
-cp -r resource/oc_logger/include/* %{buildroot}%{_includedir}
-cp resource/include/*.h %{buildroot}%{_includedir}
-
-cp service/things-manager/sdk/inc/*.h %{buildroot}%{_includedir}
-cp service/soft-sensor-manager/SDK/cpp/include/*.h %{buildroot}%{_includedir}
-cp service/protocol-plugin/plugin-manager/src/*.h %{buildroot}%{_includedir}
+# For iotcon
+cp resource/csdk/stack/include/ocpayload.h %{buildroot}%{_includedir}/resource
+cp resource/c_common/ocrandom/include/ocrandom.h %{buildroot}%{_includedir}/resource
%if 0%{?tizen_version_major} < 3
mkdir -p %{buildroot}/%{_datadir}/license
%files service
%manifest %{name}.manifest
%defattr(-,root,root,-)
-%{_libdir}/libBMISensor.so
-%{_libdir}/libDiscomfortIndexSensor.so
-%{_libdir}/libmosquittopp.so
-%{_libdir}/libpmimpl.so
-%{_libdir}/libSSMCore.so
+%{_libdir}/libBMISensorBundle.so
+%{_libdir}/libDISensorBundle.so
+%{_libdir}/libresource_hosting.so
%{_libdir}/libTGMSDKLibrary.so
-%{_libdir}/fanserver*.so
-%{_libdir}/lightserver*.so
+%{_libdir}/libHueBundle.so
+%{_libdir}/librcs_client.so
+%{_libdir}/librcs_common.so
+%{_libdir}/librcs_container.so
+%{_libdir}/librcs_server.so
%if 0%{?tizen_version_major} < 3
%{_datadir}/license/%{name}-service
%else
%files test
%manifest %{name}-test.manifest
%defattr(-,root,root,-)
-%{_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}/*
%if 0%{?tizen_version_major} < 3
%{_datadir}/license/%{name}-test
%else
%files devel
%defattr(-,root,root,-)
%{_libdir}/lib*.a
+%{_libdir}/pkgconfig/%{name}.pc
%{_includedir}/*