Name: chromium-efl
Summary: Chromium EFL
-# Set by by scripts/update-chromium-version.sh
-%define ChromiumVersion 108.0.5359.1
-%define Week 1
-Version: %{ChromiumVersion}.%{Week}
+# Version: {TPK_VERSION}.{INTERNAL_API_REVISION}.{CHROMIUM_MAJOR_VERSION}
+# The {INTERNAL_API_REVISION} is used for compatibility check with wrtjs.
+Version: 1.1.108
+# Set by ./tizen_src/scripts/update_chromium_version.sh
+%define upstream_chromium_version 108.0.5359.1
Release: 1
# The 'Group' should be specified as one of the following valid group list.
# https://wiki.tizen.org/wiki/Packaging/Guidelines#Group_Tag
install -m 0644 wrt/native_wrtjs.d.ts "%{buildroot}"%{_includedir}/wrt/
%endif
+%pre
+if (( $(rpm -qa | grep 'wrtjs-[[:digit:]]' | wc -l) > 1 )); then
+ echo -e "\033[31m*****************************************************"
+ echo -e "Please remove wrtjs rpm(s) except for one:\n"
+ rpm -qa | grep 'wrtjs-[[:digit:]]'
+ echo -e "*****************************************************\033[m"
+ exit 1
+fi
+
+export CHROMIUM_REVISION=$(echo %{version} | awk -F. '{print $2}')
+export WRTJS_REVISION=$(rpm -qa | grep wrtjs | awk -F. '{print $2}')
+if [[ "${WRTJS_REVISION}" == "" ]]; then
+ WRTJS_REVISION="not installed"
+fi
+
+echo -e "\033[32m*****************************************************"
+echo -e "* chromium-efl revision : ${CHROMIUM_REVISION}"
+echo -e "* wrtjs revision : ${WRTJS_REVISION}"
+echo -e "*"
+if [[ "${WRTJS_REVISION}" == "not installed" ]] || \
+ (( ${CHROMIUM_REVISION} == ${WRTJS_REVISION} )); then
+ echo -e "* Succeeded to check rpm versions"
+else
+ if (( ${CHROMIUM_REVISION} < ${WRTJS_REVISION} )); then
+ echo -e "\033[31m* You're trying to install too old chromium-efl."
+ echo -e "* Please install chromium-efl as revision ${WRTJS_REVISION}"
+ echo -e "* or"
+ else
+ echo -e "\033[31m* You have too old wrtjs."
+ fi
+ echo -e "* please re-install wrtjs as revision ${CHROMIUM_REVISION} first."
+fi
+echo -e "*****************************************************\033[m"
+
%post
%if 0%{?__enable_wrt_js}
cyad -s -k MANIFESTS_GLOBAL -c User::Pkg::org.tizen.chromium-efl -u '*' -p http://tizen.org/privilege/alarm -t ALLOW