+
+# 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.
+%if "%{?profile}" != "mobile" && "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "common"
+%post profile_ivi
+pushd %{TZ_SYS_RO_APP}/org.tizen.inputdelegator/ivi/
+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 "../ivi/${FILE}" ../bin; done
+for FILE in res/*; do ln -sf "../ivi/${FILE}" ../res; done
+popd
+%preun profile_ivi
+# 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_ivi
+%manifest %{name}.manifest
+%defattr(-,root,root,-)
+%{TZ_SYS_RO_APP}/org.tizen.inputdelegator/ivi/*
+%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"
+%files profile_wearable
+
+%post profile_wearable-extension-circle
+pushd %{TZ_SYS_RO_APP}/org.tizen.inputdelegator/wearable-circle/
+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-circle/${FILE}" ../bin; done
+for FILE in res/*; do ln -sf "../wearable-circle/${FILE}" ../res; done
+popd
+%preun profile_wearable-extension-circle
+# 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-extension-circle
+%manifest %{name}.manifest
+%defattr(-,root,root,-)
+%{TZ_SYS_RO_APP}/org.tizen.inputdelegator/wearable-circle/*
+
+
+%post profile_wearable-extension-rectangle
+pushd %{TZ_SYS_RO_APP}/org.tizen.inputdelegator/wearable-rectangle/
+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-rectangle/${FILE}" ../bin; done
+for FILE in res/*; do ln -sf "../wearable-rectangle/${FILE}" ../res; done
+popd
+%preun profile_wearable-extension-rectangle
+# 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-extension-rectangle
+%manifest %{name}.manifest
+%defattr(-,root,root,-)
+%{TZ_SYS_RO_APP}/org.tizen.inputdelegator/wearable-rectangle/*
+%endif