Optimize Production/Profile Build 58/110458/5 accepted/tizen/common/20170201.171608 accepted/tizen/ivi/20170201.090133 accepted/tizen/mobile/20170201.090042 accepted/tizen/tv/20170201.090059 accepted/tizen/wearable/20170201.090116 submit/tizen/20170201.022935
authorMyungJoo Ham <myungjoo.ham@samsung.com>
Mon, 16 Jan 2017 13:03:17 +0000 (22:03 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Mon, 23 Jan 2017 05:41:10 +0000 (14:41 +0900)
By the request from jihoon48.kim@samsung.com

Tested @ Unified, Wearable, Common, TV profiles.

Change-Id: If742b64e3667ba64b3ec3842610ec7f2b4132602
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
packaging/isf.spec

index 723aac2..84d2bd1 100644 (file)
@@ -57,6 +57,9 @@ BuildRequires:  pkgconfig(libwebsockets)
 %description
 Input Service Framewok (ISF) is an input method (IM) platform, and it has been derived from SCIM.
 
+# For product build optimization only. Not for Tizen 4.0 Unified.
+# if wearble or ivi or unified
+%if "%{?profile}" != "tv" && "%{?profile}" != "mobile" && "%{?profile}" != "common"
 %package profile_wearable
 Summary:       ISF bin for wearable/ivi
 Provides:      %{name}-compat = %{version}-%{release}
@@ -65,7 +68,11 @@ Conflicts:   %{name}-profile_common
 Conflicts:     %{name}-profile_tv
 %description profile_wearable
 Compile isf with --disable-include-notification and --disable-include-libwebsocket
+%endif
 
+# For product build optimization only. Not for Tizen 4.0 Unified.
+# if common or mobile or unified
+%if "%{?profile}" != "tv" && "%{?profile}" != "wearable" && "%{?profile}" != "ivi"
 %package profile_common
 Summary:       ISF bin for mobile/common
 Provides:      %{name}-compat = %{version}-%{release}
@@ -74,7 +81,11 @@ Conflicts:   %{name}-profile_wearable
 Conflicts:     %{name}-profile_tv
 %description profile_common
 Compile isf with --disable-include-libwebsocket
+%endif
 
+# For product build optimization only. Not for Tizen 4.0 Unified.
+# if tv or unified
+%if "%{?profile}" != "common" && "%{?profile}" != "wearable" && "%{?profile}" != "mobile" && "%{?profile}" != "ivi"
 %package profile_tv
 Summary:       ISF bin for TV
 Provides:      %{name}-compat = %{version}-%{release}
@@ -82,6 +93,7 @@ Conflicts:    %{name}-profile_common
 Conflicts:     %{name}-profile_wearable
 %description profile_tv
 Compile isf with --disable-include-notification
+%endif
 
 %package devel
 Summary:    ISF header files
@@ -116,6 +128,10 @@ export CFLAGS_BASIS="$CFLAGS"
 export CXXFLAGS_BASIS="$CXXFLAGS"
 
 %autogen
+
+# For product build optimization only. Not for Tizen 4.0 Unified.
+# if tv or unified
+%if "%{?profile}" != "common" && "%{?profile}" != "wearable" && "%{?profile}" != "mobile" && "%{?profile}" != "ivi"
 mkdir -p build_tv
 export CFLAGS="$CFLAGS_BASIS -D_TV -DENABLE_REMOTE_INPUT=1";
 export CXXFLAGS="$CFLAGS_BASIS -D_TV -DENABLE_REMOTE_INPUT=1";
@@ -142,8 +158,16 @@ mv %{buildroot}%{_datadir}/scim/remote-input build_tv/
 ls -la build_tv/bin/
 ls -la build_tv/lib/
 ls -la build_tv/
+# if unified
+%if "%{?profile}" != "common" && "%{?profile}" != "wearable" && "%{?profile}" != "mobile" && "%{?profile}" != "ivi" && "%{?profile}" != "tv"
 make clean
+%endif
 
+%endif
+
+# For product build optimization only. Not for Tizen 4.0 Unified.
+# if wearble or ivi or unified
+%if "%{?profile}" != "tv" && "%{?profile}" != "mobile" && "%{?profile}" != "common"
 mkdir -p build_wearable
 export CFLAGS="$CFLAGS_BASIS -D_WEARABLE -DENABLE_HIDE_PANEL_KEY=1";
 export CXXFLAGS="$CXXFLAGS_BASIS -D_WEARABLE -DENABLE_HIDE_PANEL_KEY=1";
@@ -169,8 +193,17 @@ mv %{buildroot}%{_bindir}/* build_wearable/bin/
 mv %{buildroot}%{_libdir}/* build_wearable/lib/
 ls -la build_wearable/bin/
 ls -la build_wearable/lib/
+
+# if unified
+%if "%{?profile}" != "common" && "%{?profile}" != "wearable" && "%{?profile}" != "mobile" && "%{?profile}" != "ivi" && "%{?profile}" != "tv"
 make clean
+%endif
 
+%endif
+
+# For product build optimization only. Not for Tizen 4.0 Unified.
+# if common or mobile or unified
+%if "%{?profile}" != "tv" && "%{?profile}" != "wearable" && "%{?profile}" != "ivi"
 # mobile/common
 export CFLAGS="$CFLAGS_BASIS -D_MOBILE -DENABLE_HIDE_PANEL_KEY=1";
 export CXXFLAGS="$CXXFLAGS_BASIS -D_MOBILE -DENABLE_HIDE_PANEL_KEY=1";
@@ -187,6 +220,7 @@ export CXXFLAGS="$CXXFLAGS_BASIS -D_MOBILE -DENABLE_HIDE_PANEL_KEY=1";
                --with-ro-app-dir=%{TZ_SYS_RO_APP} \
                --with-ro-packages-dir=%{TZ_SYS_RO_PACKAGES}
 make %{?_smp_mflags}
+%endif
 
 %install
 rm -rf %{buildroot}
@@ -197,17 +231,28 @@ cp -af ism/dump/isf_log_dump.sh %{buildroot}/%{TZ_SYS_ETC}/dump.d/module.d
 mkdir -p %{buildroot}/etc/scim/conf
 mkdir -p %{buildroot}/usr/share/upgrade/scripts/
 cp 500.isf_upgrade_24to30.sh %{buildroot}/usr/share/upgrade/scripts/
+
+
+# For product build optimization only. Not for Tizen 4.0 Unified.
+# if tv or unified
+%if "%{?profile}" != "common" && "%{?profile}" != "wearable" && "%{?profile}" != "mobile" && "%{?profile}" != "ivi"
 mv build_tv/bin/isf-demo-efl %{buildroot}%{_bindir}/isf-demo-efl.tv
 mv build_tv/bin/isf-panel-efl %{buildroot}%{_bindir}/isf-panel-efl.tv
 mv build_tv/bin/isf-log %{buildroot}%{_bindir}/isf-log.tv
+rm -rf %{buildroot}%{_datadir}/scim/remote-input
 mkdir -p %{buildroot}%{_datadir}/scim
-mv build_tv/remote-input %{buildroot}%{_datadir}/scim/
+mv -f build_tv/remote-input %{buildroot}%{_datadir}/scim/
 #mv build_tv/lib/libscim-*.so* %{buildroot}%{_libdir}/libscim-*.so*.tv
 pushd build_tv/lib/
 for FILE in libscim-*.so*; do mv "$FILE" "%{buildroot}%{_libdir}/$FILE.tv"; done
 popd
 mv build_tv/lib/scim-1.0/scim-launcher %{buildroot}%{_libdir}/scim-1.0/scim-launcher.tv
 mv build_tv/lib/scim-1.0/scim-helper-launcher %{buildroot}%{_libdir}/scim-1.0/scim-helper-launcher.tv
+%endif
+
+# For product build optimization only. Not for Tizen 4.0 Unified.
+# if wearble or ivi or unified
+%if "%{?profile}" != "tv" && "%{?profile}" != "mobile" && "%{?profile}" != "common"
 mv build_wearable/bin/isf-demo-efl %{buildroot}%{_bindir}/isf-demo-efl.wearable
 mv build_wearable/bin/isf-panel-efl %{buildroot}%{_bindir}/isf-panel-efl.wearable
 mv build_wearable/bin/isf-log %{buildroot}%{_bindir}/isf-log.wearable
@@ -217,6 +262,17 @@ for FILE in libscim-*.so*; do mv "$FILE" "%{buildroot}%{_libdir}/$FILE.wearable"
 popd
 mv build_wearable/lib/scim-1.0/scim-launcher %{buildroot}%{_libdir}/scim-1.0/scim-launcher.wearable
 mv build_wearable/lib/scim-1.0/scim-helper-launcher %{buildroot}%{_libdir}/scim-1.0/scim-helper-launcher.wearable
+%endif
+
+# For product build optimization only. Not for Tizen 4.0 Unified.
+# If common/mobile is not required
+%if "%{?profile}" == "tv" || "%{?profile}" == "wearable" || "%{?profile}" == "ivi"
+rm %{buildroot}%{_bindir}/isf-demo-efl
+rm %{buildroot}%{_bindir}/isf-panel-efl
+rm %{buildroot}%{_bindir}/isf-log
+rm %{buildroot}%{_libdir}/scim-1.0/scim-launcher
+rm %{buildroot}%{_libdir}/scim-1.0/scim-helper-launcher
+%endif
 
 %find_lang scim
 
@@ -228,6 +284,9 @@ ln -sf %{_libdir}/ecore_imf/modules/wayland/v-1.16/module.so %{_libdir}/ecore_im
 
 %postun -p /sbin/ldconfig
 
+# For product build optimization only. Not for Tizen 4.0 Unified.
+# if wearble or ivi or unified
+%if "%{?profile}" != "tv" && "%{?profile}" != "mobile" && "%{?profile}" != "common"
 %post profile_wearable
 ln -sf isf-demo-efl.wearable %{_bindir}/isf-demo-efl
 ln -sf isf-panel-efl.wearable %{_bindir}/isf-panel-efl
@@ -239,6 +298,8 @@ for FILE in libscim-*.so*.wearable; do ln -sf "$FILE" "${FILE%.wearable}"; done
 popd
 
 %preun profile_wearable
+# Do not execute if upgrade
+if [ $1 -gt 0 ]; then
 rm %{_bindir}/isf-demo-efl
 rm %{_bindir}/isf-panel-efl
 rm %{_bindir}/isf-log
@@ -247,7 +308,23 @@ rm %{_libdir}/scim-1.0/scim-helper-launcher
 pushd %{_libdir}
 for FILE in libscim-*.so*; do rm "$FILE"; done
 popd
+fi
 
+%files profile_wearable
+%manifest %{name}.manifest
+# files in bindir and libdir may differ.
+%{_bindir}/isf-demo-efl.wearable
+%{_bindir}/isf-panel-efl.wearable
+%{_bindir}/isf-log.wearable
+%{_libdir}/scim-1.0/scim-launcher.wearable
+%{_libdir}/scim-1.0/scim-helper-launcher.wearable
+%{_libdir}/libscim-*.so*.wearable
+
+%endif
+
+# For product build optimization only. Not for Tizen 4.0 Unified.
+# if tv or unified
+%if "%{?profile}" != "common" && "%{?profile}" != "wearable" && "%{?profile}" != "mobile" && "%{?profile}" != "ivi"
 %post profile_tv
 ln -sf isf-demo-efl.tv %{_bindir}/isf-demo-efl
 ln -sf isf-panel-efl.tv %{_bindir}/isf-panel-efl
@@ -258,6 +335,8 @@ pushd %{_libdir}
 for FILE in libscim-*.so*.tv; do ln -sf "$FILE" "${FILE%.tv}"; done
 popd
 %preun profile_tv
+# Do not execute if upgrade
+if [ $1 -gt 0 ]; then
 rm %{_bindir}/isf-demo-efl
 rm %{_bindir}/isf-panel-efl
 rm %{_bindir}/isf-log
@@ -266,6 +345,20 @@ rm %{_libdir}/scim-1.0/scim-helper-launcher
 pushd %{_libdir}
 for FILE in libscim-*.so*; do rm "$FILE"; done
 popd
+fi
+
+%files profile_tv
+%manifest %{name}.manifest
+# files in bindir, lib/libscim*.so.*, lib/scim-1.0/scim-launcher are different
+%{_bindir}/isf-demo-efl.tv
+%{_bindir}/isf-panel-efl.tv
+%{_bindir}/isf-log.tv
+%{_libdir}/scim-1.0/scim-launcher.tv
+%{_libdir}/scim-1.0/scim-helper-launcher.tv
+%{_libdir}/libscim-*.so*.tv
+# TV Only: remote-input
+%attr(755,root,root) %{_datadir}/scim/remote-input/*
+%endif
 
 %files -f isf.lang
 %manifest %{name}.manifest
@@ -295,16 +388,9 @@ popd
 # although they might be overwritten by subpackages unless there is no possibilities of
 # have-choice issues.
 
-%files profile_wearable
-%manifest %{name}.manifest
-# files in bindir and libdir may differ.
-%{_bindir}/isf-demo-efl.wearable
-%{_bindir}/isf-panel-efl.wearable
-%{_bindir}/isf-log.wearable
-%{_libdir}/scim-1.0/scim-launcher.wearable
-%{_libdir}/scim-1.0/scim-helper-launcher.wearable
-%{_libdir}/libscim-*.so*.wearable
-
+# For product build optimization only. Not for Tizen 4.0 Unified.
+# if common or mobile or unified
+%if "%{?profile}" != "tv" && "%{?profile}" != "wearable" && "%{?profile}" != "ivi"
 %files profile_common
 %manifest %{name}.manifest
 # files in bindir, lib/libscim*.so.*, lib/scim-1.0/scim-launcher are different
@@ -314,18 +400,7 @@ popd
 %{_libdir}/scim-1.0/scim-launcher
 %{_libdir}/scim-1.0/scim-helper-launcher
 # default .so are housed in the main pkg.
-
-%files profile_tv
-%manifest %{name}.manifest
-# files in bindir, lib/libscim*.so.*, lib/scim-1.0/scim-launcher are different
-%{_bindir}/isf-demo-efl.tv
-%{_bindir}/isf-panel-efl.tv
-%{_bindir}/isf-log.tv
-%{_libdir}/scim-1.0/scim-launcher.tv
-%{_libdir}/scim-1.0/scim-helper-launcher.tv
-%{_libdir}/libscim-*.so*.tv
-# TV Only: remote-input
-%attr(755,root,root) %{_datadir}/scim/remote-input/*
+%endif
 
 %files devel
 %defattr(-,root,root,-)