+# For the backward compatibility, this is to be built for
+# wearable profile or 4.0 unified building environment.
+# This cannot be built for non-wearable in conventional 3.0 build environment.
+# Note that it is not a good idea to limit building with ExcludeArch because there are new architectures being tested.
+# Use ExclusiveArch istead.
+%if "%{?profile}" == "mobile" || "%{?profile}" == "ivi" || "%{?profile}" == "common"
+#ExclusiveArch: none
+%endif
+
Name: org.tizen.inputdelegator
Summary: Input Delegator Application
-Version: 0.1.161208
+Version: 0.1.180111
Release: 1
Group: Applications
License: Apache-2.0
%define enable_log_manager 1
-BuildRequires: pkgconfig(ecore-wayland)
BuildRequires: pkgconfig(ecore)
BuildRequires: pkgconfig(evas)
BuildRequires: pkgconfig(edje)
-BuildRequires: pkgconfig(edbus)
BuildRequires: cmake
BuildRequires: edje-bin
-BuildRequires: gettext
+BuildRequires: gettext-tools
BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(capi-appfw-application)
+BuildRequires: pkgconfig(capi-appfw-app-control)
+BuildRequires: pkgconfig(capi-appfw-preference)
BuildRequires: pkgconfig(capi-media-wav-player)
BuildRequires: pkgconfig(capi-system-device)
BuildRequires: pkgconfig(eina)
BuildRequires: pkgconfig(db-util)
BuildRequires: pkgconfig(sqlite3)
BuildRequires: pkgconfig(capi-media-audio-io)
-
+BuildRequires: pkgconfig(capi-system-info)
+BuildRequires: pkgconfig(smartreply)
+BuildRequires: pkgconfig(capi-media-recorder)
+BuildRequires: pkgconfig(capi-content-media-content)
+BuildRequires: pkgconfig(storage)
%if %{enable_log_manager}
BuildRequires: pkgconfig(bundle)
%endif
-%if "%{?profile}" == "mobile"
-ExcludeArch: %{arm} aarch64 %ix86 x86_64
+Requires: %{name}-compat = %{version}-%{release}
+# This is for old profile-based OBS project optimizations.
+# In 4.0 unified build env, this if statement is always true.
+%if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "wearable" && "%{?profile}" != "ivi"
+Recommends: %{name}-profile_common = %{version}-%{release}
%endif
-%if "%{?profile}" == "tv"
-ExcludeArch: %{arm} aarch64 %ix86 x86_64
-%endif
+%description
+Input Delegator Application for Wearable environment
-%if "%{?profile}" == "common"
-ExcludeArch: %{arm} aarch64 %ix86 x86_64
+# This is for old profile-based OBS project optimizations.
+# In 4.0 unified build env, this if statement is always true.
+%if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "wearable" && "%{?profile}" != "ivi"
+%package profile_common
+Summary: Inputdelegator binaries and resources without flavors
+Provides: %{name}-compat = %{version}-%{release}
+Conflicts: %{name}-profile_mobile
+Conflicts: %{name}-profile_tv
+Conflicts: %{name}-profile_wearable
+Conflicts: %{name}-profile_ivi
+%description profile_common
+Inputdelegator binaries and resources without flavors, intended
+to support common profiles, which does not supply any additional options
+for the build.
%endif
-%if "%{?profile}" == "ivi"
-ExcludeArch: %{arm} aarch64 %ix86 x86_64
+# This is for old profile-based OBS project optimizations.
+# In 4.0 unified build env, this if statement is always true.
+%if "%{?profile}" != "tv" && "%{?profile}" != "wearable" && "%{?profile}" != "ivi"
+%package profile_mobile
+Summary: Inputdelegator binaries and resources with mobile profile
+Provides: %{name}-compat = %{version}-%{release}
+Conflicts: %{name}-profile_common
+Conflicts: %{name}-profile_tv
+Conflicts: %{name}-profile_wearable
+Conflicts: %{name}-profile_ivi
+%description profile_mobile
+Inputdelegator binaries and resources with mobile options.
+This is intended to support mobile profiles.
%endif
-%define _appdir /usr/apps
-%define _app_destdir %{_appdir}/%{name}
+# This is for old profile-based OBS project optimizations.
+# In 4.0 unified build env, this if statement is always true.
+%if "%{?profile}" != "mobile" && "%{?profile}" != "wearable" && "%{?profile}" != "ivi"
+%package profile_tv
+Summary: Inputdelegator binaries and resources with tv profile
+Provides: %{name}-compat = %{version}-%{release}
+Conflicts: %{name}-profile_common
+Conflicts: %{name}-profile_mobile
+Conflicts: %{name}-profile_wearable
+Conflicts: %{name}-profile_ivi
+%description profile_tv
+Inputdelegator binaries and resources with tv options.
+This is intended to support tv profiles.
+%endif
-# Sandboxed prefix '/'
-%define _app_prefix /
-%define _app_localedir %{_app_prefix}res/locale
-%description
-Input Delegator Application for Wearable environment
+# This is for old profile-based OBS project optimizations.
+# In 4.0 unified build env, this if statement is always true.
+# Common is blocked because wearable has extra efl-ext entries, which will be
+# removed for unified build env later.
+%if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "common" && "%{?profile}" != "ivi"
+%package profile_wearable
+Summary: Meta package of Inputdelegator for wearable profiles.
+Provides: %{name}-compat = %{version}-%{release}
+Conflicts: %{name}-profile_common
+Conflicts: %{name}-profile_mobile
+Conflicts: %{name}-profile_tv
+Conflicts: %{name}-profile_ivi
+%description profile_wearable
+Meta package of Inputdelegator binaries and resources with
+wearable options.
+%endif
%prep
%setup -q
%build
-export CFLAGS+=" -DTIZEN_DEBUG_ENABLE -Werror -fvisibility=hidden"
-export CXXFLAGS+=" -DTIZEN_DEBUG_ENABLE -Werror -fvisibility=hidden -fvisibility-inlines-hidden"
-export FFLAGS+=" -DTIZEN_DEBUG_ENABLE -Werror"
+export CFLAGS_BASE="${CFLAGS} -DTIZEN_DEBUG_ENABLE -fvisibility=hidden"
+export CXXFLAGS_BASE="${CXXFLAGS} -DTIZEN_DEBUG_ENABLE -std=c++11 -fvisibility-inlines-hidden"
+export FFLAGS+=" -DTIZEN_DEBUG_ENABLE"
+
+rm -rf CMakeFiles
+rm -rf CMakeCache.txt
-export CXXFLAGS="$CXXFLAGS -std=gnu++0x"
+# This is for old profile-based OBS project optimizations.
+# In 4.0 unified build env, this if statement is always true.
+# Common is blocked because wearable has extra efl-ext entries, which will be
+# removed for unified build env later.
+%if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "common" && "%{?profile}" != "ivi"
+mkdir -p build_wearable
+pushd build_wearable
+export CFLAGS="${CFLAGS_BASE} -D_WEARABLE -D_CIRCLE";
+export CXXFLAGS="${CXXFLAGS_BASE} -D_WEARABLE -D_CIRCLE";
+%cmake .. -DTARGET=wearable \
+ -DTZ_SYS_RO_APP=%TZ_SYS_RO_APP \
+ -DTZ_SYS_RO_PACKAGES=%TZ_SYS_RO_PACKAGES
+make %{?jobs:-j%jobs}
+popd
+%endif
-cmake . -DCMAKE_INSTALL_PREFIX=%{_app_prefix} \
- -DCMAKE_INSTALL_LOCALEDIR=%{_app_localedir} \
- -DENABLE_LOG_MANAGER=%{enable_log_manager}
-# compile warning & error filtering
-make %{?jobs:-j%jobs} \
- 2>&1 | sed \
- -e 's%^.*: error: .*$%\x1b[1;31;40m&\x1b[m%' \
- -e 's%^.*: warning: .*$%\x1b[1;33;40m&\x1b[m%'
+# This is for old profile-based OBS project optimizations.
+# In 4.0 unified build env, this if statement is always true.
+%if "%{?profile}" != "tv" && "%{?profile}" != "wearable" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
+mkdir -p build_mobile
+pushd build_mobile
+export CFLAGS="${CFLAGS_BASE} -D_MOBILE";
+export CXXFLAGS="${CXXFLAGS_BASE} -D_MOBILE";
+%cmake .. -DTARGET=mobile \
+ -DTZ_SYS_RO_APP=%TZ_SYS_RO_APP \
+ -DTZ_SYS_RO_PACKAGES=%TZ_SYS_RO_PACKAGES \
+ -Dwith_cbhm=TRUE
+
+make %{?jobs:-j%jobs}
+popd
+%endif
+
+# This is for old profile-based OBS project optimizations.
+# In 4.0 unified build env, this if statement is always true.
+%if "%{?profile}" != "mobile" && "%{?profile}" != "wearable" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
+mkdir -p build_tv
+pushd build_tv
+export CFLAGS="${CFLAGS_BASE} -D_TV";
+export CXXFLAGS="${CXXFLAGS_BASE} -D_TV";
+%cmake .. -DTARGET=tv \
+ -DTZ_SYS_RO_APP=%TZ_SYS_RO_APP \
+ -DTZ_SYS_RO_PACKAGES=%TZ_SYS_RO_PACKAGES
+
+make %{?jobs:-j%jobs}
+popd
+%endif
+
+
+# This is for old profile-based OBS project optimizations.
+# In 4.0 unified build env, this if statement is always true.
+%if "%{?profile}" != "mobile" && "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi"
+export CFLAGS="${CFLAGS_BASE}";
+export CXXFLAGS="${CXXFLAGS_BASE}";
+%cmake . -DTARGET=common \
+ -DTZ_SYS_RO_APP=%TZ_SYS_RO_APP \
+ -DTZ_SYS_RO_PACKAGES=%TZ_SYS_RO_PACKAGES
+
+make %{?jobs:-j%jobs}
+%endif
%install
rm -rf %{buildroot}
-make install DESTDIR=%{buildroot}%{_app_destdir}
-mkdir -p %{buildroot}%{_datadir}/packages/
-cp -rf org.tizen.inputdelegator.xml %{buildroot}%{_datadir}/packages
-%post
-#nothing
-/usr/bin/vconftool -u 5000 set -t int db/private/ise/stt/language "0" -f -s tizen::vconf::platform::rw
-%files
-%manifest org.tizen.inputdelegator.manifest
+# This is for old profile-based OBS project optimizations.
+# In 4.0 unified build env, this if statement is always true.
+%if "%{?profile}" != "mobile" && "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi"
+%make_install
+mkdir -p %{buildroot}%{TZ_SYS_RO_APP}/org.tizen.inputdelegator/common
+pushd %{buildroot}%{TZ_SYS_RO_APP}/org.tizen.inputdelegator/
+mv bin common/
+mkdir -p common/res
+pushd res
+for FILE in *; do if [[ $FILE =~ ^locale$ ]]; then echo skip commonly used "${FILE}"; else mv "${FILE}" ../common/res/; fi; done
+popd
+popd
+%endif
+
+# This is for old profile-based OBS project optimizations.
+# In 4.0 unified build env, this if statement is always true.
+%if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
+pushd build_mobile
+%make_install
+popd
+mkdir -p %{buildroot}%{TZ_SYS_RO_APP}/org.tizen.inputdelegator/mobile
+pushd %{buildroot}%{TZ_SYS_RO_APP}/org.tizen.inputdelegator/
+mv bin mobile/
+mkdir -p mobile/res
+pushd res
+for FILE in *; do if [[ $FILE =~ ^locale$ ]]; then echo skip commonly used "${FILE}"; else mv "${FILE}" ../mobile/res/; fi; done
+popd
+popd
+%endif
+
+# This is for old profile-based OBS project optimizations.
+# In 4.0 unified build env, this if statement is always true.
+%if "%{?profile}" != "mobile" && "%{?profile}" != "wearable" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
+pushd build_tv
+%make_install
+popd
+mkdir -p %{buildroot}%{TZ_SYS_RO_APP}/org.tizen.inputdelegator/tv
+pushd %{buildroot}%{TZ_SYS_RO_APP}/org.tizen.inputdelegator/
+mv bin tv/
+mkdir -p tv/res
+pushd res
+for FILE in *; do if [[ $FILE =~ ^locale$ ]]; then echo skip commonly used "${FILE}"; else mv "${FILE}" ../tv/res/; fi; done
+popd
+popd
+%endif
+
+
+# This is for old profile-based OBS project optimizations.
+# In 4.0 unified build env, this if statement is always true.
+# Common is blocked because wearable has extra efl-ext entries, which will be
+# removed for unified build env later.
+%if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "common" && "%{?profile}" != "ivi"
+pushd build_wearable
+%make_install
+popd
+mkdir -p %{buildroot}%{TZ_SYS_RO_APP}/org.tizen.inputdelegator/wearable
+pushd %{buildroot}%{TZ_SYS_RO_APP}/org.tizen.inputdelegator/
+mv bin wearable/
+mkdir -p wearable/res
+pushd res
+for FILE in *; do if [[ $FILE =~ ^locale$ ]]; then echo skip commonly used "${FILE}"; else mv "${FILE}" ../wearable/res/; fi; done
+popd
+popd
+%endif
+
+%find_lang inputdelegator
+
+%files -f inputdelegator.lang
+%manifest %{name}.manifest
%defattr(-,root,root,-)
+%{TZ_SYS_RO_PACKAGES}/%{name}.xml
%license LICENSE
-%{_datadir}/packages/org.tizen.inputdelegator.xml
-%{_app_destdir}%{_app_prefix}/bin/inputdelegator
-%{_app_destdir}%{_app_prefix}/res/edje/w-input-selector.edj
-%{_app_destdir}%{_app_prefix}/res/edje/w-input-stt.edj
-%{_app_destdir}%{_app_prefix}/res/edje/w-input-stt-button.edj
-%{_app_destdir}%{_app_prefix}/res/images/*
-%{_app_destdir}%{_app_prefix}/shared/res/w-input-selector.png
-%{_app_destdir}%{_app_localedir}/*/LC_MESSAGES/org.tizen.inputdelegator.mo
+
+# This is for old profile-based OBS project optimizations.
+# In 4.0 unified build env, this if statement is always true.
+%if "%{?profile}" != "mobile" && "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi"
+%post profile_common
+pushd %{TZ_SYS_RO_APP}/org.tizen.inputdelegator/common/
+mkdir -p ../res
+mkdir -p ../bin
+# If we are upgrading this package, remove existing files before copying (1:install / 2:upgrade)
+if [ "$1" = "2" ]; then
+ rm -Rf ../bin/*
+ pushd ../res
+ for FILE in *; do if [[ $FILE =~ locale$ ]]; then echo skip "${FILE}"; else rm -Rf "${FILE}"; fi; done
+ popd
+fi
+for FILE in bin/*; do ln -sf "../common/${FILE}" ../bin; done
+for FILE in res/*; do ln -sf "../common/${FILE}" ../res; done
+popd
+%preun profile_common
+# Perform file removal only when uninstalling (0:uninstall / 1:upgrade)
+if [ "$1" = "0" ]; then
+ pushd %{TZ_SYS_RO_APP}/org.tizen.inputdelegator
+ rm -Rf bin
+ pushd res
+ for FILE in *; do if [[ $FILE =~ locale$ ]]; then echo skip "${FILE}"; else rm -Rf "${FILE}"; fi; done
+ popd
+ popd
+fi
+%files profile_common
+%manifest %{name}.manifest
+%defattr(-,root,root,-)
+%{TZ_SYS_RO_APP}/org.tizen.inputdelegator/common/*
+%endif
+
+
+# This is for old profile-based OBS project optimizations.
+# In 4.0 unified build env, this if statement is always true.
+%if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
+%post profile_mobile
+pushd %{TZ_SYS_RO_APP}/org.tizen.inputdelegator/mobile/
+mkdir -p ../res
+mkdir -p ../bin
+# If we are upgrading this package, remove existing files before copying (1:install / 2:upgrade)
+if [ "$1" = "2" ]; then
+ rm -Rf ../bin/*
+ pushd ../res
+ for FILE in *; do if [[ $FILE =~ locale$ ]]; then echo skip "${FILE}"; else rm -Rf "${FILE}"; fi; done
+ popd
+fi
+for FILE in bin/*; do ln -sf "../mobile/${FILE}" ../bin; done
+for FILE in res/*; do ln -sf "../mobile/${FILE}" ../res; done
+popd
+%preun profile_mobile
+# Perform file removal only when uninstalling (0:uninstall / 1:upgrade)
+if [ "$1" = "0" ]; then
+ pushd %{TZ_SYS_RO_APP}/org.tizen.inputdelegator
+ rm -Rf bin
+ pushd res
+ for FILE in *; do if [[ $FILE =~ locale$ ]]; then echo skip "${FILE}"; else rm -Rf "${FILE}"; fi; done
+ popd
+ popd
+fi
+%files profile_mobile
+%manifest %{name}.manifest
+%defattr(-,root,root,-)
+%{TZ_SYS_RO_APP}/org.tizen.inputdelegator/mobile/*
+%endif
+
+
+# This is for old profile-based OBS project optimizations.
+# In 4.0 unified build env, this if statement is always true.
+%if "%{?profile}" != "mobile" && "%{?profile}" != "wearable" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
+%post profile_tv
+pushd %{TZ_SYS_RO_APP}/org.tizen.inputdelegator/tv/
+mkdir -p ../res
+mkdir -p ../bin
+# If we are upgrading this package, remove existing files before copying (1:install / 2:upgrade)
+if [ "$1" = "2" ]; then
+ rm -Rf ../bin/*
+ pushd ../res
+ for FILE in *; do if [[ $FILE =~ locale$ ]]; then echo skip "${FILE}"; else rm -Rf "${FILE}"; fi; done
+ popd
+fi
+for FILE in bin/*; do ln -sf "../tv/${FILE}" ../bin; done
+for FILE in res/*; do ln -sf "../tv/${FILE}" ../res; done
+popd
+%preun profile_tv
+# Perform file removal only when uninstalling (0:uninstall / 1:upgrade)
+if [ "$1" = "0" ]; then
+ pushd %{TZ_SYS_RO_APP}/org.tizen.inputdelegator
+ rm -Rf bin
+ pushd res
+ for FILE in *; do if [[ $FILE =~ locale$ ]]; then echo skip "${FILE}"; else rm -Rf "${FILE}"; fi; done
+ popd
+ popd
+fi
+%files profile_tv
+%manifest %{name}.manifest
+%defattr(-,root,root,-)
+%{TZ_SYS_RO_APP}/org.tizen.inputdelegator/tv/*
+%endif
+
+
+# This is for old profile-based OBS project optimizations.
+# In 4.0 unified build env, this if statement is always true.
+# Common is blocked because wearable has extra efl-ext entries, which will be
+# removed for unified build env later.
+%if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "common" && "%{?profile}" != "ivi"
+%post profile_wearable
+pushd %{TZ_SYS_RO_APP}/org.tizen.inputdelegator/wearable/
+mkdir -p ../res
+mkdir -p ../bin
+# If we are upgrading this package, remove existing files before copying (1:install / 2:upgrade)
+if [ "$1" = "2" ]; then
+ rm -Rf ../bin/*
+ pushd ../res
+ for FILE in *; do if [[ $FILE =~ locale$ ]]; then echo skip "${FILE}"; else rm -Rf "${FILE}"; fi; done
+ popd
+fi
+for FILE in bin/*; do ln -sf "../wearable/${FILE}" ../bin; done
+for FILE in res/*; do ln -sf "../wearable/${FILE}" ../res; done
+popd
+%preun profile_wearable
+# Perform file removal only when uninstalling (0:uninstall / 1:upgrade)
+if [ "$1" = "0" ]; then
+ pushd %{TZ_SYS_RO_APP}/org.tizen.inputdelegator
+ rm -Rf bin
+ pushd res
+ for FILE in *; do if [[ $FILE =~ locale$ ]]; then echo skip "${FILE}"; else rm -Rf "${FILE}"; fi; done
+ popd
+ popd
+fi
+%files profile_wearable
+%manifest %{name}.manifest
+%defattr(-,root,root,-)
+%{TZ_SYS_RO_APP}/org.tizen.inputdelegator/wearable/*
+%endif