[4.0] Remove profile build dependencies 80/98380/8 accepted/tizen/common/20161202.233120 accepted/tizen/ivi/20161202.010246 accepted/tizen/mobile/20161202.010134 accepted/tizen/tv/20161202.010157 accepted/tizen/wearable/20161202.010227 submit/tizen/20161201.224201
authorhk57.kim <hk57.kim@samsung.com>
Thu, 17 Nov 2016 06:50:15 +0000 (15:50 +0900)
committerhk57.kim <hk57.kim@samsung.com>
Thu, 1 Dec 2016 08:24:49 +0000 (17:24 +0900)
- This is for Tizen 4.0.
- Added backward-compatibility that does not deteriorate 4.0 Configurability
- When you send SR of this comimt you need to create JIRA-TRE of:

 - common/mobile/tv/ivi profile: Add libscl-core-profile_common
 - wearable profile: Add libscl-core-profile_wearable

(It's add, not replace.)

Change-Id: I6e71101338e2091200ee2d9233f3bf9537c4248b
Signed-off-by: hk57.kim <hk57.kim@samsung.com>
packaging/libscl-core.spec

index 2f244a8b615b9633c1bd8eec60f0363b75284491..83f8f3f123d0b542ad57ba8c23e955c23ac11b10 100644 (file)
@@ -1,12 +1,6 @@
 %bcond_with x
 %bcond_with wayland
 
-%if "%{?profile}" == "wearable"
-%define WITH_WEBSOCKET TRUE
-%else
-%define WITH_WEBSOCKET FALSE
-%endif
-
 Name:       libscl-core
 Summary:    A library for developing software keyboards
 Version:    0.4.32
@@ -29,26 +23,52 @@ BuildRequires:  pkgconfig(x11)
 %endif
 BuildRequires:  pkgconfig(libscl-common)
 BuildRequires:  pkgconfig(capi-appfw-application)
-%if "%{WITH_WEBSOCKET}" == "TRUE"
+# This is for backward-compatibility. This does not deteriorate 4.0 Configurability
+# if wearable || "undefined"
+%if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
 BuildRequires:  pkgconfig(libwebsockets)
 %endif
 
-
+Requires:      %{name}-compat = %{version}-%{release}
+Recommends:    %{name}-profile_common = %{version}-%{release}
 %description
 A library that helps developing S/W Keyboard
 
+# This is for backward-compatibility. This does not deteriorate 4.0 Configurability
+# if mobile || tv || ivi || common || "undefined"
+%if "%{?profile}" != "wearable"
+%package profile_common
+Summary:       libscl-core subpackage for common/mobile/tv/ivi
+Provides:      %{name}-compat = %{version}-%{release}
+Provides:      %{name}-profile_mobile = %{version}-%{release}
+Provides:      %{name}-profile_tv = %{version}-%{release}
+Provides:      %{name}-profile_ivi = %{version}-%{release}
+Conflicts:     %{name}-profile_wearable
+%description profile_common
+A library for developing software keyboards for common/mobile/tv/ivi.
+%endif
+
+# This is for backward-compatibility. This does not deteriorate 4.0 Configurability
+# if wearable || "undefined"
+%if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
+%package profile_wearable
+Summary:       libscl-core subpackage for wearable
+Provides:      %{name}-compat = %{version}-%{release}
+Conflicts:     %{name}-profile_common
+%description profile_wearable
+A library for developing software keyboards for wearable.
+%endif
+
 %package devel
 Summary:    SCL-Core header file
 Group:      Development/Libraries
 Requires:   %{name} = %{version}-%{release}
-
 %description devel
 A devel package of libscl-core library that helps developing S/W Keyboard
 
 %prep
 %setup -q
 
-
 %build
 export CFLAGS+=" -DTIZEN_DEBUG_ENABLE -Werror"
 export CXXFLAGS+=" -DTIZEN_DEBUG_ENABLE -Werror"
@@ -57,30 +77,89 @@ export FFLAGS+=" -DTIZEN_DEBUG_ENABLE"
 rm -rf CMakeFiles
 rm -rf CMakeCache.txt
 
+# This is for backward-compatibility. This does not deteriorate 4.0 Configurability
+# if wearable || "undefined"
+%if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
+# wearable
+mkdir -p wearable
+pushd wearable
+%if %{with wayland}
+cmake .. -DCMAKE_INSTALL_PREFIX=%{_prefix} -DLIB_INSTALL_DIR:PATH=%{_libdir} -Dwith_wayland=TRUE -Dwith_websocket=TRUE
+%else
+cmake .. -DCMAKE_INSTALL_PREFIX=%{_prefix} -DLIB_INSTALL_DIR:PATH=%{_libdir} -Dwith_websocket=TRUE
+%endif
+make %{?_smp_mflags}
+popd
+%endif
+
+# This is for backward-compatibility. This does not deteriorate 4.0 Configurability
+# if mobile || tv || ivi || common || "undefined"
+%if "%{?profile}" != "wearable"
+# common
 %if %{with wayland}
-cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DLIB_INSTALL_DIR:PATH=%{_libdir} -Dwith_wayland=TRUE -Dwith_websocket=%{WITH_WEBSOCKET}
+cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DLIB_INSTALL_DIR:PATH=%{_libdir} -Dwith_wayland=TRUE -Dwith_websocket=FALSE
 %else
-cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DLIB_INSTALL_DIR:PATH=%{_libdir} -Dwith_websocket=%{WITH_WEBSOCKET}
+cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DLIB_INSTALL_DIR:PATH=%{_libdir} -Dwith_websocket=FALSE
 %endif
 make %{?_smp_mflags}
+%endif
 
 %install
 rm -rf %{buildroot}
 
+# This is for backward-compatibility. This does not deteriorate 4.0 Configurability
+# if wearable || "undefined"
+%if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
+pushd wearable
 %make_install
+mv %{buildroot}%{_libdir}/%{name}.so %{buildroot}%{_libdir}/%{name}.so.wearable
+popd
+%endif
 
-
+# This is for backward-compatibility. This does not deteriorate 4.0 Configurability
+# if mobile || tv || ivi || common || "undefined"
+%if "%{?profile}" != "wearable"
+%make_install
+%endif
 
 %post -p /sbin/ldconfig
 
 %postun -p /sbin/ldconfig
 
+# This is for backward-compatibility. This does not deteriorate 4.0 Configurability
+# if wearable || "undefined"
+%if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
+%post profile_wearable
+pushd %{_libdir}
+for FILE in %{name}.so.wearable; do ln -sf "$FILE" "${FILE%.wearable}"; done
+popd
+%preun profile_wearable
+rm %{_libdir}/%{name}.so
+%endif
+
 %files
 %manifest %{name}.manifest
 %defattr(-,root,root,-)
-%{_libdir}/%{name}.so
 %license LICENSE
 
+# This is for backward-compatibility. This does not deteriorate 4.0 Configurability
+# if mobile || tv || ivi || common || "undefined"
+%if "%{?profile}" != "wearable"
+
+%files profile_common
+%defattr(-,root,root,-)
+%{_libdir}/%{name}.so
+%endif
+
+# This is for backward-compatibility. This does not deteriorate 4.0 Configurability
+# if wearable || "undefined"
+%if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
+
+%files profile_wearable
+%defattr(-,root,root,-)
+%{_libdir}/%{name}.so.wearable
+%endif
+
 %files devel
 %defattr(-,root,root,-)
 %{_includedir}/*