Name: context-provider
Summary: Context Provider
-Version: 0.9.13
+Version: 0.9.14
Release: 1
Group: Service/Context
License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
+Provides: context-provider-profile_common = %{version}-%{release}
+Provides: context-provider-profile_wearable = %{version}-%{release}
+Provides: context-provider-profile_tv = %{version}-%{release}
+Provides: context-provider-profile_ivi = %{version}-%{release}
-%define BUILD_PROFILE %{?profile}%{!?profile:%{?tizen_profile_name}}
+# Temporarily need to keep this until context-provider is in Tizen:TV OBS project.
+# Once this package is moved to Base2, we can remove al BUILD_PROFILE related statements (if/endif)
+# In order to be prepared for transition period, we defined "null"
+%define BUILD_PROFILE %{?profile}%{!?profile:%{?tizen_profile_name}%{!?tizen_profile_name:null}}
BuildRequires: cmake
BuildRequires: pkgconfig(capi-system-device)
BuildRequires: pkgconfig(capi-system-runtime-info)
BuildRequires: pkgconfig(capi-media-sound-manager)
-BuildRequires: pkgconfig(capi-network-bluetooth)
BuildRequires: pkgconfig(capi-network-wifi)
BuildRequires: pkgconfig(sensor)
BuildRequires: pkgconfig(motion)
-%if "%{?BUILD_PROFILE}" == "mobile"
+# TODO TEMPORARY STATEMENT
+# if it is mobile or BASE2 (when we have migrated everything into BASE2, we can remove this if statement)
+# Common also supports extension mode.
+%if "%{?BUILD_PROFILE}" != "tv" && "%{?BUILD_PROFILE}" != "wearable" && "%{?BUILD_PROFILE}" != "ivi"
BuildRequires: pkgconfig(capi-appfw-package-manager)
BuildRequires: pkgconfig(capi-appfw-application)
BuildRequires: pkgconfig(capi-appfw-app-manager)
+BuildRequires: pkgconfig(capi-network-bluetooth)
BuildRequires: pkgconfig(pkgmgr)
BuildRequires: pkgconfig(pkgmgr-info)
BuildRequires: pkgconfig(msg-service)
%build
MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
-export CFLAGS+=" -Wextra -Wcast-align -Wshadow -Wwrite-strings -Wswitch-default -Wno-unused-parameter"
export CXXFLAGS+=" -Wextra -Wcast-align -Wshadow -Wwrite-strings -Wswitch-default -Wno-unused-parameter"
-
-export CFLAGS+=" -Wno-empty-body -fomit-frame-pointer -fno-optimize-sibling-calls"
export CXXFLAGS+=" -Wno-empty-body -fomit-frame-pointer -fno-optimize-sibling-calls"
-
-export CFLAGS+=" -fno-strict-aliasing -fno-unroll-loops -fsigned-char -fstrict-overflow"
export CXXFLAGS+=" -fno-strict-aliasing -fno-unroll-loops -fsigned-char -fstrict-overflow"
+export CXXFLAGS+=" -Wnon-virtual-dtor -std=c++0x"
-export CFLAGS+=" -fno-common"
-export CXXFLAGS+=" -Wnon-virtual-dtor"
-export CXXFLAGS+=" -std=c++0x"
-
-#export CFLAGS+=" -Wcast-qual"
-#export CXXFLAGS+=" -Wcast-qual"
+# TODO TEMPORARY STATEMENT
+# if it is mobile or BASE2 (when we have migrated everything into BASE2, we can remove this if statement)
+%if "%{?BUILD_PROFILE}" != "tv" && "%{?BUILD_PROFILE}" != "wearable" && "%{?BUILD_PROFILE}" != "ivi"
+cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DLIBDIR=%{_libdir} -DMAJORVER=${MAJORVER} -DFULLVER=%{version} -DFEATURES=extended
+make %{?jobs:-j%jobs}
-cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DLIBDIR=%{_libdir} -DMAJORVER=${MAJORVER} -DFULLVER=%{version} -DPROFILE=%{?BUILD_PROFILE}
+%else
+cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DLIBDIR=%{_libdir} -DMAJORVER=${MAJORVER} -DFULLVER=%{version} -DFEATURES=standard
make %{?jobs:-j%jobs}
+%endif
%install
rm -rf %{buildroot}
%files
%manifest packaging/%{name}.manifest
-%defattr(-,root,root,-)
%{_libdir}/*.so*
-%{_libdir}/context-service/*.so*
+%{_libdir}/context-service/*activity.so*
+%{_libdir}/context-service/*custom.so*
+%{_libdir}/context-service/*sensor.so*
+%{_libdir}/context-service/*system.so*
+%{_libdir}/context-service/*time.so*
%license LICENSE
%package devel
Context Provider Shared Header (DEV)
%files devel
-%defattr(-,root,root,-)
+%manifest packaging/%{name}.manifest
%{_includedir}/context-service/internal/*.h
+
+# TODO TEMPORARY STATEMENT
+# if it is mobile or BASE2 (when we have migrated everything into BASE2, we can remove this if statement)
+%if "%{?BUILD_PROFILE}" != "tv" && "%{?BUILD_PROFILE}" != "wearable" && "%{?BUILD_PROFILE}" != "ivi"
+
+%package extended
+Summary: Extended binary for mobile functions
+Requires: context-provider = %{version}-%{release}
+Provides: context-provider-profile_mobile = %{version}-%{release}
+
+%description extended
+Extended context-provider binary for mobile functions.
+The metadata for mobile-supporting KS should include this subpackage
+
+%files extended
+%manifest packaging/%{name}.manifest
+%exclude %{_libdir}/context-service/*activity.so*
+%exclude %{_libdir}/context-service/*custom.so*
+%exclude %{_libdir}/context-service/*sensor.so*
+%exclude %{_libdir}/context-service/*system.so*
+%exclude %{_libdir}/context-service/*time.so*
+%{_libdir}/context-service/*.so*
+
+%endif