+rm -rf %{buildroot}
+
+pushd %{_builddir}/%{name}-%{version}/build/tizen
+%make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
+
+
+# If the profile is selected, the line below is repquired.
+# !unified && (wearable || tv || ivi || mobile)
+%if "%{?profile}" == "wearable" || "%{?profile}" == "tv" || "%{?profile}" == "ivi" || "%{?profile}" == "mobile"
+rm -rf %{buildroot}%{_libdir}/libdali-csharp-binder*.so*
+%endif
+
+# If the profile is selected, the line below is repquired.
+# wearable || tv || ivi || mobile || unified
+%if "%{?profile}" != "common"
+for FILE in libdali-*.so*; do mv "$FILE" "%{buildroot}%{_libdir}/$FILE"; done
+mv dali-csharp-binder*.pc %{buildroot}%{_libdir}/pkgconfig/
+%endif
+popd
+
+################################################
+#rename
+###############################################
+pushd %{buildroot}%{_libdir}
+
+# If the profile is selected, the line below is repquired.
+# if common ||"undefined"
+#%if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
+rm -rf libdali-csharp-binder*.so
+ln -s libdali-csharp-binder.so.0.0.0 libdali-csharp-binder.so
+#%endif
+
+# If the profile is selected, the line below is repquired.
+# if wearable || "undefined"
+%if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
+rm -rf libdali-csharp-binder*.so.wearable
+ln -s libdali-csharp-binder.so.0.0.*.wearable libdali-csharp-binder.so.wearable
+%endif
+
+# If the profile is selected, the line below is repquired.
+# if tv ||"undefined"
+%if "%{?profile}" != "wearable" && "%{?profile}" != "common" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
+rm -rf libdali-csharp-binder*.so.tv
+ln -s libdali-csharp-binder.so.0.0.*.tv libdali-csharp-binder.so.tv
+%endif
+
+# If the profile is selected, the line below is repquired.
+# if ivi ||"undefined"
+%if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "common" && "%{?profile}" != "mobile"
+rm -rf libdali-csharp-binder*.so.ivi
+ln -s libdali-csharp-binder.so.0.0.*.ivi libdali-csharp-binder.so.ivi
+%endif
+
+# If the profile is selected, the line below is repquired.
+# if mobile || "undefined"
+%if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
+rm -rf libdali-csharp-binder*.so.mobile
+ln -s libdali-csharp-binder.so.0.0.*.mobile libdali-csharp-binder.so.mobile
+%endif
+popd
+
+##############################
+# Upgrade order:
+# 1 - Pre Install new package
+# 2 - Install new package
+# 3 - Post install new package
+# 4 - Pre uninstall old package
+# 5 - Remove files not overwritten by new package
+# 6 - Post uninstall old package
+##############################
+
+%pre
+exit 0
+
+##############################
+# Post Install new package
+##############################
+%post
+/sbin/ldconfig
+exit 0
+
+##############################
+# Pre Uninstall old package
+##############################
+%preun
+exit 0
+
+##############################
+# Post Uninstall old package
+##############################
+%postun
+/sbin/ldconfig
+exit 0
+
+##############################
+
+# If the profile is selected, the line below is repquired.
+# if mobile || "undefined"
+%if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
+%post profile_mobile
+pushd %{_libdir}
+for FILE in libdali-csharp-binder.so*.mobile; do ln -sf "$FILE" "${FILE%.mobile}"; done
+popd
+/sbin/ldconfig
+exit 0
+
+%postun profile_mobile
+/sbin/ldconfig
+exit 0
+%endif
+
+##############################
+
+# If the profile is selected, the line below is repquired.
+# if tv ||"undefined"
+%if "%{?profile}" != "wearable" && "%{?profile}" != "common" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
+%post profile_tv
+pushd %{_libdir}
+for FILE in libdali-csharp-binder.so*.tv; do ln -sf "$FILE" "${FILE%.tv}"; done
+popd
+/sbin/ldconfig
+exit 0
+
+%postun profile_tv
+/sbin/ldconfig
+exit 0
+%endif
+
+##############################
+
+# If the profile is selected, the line below is repquired.
+# if wearable || "undefined"
+%if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
+%post profile_wearable
+pushd %{_libdir}
+for FILE in libdali-csharp-binder.so*.wearable; do ln -sf "$FILE" "${FILE%.wearable}"; done
+popd
+/sbin/ldconfig
+exit 0
+
+%postun profile_wearable
+/sbin/ldconfig
+exit 0
+%endif
+
+##############################
+
+# If the profile is selected, the line below is repquired.
+# if ivi ||"undefined"
+%if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "common" && "%{?profile}" != "mobile"
+%post profile_ivi
+pushd %{_libdir}
+for FILE in libdali-csharp-binder.so*.ivi; do ln -sf "$FILE" "${FILE%.ivi}"; done
+popd
+/sbin/ldconfig
+exit 0
+
+%postun profile_ivi
+/sbin/ldconfig
+exit 0
+%endif
+