Remove profile build dependencies 99/94599/7
authorMyungJoo Ham <myungjoo.ham@samsung.com>
Tue, 20 Sep 2016 05:22:24 +0000 (05:22 +0000)
committerMu-Woong Lee <muwoong.lee@samsung.com>
Tue, 3 Jan 2017 06:57:41 +0000 (15:57 +0900)
The previous spec/build scripts stated that it will add more libraries
if the profile macro is mobile while the other libraries and devel
packages were identical.

The patch allows this package to become profile agnostic by seperating
the additional mobile libraries (context-provider-extended), which
can be optionally installed at any time, at any profile, while they
can share the same build project. (Yay!)

NOTE:

  When this commit is being SR'ed, maintainers need to create JIRA-TRE of:

- Add context-provider-profile_mobile for mobile profile.

Change-Id: Ie646dc6fcfab7251e43149dfbe43fa972aee8784
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
packaging/context-provider.spec
src/CMakeLists.txt

index f66d6a2..66d1fd8 100644 (file)
@@ -1,12 +1,19 @@
 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
 
@@ -17,15 +24,18 @@ BuildRequires: pkgconfig(capi-system-info)
 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)
@@ -48,24 +58,21 @@ Context Provider
 %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}
@@ -79,9 +86,12 @@ 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
@@ -93,5 +103,29 @@ Requires:   %{name} = %{version}-%{release}
 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
index 30d980b..a137021 100644 (file)
@@ -6,21 +6,21 @@ SET(DEPS
 ADD_SUBDIRECTORY(shared)
 ADD_SUBDIRECTORY(activity)
 ADD_SUBDIRECTORY(custom)
-ADD_SUBDIRECTORY(headphone)
 ADD_SUBDIRECTORY(sensor)
 ADD_SUBDIRECTORY(system)
 ADD_SUBDIRECTORY(time)
-ADD_SUBDIRECTORY(wifi)
 
-IF("${PROFILE}" STREQUAL "mobile")
+IF("${FEATURES}" STREQUAL "extended")
 ADD_SUBDIRECTORY(app-stats)
 ADD_SUBDIRECTORY(battery-stats)
 ADD_SUBDIRECTORY(call)
 ADD_SUBDIRECTORY(contacts)
 ADD_SUBDIRECTORY(email)
 ADD_SUBDIRECTORY(geofence)
+ADD_SUBDIRECTORY(headphone)
 ADD_SUBDIRECTORY(media-stats)
 ADD_SUBDIRECTORY(message)
 ADD_SUBDIRECTORY(my-place)
 ADD_SUBDIRECTORY(social-stats)
-ENDIF("${PROFILE}" STREQUAL "mobile")
+ADD_SUBDIRECTORY(wifi)
+ENDIF("${FEATURES}" STREQUAL "extended")