+
+# 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