Remove Profile Build Dependency and Model-Build-Features 67/96767/1 accepted/tizen/common/20161116.134512 accepted/tizen/ivi/20161117.010320 accepted/tizen/mobile/20161117.010223 accepted/tizen/tv/20161117.010242 accepted/tizen/wearable/20161117.010300 submit/tizen/20161116.061848
authorMyungJoo Ham <myungjoo.ham@samsung.com>
Thu, 10 Nov 2016 04:03:29 +0000 (13:03 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Thu, 10 Nov 2016 04:03:29 +0000 (13:03 +0900)
- This is for Tizen 4.0

- When SR'ing this commit, the maintainer needs to create JIRA-TRE issue of:

  - Add org.tizen.inputmethod-setting-profile_common for common profile
  - Add org.tizen.inputmethod-setting-profile_mobile for mobile profile
  - Add org.tizen.inputmethod-setting-profile_tv for tv profile
  - Add org.tizen.inputmethod-setting-profile_ivi for ivi profile
  - Add org.tizen.inputmethod-setting-profile_wearable for wearable profile
    - Add org.tizen.inputmethod-setting-profile_wearable-extension-circle for circular-display wearable profile
    - Add org.tizen.inputmethod-setting-profile_wearable-extension-rectangle for rectangular-display wearable profile

- In the future unified build environment, all of the above subpackages will
 be built and published at once.
- For conventional / obsolete build environment including GBMs, only the supported subpackages
 will be built and published.

- This removes the need for model-build-feature, which should NEVER be used except for device drivers.

Change-Id: I5c78a92e689ba41c9df24361e585e5e02841df9c
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
packaging/org.tizen.inputmethod-setting.spec

index 9eeed8f2409089850bce400a740358ec9cb0a986..70297079ef06f4a55ccfca4548bbfba712f605b2 100644 (file)
@@ -16,9 +16,76 @@ BuildRequires:  efl-extension-devel
 BuildRequires:  pkgconfig(libtzplatform-config)
 BuildRequires:  model-build-features
 BuildRequires:  pkgconfig(capi-ui-inputmethod-manager)
+Requires:      %{name}-compat = %{version}-%{release}
+# This if/endif is for GBM build optimization. This usage does not affect
+# The unified build (profile is undefined) as it will return TRUE always.
+%if "%{?profile}"!="mobile" && "%{?profile}"!="wearable"
+Recommends:    %{name}-profile_common = %{version}-%{release}
+%endif
 
 %description
 Setting Application for ISF.
+This requires profile specific extensions. (e.g., %{name}-profile_common)
+
+# This if/endif is for GBM build optimization. This usage does not affect
+# The unified build (profile is undefined) as it will return TRUE always.
+%if "%{?profile}"!="mobile" && "%{?profile}"!="wearable"
+%package profile_common
+Summary:    Input Method Setting Application Vannila Binaries (common/ivi/tv)
+Provides:   %{name}-compat = %{version}-%{release}
+Conflicts:  %{name}-profile_wearable
+Conflicts:  %{name}-profile_mobile
+%description profile_common
+Setting Application for ISF, Vanilla Edition for common/ivi/tv profiles.
+%endif
+
+# This if/endif is for GBM build optimization. This usage does not affect
+# The unified build (profile is undefined) as it will return TRUE always.
+%if "%{?profile}"!="tv" && "%{?profile}"!="wearable"
+%package profile_mobile
+Summary:    Input Method Setting Application Binaries for Mobile Profile
+Provides:   %{name}-compat = %{version}-%{release}
+Conflicts:  %{name}-profile_wearable
+Conflicts:  %{name}-profile_common
+%description profile_mobile
+Setting Application for ISF, Mobile Profile Edition.
+Binaries in this package is compiled with "mobile" options.
+%endif
+
+# This if/endif is for GBM build optimization. This usage does not affect
+# The unified build (profile is undefined) as it will return TRUE always.
+%if "%{?profile}"!="tv" && "%{?profile}"!="mobile"
+%package profile_wearable
+Summary:    Input Method Setting Application Metapackage for Wearable
+Provides:   %{name}-compat = %{version}-%{release}
+Requires:   %{name}-profile_wearable-extension = %{version}-%{release}
+Recommends: %{name}-profile_wearable-extension-circle = %{version}-%{release}
+Conflicts:  %{name}-profile_common
+Conflicts:  %{name}-profile_mobile
+%description profile_wearable
+Meta package to anchor circle display version and rectangle display version of
+Setting APplication for ISF, Wearable Profile Edition.
+
+# Because circle breaks CAPI compatibility, it should be built for
+# wearable and "unified (undefined)"
+%if "%{?profile}"!="tv" && "%{?profile}"!="mobile" && "%{?profile}"!="ivi" && "%{?profile}"!="common"
+%package profile_wearable-extension-circle
+Summary:    Input Method Setting Application for Wearable (Circle)
+Provides:   %{name}-profile_wearable-extension = %{version}-%{release}
+Conflicts:  %{name}-profile_wearable-extension-rectangle
+%description profile_wearable-extension-circle
+Setting Application for ISF, Wearable Profile Edition with Circle Display
+Binaries in this package is compiled with "wearable" and "circle" options.
+%endif
+
+%package profile_wearable-extension-rectangle
+Summary:    Input Method Setting Application for Wearable (Rectangle)
+Provides:   %{name}-profile_wearable-extension = %{version}-%{release}
+Conflicts:  %{name}-profile_wearable-extension-circle
+%description profile_wearable-extension-rectangle
+Setting Application for ISF, Wearable Profile Edition with Rectangle Display
+Binaries in this package is compiled with "wearable" and "rectangle" options.
+%endif
 
 %prep
 %setup -q -n %{name}-%{version}
@@ -31,27 +98,70 @@ export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
 
-%if "%{?profile}" == "mobile"
-CFLAGS+=" -D_MOBILE";
-CXXFLAGS+=" -D_MOBILE";
+export CFLAGSBASE="$CFLAGS"
+export CXXFLAGSBASE="$CXXFLAGS"
+
+rm -rf CMakeFiles
+rm -rf CMakeCache.txt
+
+# This if/endif is for GBM build optimization. This usage does not affect
+# The unified build (profile is undefined) as it will return TRUE always.
+%if "%{?profile}"!="tv" && "%{?profile}"!="wearable"
+mkdir -p build_mobile
+CFLAGS="$CFLAGSBASE -D_MOBILE"
+CXXFLAGS="$CXXFLAGSBASE -D_MOBILE"
+
+pushd build_mobile
+cmake .. -DCMAKE_INSTALL_PREFIX=%{_prefix} \
+         -DTZ_SYS_RO_APP=%TZ_SYS_RO_APP \
+         -DTZ_SYS_RO_PACKAGES=%TZ_SYS_RO_PACKAGES \
+         -DTZ_SYS_RO_ICONS=%TZ_SYS_RO_ICONS
+make %{?jobs:-j%jobs}
+popd
 %endif
 
-%if "%{?profile}" == "wearable"
-CFLAGS+=" -D_WEARABLE";
-CXXFLAGS+=" -D_WEARABLE";
-%if "%{model_build_feature_formfactor}" == "circle"
-CFLAGS+=" -D_CIRCLE";
-CXXFLAGS+=" -D_CIRCLE";
+# This if/endif is for GBM build optimization. This usage does not affect
+# The unified build (profile is undefined) as it will return TRUE always.
+%if "%{?profile}"!="tv" && "%{?profile}"!="mobile"
+mkdir -p build_wearable_rectangle
+
+CFLAGS="$CFLAGSBASE -D_WEARABLE"
+CXXFLAGS="$CXXFLAGSBASE -D_WEARABLE"
+pushd build_wearable_rectangle
+cmake .. -DCMAKE_INSTALL_PREFIX=%{_prefix} \
+         -DTZ_SYS_RO_APP=%TZ_SYS_RO_APP \
+         -DTZ_SYS_RO_PACKAGES=%TZ_SYS_RO_PACKAGES \
+         -DTZ_SYS_RO_ICONS=%TZ_SYS_RO_ICONS
+make %{?jobs:-j%jobs}
+popd
+
+# Because circle breaks CAPI compatibility, it should be built for
+# wearable and "unified (undefined)"
+%if "%{?profile}"!="tv" && "%{?profile}"!="mobile" && "%{?profile}"!="ivi" && "%{?profile}"!="common"
+mkdir -p build_wearable_circle
+CFLAGS="$CFLAGSBASE -D_WEARABLE -D_CIRCLE"
+CXXFLAGS="$CXXFLAGSBASE -D_WEARABLE -D_CIRCLE"
+pushd build_wearable_circle
+cmake .. -DCMAKE_INSTALL_PREFIX=%{_prefix} \
+         -DTZ_SYS_RO_APP=%TZ_SYS_RO_APP \
+         -DTZ_SYS_RO_PACKAGES=%TZ_SYS_RO_PACKAGES \
+         -DTZ_SYS_RO_ICONS=%TZ_SYS_RO_ICONS
+make %{?jobs:-j%jobs}
+popd
 %endif
 %endif
 
-rm -rf CMakeFiles
-rm -rf CMakeCache.txt
+# This if/endif is for GBM build optimization. This usage does not affect
+# The unified build (profile is undefined) as it will return TRUE always.
+%if "%{?profile}"!="mobile" && "%{?profile}"!="wearable"
+CFLAGS="$CFLAGSBASE"
+CXXFLAGS="$CXXFLAGSBASE"
 cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \
         -DTZ_SYS_RO_APP=%TZ_SYS_RO_APP \
         -DTZ_SYS_RO_PACKAGES=%TZ_SYS_RO_PACKAGES \
         -DTZ_SYS_RO_ICONS=%TZ_SYS_RO_ICONS
 make %{?jobs:-j%jobs}
+%endif
 
 %post -p /sbin/ldconfig
 
@@ -60,13 +170,104 @@ make %{?jobs:-j%jobs}
 %install
 rm -rf %{buildroot}
 
+# This if/endif is for GBM build optimization. This usage does not affect
+# The unified build (profile is undefined) as it will return TRUE always.
+%if "%{?profile}"!="tv" && "%{?profile}"!="wearable"
+pushd build_mobile
+%make_install
+popd
+mv %{buildroot}%{TZ_SYS_RO_APP}/%{name}/bin/inputmethod-setting-list \
+   %{buildroot}%{TZ_SYS_RO_APP}/%{name}/bin/inputmethod-setting-list.mobile
+mv %{buildroot}%{TZ_SYS_RO_APP}/%{name}/bin/inputmethod-setting-selector \
+   %{buildroot}%{TZ_SYS_RO_APP}/%{name}/bin/inputmethod-setting-selector.mobile
+%endif
+
+# This if/endif is for GBM build optimization. This usage does not affect
+# The unified build (profile is undefined) as it will return TRUE always.
+%if "%{?profile}"!="tv" && "%{?profile}"!="mobile"
+pushd build_wearable_rectangle
+%make_install
+popd
+mv %{buildroot}%{TZ_SYS_RO_APP}/%{name}/bin/inputmethod-setting-list \
+   %{buildroot}%{TZ_SYS_RO_APP}/%{name}/bin/inputmethod-setting-list.wearable.rectangle
+mv %{buildroot}%{TZ_SYS_RO_APP}/%{name}/bin/inputmethod-setting-selector \
+   %{buildroot}%{TZ_SYS_RO_APP}/%{name}/bin/inputmethod-setting-selector.wearable.rectangle
+# Because circle breaks CAPI compatibility, it should be built for
+# wearable and "unified (undefined)"
+%if "%{?profile}"!="tv" && "%{?profile}"!="mobile" && "%{?profile}"!="ivi" && "%{?profile}"!="common"
+pushd build_wearable_circle
+%make_install
+popd
+mv %{buildroot}%{TZ_SYS_RO_APP}/%{name}/bin/inputmethod-setting-list \
+   %{buildroot}%{TZ_SYS_RO_APP}/%{name}/bin/inputmethod-setting-list.wearable.circle
+mv %{buildroot}%{TZ_SYS_RO_APP}/%{name}/bin/inputmethod-setting-selector \
+   %{buildroot}%{TZ_SYS_RO_APP}/%{name}/bin/inputmethod-setting-selector.wearable.circle
+%endif
+%endif
+
+# This if/endif is for GBM build optimization. This usage does not affect
+# The unified build (profile is undefined) as it will return TRUE always.
+%if "%{?profile}"!="mobile" && "%{?profile}"!="wearable"
 %make_install
+%endif
 %find_lang inputmethod-setting
 
 %files -f inputmethod-setting.lang
 %manifest %{name}.manifest
 %defattr(-,root,root,-)
-%{TZ_SYS_RO_APP}/%{name}/bin/*
 %{TZ_SYS_RO_ICONS}/default/small/*
 %{TZ_SYS_RO_PACKAGES}/%{name}.xml
 %license LICENSE
+
+# This if/endif is for GBM build optimization. This usage does not affect
+# The unified build (profile is undefined) as it will return TRUE always.
+%if "%{?profile}"!="mobile" && "%{?profile}"!="wearable"
+%files profile_common
+%exclude %{TZ_SYS_RO_APP}/%{name}/bin/inputmethod-setting-*.mobile
+%exclude %{TZ_SYS_RO_APP}/%{name}/bin/inputmethod-setting-*.wearable.*
+%{TZ_SYS_RO_APP}/%{name}/bin/inputmethod-setting-*
+%endif
+
+# This if/endif is for GBM build optimization. This usage does not affect
+# The unified build (profile is undefined) as it will return TRUE always.
+%if "%{?profile}"!="tv" && "%{?profile}"!="wearable"
+%post profile_mobile
+pushd %{TZ_SYS_RO_APP}/%{name}/bin/
+for file in inputmethod-setting-*.mobile; do ln -sf "${file}" "${file%.mobile}"; done
+popd
+%preun profile_mobile
+rm %{TZ_SYS_RO_APP}/%{name}/bin/inputmethod-settings-list
+rm %{TZ_SYS_RO_APP}/%{name}/bin/inputmethod-setting-selector
+%files profile_mobile
+%{TZ_SYS_RO_APP}/%{name}/bin/inputmethod-setting-*.mobile
+%endif
+
+# This if/endif is for GBM build optimization. This usage does not affect
+# The unified build (profile is undefined) as it will return TRUE always.
+%if "%{?profile}"!="tv" && "%{?profile}"!="mobile"
+%files profile_wearable
+
+# Because circle breaks CAPI compatibility, it should be built for
+# wearable and "unified (undefined)"
+%if "%{?profile}"!="tv" && "%{?profile}"!="mobile" && "%{?profile}"!="ivi" && "%{?profile}"!="common"
+%post profile_wearable-extension-circle
+pushd %{TZ_SYS_RO_APP}/%{name}/bin/
+for file in inputmethod-setting-*.wearable.circle; do ln -sf "${file}" "${file%.wearable.circle}"; done
+popd
+%preun profile_wearable-extension-circle
+rm %{TZ_SYS_RO_APP}/%{name}/bin/inputmethod-settings-list
+rm %{TZ_SYS_RO_APP}/%{name}/bin/inputmethod-setting-selector
+%files profile_wearable-extension-circle
+%{TZ_SYS_RO_APP}/%{name}/bin/inputmethod-setting-*.wearable.circle
+%endif
+
+%post profile_wearable-extension-rectangle
+pushd %{TZ_SYS_RO_APP}/%{name}/bin/
+for file in inputmethod-setting-*.wearable.rectangle; do ln -sf "${file}" "${file%.wearable.rectangle}"; done
+popd
+%preun profile_wearable-extension-rectangle
+rm %{TZ_SYS_RO_APP}/%{name}/bin/inputmethod-settings-list
+rm %{TZ_SYS_RO_APP}/%{name}/bin/inputmethod-setting-selector
+%files profile_wearable-extension-rectangle
+%{TZ_SYS_RO_APP}/%{name}/bin/inputmethod-setting-*.wearable.rectangle
+%endif