Name: wrtjs Summary: Javascript based Runtime for Tizen # Version: {TPK_VERSION}.{INTERNAL_API_REVISION}.{WRTJS_VERSION} # The {INTERNAL_API_REVISION} is used to check compatibility with chromium-efl. Version: 1.1.1 Release: 1 Group: Web Framework/Web Runtime License: Apache-2.0 URL: https://www.tizen.org Source: %{name}-%{version}.tar.gz %define _appdir %TZ_SYS_RO_APP %define _bindir %TZ_SYS_BIN %define _xmldir %TZ_SYS_RO_PACKAGES %define app_dir out/gen/app %define crosswalk_extensions_service tizen-extensions-crosswalk-service # The d2d is public feature %if "%{?tizen_profile_name}" != "tv" && "%{?profile}" != "wearable" && "%{?_with_da_profile}" != "1" %define _use_d2d 1 %endif BuildRequires: pkgconfig(chromium-efl) %if "%{?profile}" != "tv" BuildRequires: ninja BuildRequires: pkgconfig(dlog) %endif %if 0%{?_use_tpk} || 0%{?_use_d2d} %if "%{?profile}" == "tv" BuildRequires: app-signer %endif BuildRequires: hash-signer, zip %endif BuildRequires: pkgconfig(libtzplatform-config) %description Web Runtime Engine based on Electron %define _tizen_version %{tizen_version_major}%{tizen_version_minor} %define _pkgid org.tizen.%{name} %define __pkgid %{_pkgid} %if 0%{?_use_tpk} # The tv profile has a different tpk generation policy. # 2 types(update, upgrade) of tpk can be generated and used simultaneously. # If tpktype is not defined and tizen version is less than 6.0, upgrade type # is generated by default. %if "%{?profile}" == "tv" %if "%{?tpktype}" == "upgrade" || (0%{!?tpktype:1} && %{_tizen_version} < 60) %define __pkgid %{_pkgid}-upgrade %endif %endif %endif # Generated app directory %global GENERATED_APP_DIR /tmp/%{name} # Directory for WRTjs tizen application package %global WRTJS_APP_DIR %{TZ_SYS_RO_APP}/%{__pkgid} %prep %setup -q %build # The "_repository" flag was changed to "_vd_cfg_target_repository" # since tizen 4.0 product tv. %if "%{?profile}" == "tv" %define _manifestname %{_pkgid}-vd # The onemain branch haven't defined _vd_cfg_target_repository. # So, this hijack code is added to set the repo_name to "MuseM". # Remove this code when _vd_cfg_target_repository is defined in onemain. %if "%{?_vd_cfg_target_repository}" %define repo_name %{_vd_cfg_target_repository} %else %define repo_name MuseM %endif %else %define _manifestname %{_pkgid} %define repo_name %{_repository} %endif %if "%{?profile}" != "tv" %define _outdir $PWD/out ./build/tools/gn gen %{_outdir} ninja -C %{_outdir} wrt-loader %endif ./build/tools/node ./node_modules/.bin/tsc absolute_appdir=$PWD/%{app_dir} (cd wrt_app/ && find . -type f ! -name '*.ts' -exec cp --parents {} ${absolute_appdir} \;) %if 0%{?_use_tpk} %if "%{_vd_cfg_chip_vendor}" != "EMUL" && "%{?profile}" == "tv" %define __package_signing 1 %else %define __package_signing 0 %endif sed -e 's#@TIZEN_VERSION@#%{tizen_version_major}.%{tizen_version_minor}#g' \ -e 's#@WRTJS_VERSION@#%{version}#g' \ -e 's#@PACKAGE_ID@#%{__pkgid}#g' \ packaging/%{_manifestname}.xml.in \ > packaging/tizen-manifest-tpk.xml %endif %if 0%{?_use_d2d} %define _d2d_pkgid 9z6IujVul3 sed -e 's#@TIZEN_VERSION@#%{tizen_version_major}.%{tizen_version_minor}#g' \ -e 's#@WRTJS_VERSION@#%{version}#g' \ -e 's#@PACKAGE_ID@#%{_d2d_pkgid}#g' \ packaging/d2d_app.xml.in \ > packaging/%{_d2d_pkgid}.xml %endif %install %ifarch armv7l %define ARCHITECTURE armv7l %endif %ifarch aarch64 %define ARCHITECTURE aarch64 %endif %ifarch i586 i686 %define ARCHITECTURE ix86 %endif %ifarch x86_64 %define ARCHITECTURE x86_64 %endif %define _resourcedir /usr/share/wrt/app install -d %{GENERATED_APP_DIR} install -d %{buildroot}%{_bindir} install -d %{buildroot}%{_datadir}/aul install -d %{buildroot}%{_resourcedir} install -d %{buildroot}%{WRTJS_APP_DIR} %if 0%{?_use_tpk} %if 0%{?__package_signing} install -m 0644 tizen/downloadable/vd_sign/author-signature.xml %{buildroot}%{WRTJS_APP_DIR} install -m 0644 tizen/downloadable/vd_sign/signature1.xml %{buildroot}%{WRTJS_APP_DIR} %else %define tizen_sign 1 %define tizen_sign_base %{WRTJS_APP_DIR} %define tizen_sign_level platform %define tizen_author_sign 1 %define tizen_dist_sign 1 %endif %endif %if "%{?profile}" == "tv" ln -s %{_bindir}/wrt %{buildroot}%{_bindir}/wrt-loader %if "%{_vd_cfg_product_type}" != "LFD" %if "%{_vd_cfg_platform_type}" == "FULL_SMART" install -m 0644 packaging/wrt_tv.loader %{buildroot}%{_datadir}/aul/wrt.loader %endif %if "%{_vd_cfg_platform_type}" == "ENTRY_SMART" install -m 0644 packaging/wrt_tv_lite.loader %{buildroot}%{_datadir}/aul/wrt.loader %endif %endif %else install -m 0755 %{_outdir}/wrt-loader %{buildroot}%{_bindir} install -m 0644 packaging/wrt.loader %{buildroot}%{_datadir}/aul/ %endif mkdir -p %{buildroot}%{_libdir}/%{crosswalk_extensions_service} cp packaging/plugins.json %{buildroot}%{_libdir}/%{crosswalk_extensions_service} cp -r %{app_dir}/* %{buildroot}%{_resourcedir}/ %if 0%{?_use_tpk} # The debugsources.list is needed by __spec_install_post to generate tpk file # but it's missing in the build process. So, the temporary file is touched. touch debugsources.list %define _tpk_file_name %{__pkgid}-%{version}-v%{tizen_version_major}.%{tizen_version_minor}.%{repo_name}.%{ARCHITECTURE}.tpk %define __tpk_install_post \ tizen/build/build_app.sh %{GENERATED_APP_DIR} wrtjs_tpk_root %{_tpk_file_name} tpk %{?profile} %define __spec_install_post \ %{?__tpk_install_post} \ %{nil} %else echo "No TPK generation" %endif %if 0%{?_use_d2d} install -d %{buildroot}%{_appdir}/%{_d2d_pkgid}/bin install -d %{buildroot}%{_appdir}/%{_d2d_pkgid}/res install -d %{buildroot}%{_xmldir} install -m 0644 packaging/%{_d2d_pkgid}.xml %{buildroot}%{_xmldir}/ cp -rf d2d_app %{buildroot}%{_appdir}/%{_d2d_pkgid}/res/wgt/ ln -sf %{_bindir}/wrt-service-launcher %{buildroot}%{_appdir}/%{_d2d_pkgid}/bin/%{_d2d_pkgid}.Service %endif %pre if (( $(rpm -q chromium-efl | wc -l) > 1 )); then echo -e "\033[31m*****************************************************" echo -e "Please remove chromium-efl rpm(s) except for one:\n" rpm -q chromium-efl echo -e "*****************************************************\033[m" exit 1 fi export CHROMIUM_REVISION=$(rpm -q chromium-efl | awk -F. '{print $2}') export WRTJS_REVISION=$(echo %{version} | awk -F. '{print $2}') if [[ "${CHROMIUM_REVISION}" == "" ]]; then CHROMIUM_REVISION="not installed" fi echo -e "\033[32m*****************************************************" echo -e "* chromium-efl revision : ${CHROMIUM_REVISION}" echo -e "* wrtjs revision : ${WRTJS_REVISION}" echo -e "*" if [[ "${CHROMIUM_REVISION}" == "not installed" ]] || \ (( ${CHROMIUM_REVISION} == ${WRTJS_REVISION} )); then echo -e "* Succeeded to check rpm versions" echo -e "*****************************************************\033[m" else if (( ${CHROMIUM_REVISION} > ${WRTJS_REVISION} )); then echo -e "\033[31m* You're trying to install too old wrtjs." echo -e "* Please install wrtjs as revision $CHROMIUM_REVISION" echo -e "* or" else echo -e "\033[31m* You have too old chromium-efl." fi echo -e "* please re-install chromium-efl as revision $WRTJS_REVISION first." echo -e "*****************************************************\033[m" exit 1 fi %post %postun %clean rm -fr %{buildroot} %files %manifest packaging/wrtjs.manifest %license LICENSE %if 0%{?_use_d2d} %{_appdir}/%{_d2d_pkgid} %{_xmldir}/%{_d2d_pkgid}.xml %endif %if "%{?tizen_profile_name}" != "tv" %caps(cap_setgid,cap_sys_admin=ei) %{_bindir}/wrt-loader %else %{_bindir}/wrt-loader %endif %if "%{_vd_cfg_product_type}" != "LFD" %{_datadir}/aul/wrt.loader %endif %{_libdir}/%{crosswalk_extensions_service}/plugins.json %{_resourcedir}/* %if 0%{?__package_signing} %{WRTJS_APP_DIR}/author-signature.xml %{WRTJS_APP_DIR}/signature1.xml %endif