@ -1,3 +1,6 @@
# Build Chromium with GOST
%bcond_with gost
%define _lto_cflags %{nil}
%define _lto_cflags %{nil}
# enable|disable system build flags
# enable|disable system build flags
@ -36,7 +39,18 @@
ninja -j %{numjobs} -C '%1' '%2'
ninja -j %{numjobs} -C '%1' '%2'
# enable|disable headless client build
# enable|disable headless client build
%if %{with gost}
%global build_headless 0
%else
%global build_headless 1
%global build_headless 1
%endif
# enable|disable headless client build
%if %{with gost}
%global build_chromedriver 0
%else
%global build_chromedriver 1
%endif
# enable|disable chrome-remote-desktop build
# enable|disable chrome-remote-desktop build
%global build_remoting 0
%global build_remoting 0
@ -133,7 +147,11 @@
# %%{nil} for Stable; -beta for Beta; -dev for Devel
# %%{nil} for Stable; -beta for Beta; -dev for Devel
# dash in -beta and -dev is intentional !
# dash in -beta and -dev is intentional !
%if %{with gost}
%global chromium_channel -gost
%else
%global chromium_channel %{nil}
%global chromium_channel %{nil}
%endif
%global chromium_menu_name Chromium
%global chromium_menu_name Chromium
%global chromium_browser_channel chromium-browser%{chromium_channel}
%global chromium_browser_channel chromium-browser%{chromium_channel}
%global chromium_path %{_libdir}/chromium-browser%{chromium_channel}
%global chromium_path %{_libdir}/chromium-browser%{chromium_channel}
@ -232,12 +250,14 @@
%endif
%endif
%endif
%endif
%if %{with gost}
# Build with GOST patches
# Build with GOST patches
# https://github.com/deemru/chromium-gost/
# https://github.com/deemru/chromium-gost/
%global gost 1
%global gost_build 1
%define chromium_gost_commit 2c81b2fed144086340d5220ef707350b7fb18ec9
%define chromium_gost_commit 2c81b2fed144086340d5220ef707350b7fb18ec9
%define msspi_commit 3c50c2d33a4bdf4effb01aaeb9ff5d5b67635a18
%define msspi_commit 3c50c2d33a4bdf4effb01aaeb9ff5d5b67635a18
%define chromium_path_gost %{_builddir}/chromium-gost
%define chromium_path_gost %{_builddir}/chromium-gost
%endif
### From 2013 until early 2021, Google permitted distribution builds of
### From 2013 until early 2021, Google permitted distribution builds of
### Chromium to access Google APIs that added significant features to
### Chromium to access Google APIs that added significant features to
@ -274,7 +294,7 @@
Name: chromium%{chromium_channel}
Name: chromium%{chromium_channel}
Version: 119.0.6045.159
Version: 119.0.6045.159
Release: 1%{?dist}.inferit.gost
Release: 1%{?dist}.inferit
Summary: A WebKit (Blink) powered web browser that Google doesn't want you to use
Summary: A WebKit (Blink) powered web browser that Google doesn't want you to use
Url: http://www.chromium.org/Home
Url: http://www.chromium.org/Home
License: BSD-3-Clause AND LGPL-2.1-or-later AND Apache-2.0 AND IJG AND MIT AND GPL-2.0-or-later AND ISC AND OpenSSL AND (MPL-1.1 OR GPL-2.0-only OR LGPL-2.0-only)
License: BSD-3-Clause AND LGPL-2.1-or-later AND Apache-2.0 AND IJG AND MIT AND GPL-2.0-or-later AND ISC AND OpenSSL AND (MPL-1.1 OR GPL-2.0-only OR LGPL-2.0-only)
@ -475,9 +495,12 @@ BuildRequires: golang-github-evanw-esbuild
# Yandex logo
# Yandex logo
Source50: https://upload.wikimedia.org/wikipedia/commons/f/f1/Yandex_logo_2021_Russian.svg
Source50: https://upload.wikimedia.org/wikipedia/commons/f/f1/Yandex_logo_2021_Russian.svg
%if %{with gost}
# GOST
# GOST
Source101: https://github.com/deemru/chromium-gost/archive/%{chromium_gost_commit}.tar.gz?/chromium-gost-%{chromium_gost_commit}.tar.gz
Source101: https://github.com/deemru/chromium-gost/archive/%{chromium_gost_commit}.tar.gz?/chromium-gost-%{chromium_gost_commit}.tar.gz
Source102: https://github.com/deemru/msspi/archive/%{msspi_commit}.tar.gz?/msspi-%{msspi_commit}.tar.gz
Source102: https://github.com/deemru/msspi/archive/%{msspi_commit}.tar.gz?/msspi-%{msspi_commit}.tar.gz
Source103: chromium-browser-gost-icons.tar.xz
%endif
%if %{clang}
%if %{clang}
%if 0%{?rhel} == 7
%if 0%{?rhel} == 7
@ -511,12 +534,12 @@ BuildRequires: binutils
#BuildRequires: pkgconfig(libavutil)
#BuildRequires: pkgconfig(libavutil)
# chromium fail to start for rpmfusion users due to ABI break in ffmpeg-free-6.0.1
# chromium fail to start for rpmfusion users due to ABI break in ffmpeg-free-6.0.1
# bethween fedora and rpmfussion.
# bethween fedora and rpmfussion.
#%%if 0%{?rhel} == 9 || 0%%{?fedora} == 37
#%%if 0%% {?rhel} == 9 || 0%%{?fedora} == 37
#Conflicts: libavformat-free%{_isa} < 5.1.4
#Conflicts: libavformat-free%% {_isa} < 5.1.4
#Conflicts: ffmpeg-libs%{_isa} < 5.1.4
#Conflicts: ffmpeg-libs%% {_isa} < 5.1.4
#%%else
#%%else
#Conflicts: libavformat-free%{_isa} < 6.0.1
#Conflicts: libavformat-free%% {_isa} < 6.0.1
#Conflicts: ffmpeg-libs%{_isa} < 6.0.1-2
#Conflicts: ffmpeg-libs%% {_isa} < 6.0.1-2
#%%endif
#%%endif
#%%endif
#%%endif
@ -892,14 +915,10 @@ Provides: bundled(xdg-user-dirs)
Requires(post): /usr/sbin/semanage
Requires(post): /usr/sbin/semanage
Requires(post): /usr/sbin/restorecon
Requires(post): /usr/sbin/restorecon
%if %{gost}
Provides: %{name}-gost-lib = %{version}-%{release}
%endif
%description
%description
Chromium is an open-source web browser, powered by WebKit (Blink).
Chromium is an open-source web browser, powered by WebKit (Blink).
%if %{gost}
%if %{with gost}
chromium-gost patches are integrated, this Chromium supports GOST TLS
Chromium GOST patches are integrated, this Chromium supports GOST TLS
if proprietary CryptoPro is installed.
if proprietary CryptoPro is installed.
%endif
%endif
@ -955,7 +974,7 @@ udev.
%prep
%prep
%setup -q -n chromium-%{version}
%setup -q -n chromium-%{version}
%if %{gost}
%if %{with gost}
rm -rf %{chromium_path_gost}
rm -rf %{chromium_path_gost}
mkdir -p %{chromium_path_gost}
mkdir -p %{chromium_path_gost}
tar -C %{chromium_path_gost} --strip 1 -xf %{SOURCE101}
tar -C %{chromium_path_gost} --strip 1 -xf %{SOURCE101}
@ -967,8 +986,8 @@ sed -i'' %{chromium_path_gost}/patch/chromium.patch \
-e 's/ (Chromium GOST)//g' \
-e 's/ (Chromium GOST)//g' \
-e 's/Chromium GOST/Chromium/g' \
-e 's/Chromium GOST/Chromium/g' \
-e 's/Chromium-Gost/Chromium/g' \
-e 's/Chromium-Gost/Chromium/g' \
-e 's/"chromium-gost"/"chromium-browser"/g' \
-e 's/"chromium-gost"/"chromium-browser-gost "/g' \
-e 's/"chromium-gost.desktop"/"chromium-browser.desktop"/g' \
-e 's/"chromium-gost.desktop"/"chromium-browser-gost .desktop"/g' \
-e 's/(%s; Chromium GOST)/(%s)/' \
-e 's/(%s; Chromium GOST)/(%s)/' \
--
--
# make backups before GOST patching
# make backups before GOST patching
@ -1175,7 +1194,7 @@ cp -a %{_includedir}/libusb-1.0/libusb.h third_party/libusb/src/libusb/libusb.h
%endif
%endif
# Hard code extra version
# Hard code extra version
sed -i 's/getenv("CHROME_VERSION_EXTRA")/"%{?gost: GOST TLS via CryptoPro}"/' chrome/common/channel_info_posix.cc
sed -i 's/getenv("CHROME_VERSION_EXTRA")/"%{?gost_build : GOST TLS via CryptoPro}"/' chrome/common/channel_info_posix.cc
# Fix hardcoded path in remoting code
# Fix hardcoded path in remoting code
sed -i 's|/opt/google/chrome-remote-desktop|%{crd_path}|g' remoting/host/setup/daemon_controller_delegate_linux.cc
sed -i 's|/opt/google/chrome-remote-desktop|%{crd_path}|g' remoting/host/setup/daemon_controller_delegate_linux.cc
@ -1435,7 +1454,9 @@ mkdir -p %{builddir} && cp -a %{_bindir}/gn %{builddir}/
%build_target %{builddir} chrome
%build_target %{builddir} chrome
%build_target %{builddir} chrome_sandbox
%build_target %{builddir} chrome_sandbox
%if %{build_chromedriver}
%build_target %{builddir} chromedriver
%build_target %{builddir} chromedriver
%endif
%build_target %{builddir} libffmpeg.so
%build_target %{builddir} libffmpeg.so
%if %{build_clear_key_cdm}
%if %{build_clear_key_cdm}
@ -1474,12 +1495,12 @@ sed -i "s|@@BUILD_TARGET@@|$BUILD_TARGET|g" %{buildroot}%{chromium_path}/%{chrom
sed -i "s|@@CHROMIUM_PATH@@|$CHROMIUM_PATH|g" %{buildroot}%{chromium_path}/%{chromium_browser_channel}.sh
sed -i "s|@@CHROMIUM_PATH@@|$CHROMIUM_PATH|g" %{buildroot}%{chromium_path}/%{chromium_browser_channel}.sh
sed -i "s|@@CHROMIUM_BROWSER_CHANNEL@@|$CHROMIUM_BROWSER_CHANNEL|g" %{buildroot}%{chromium_path}/%{chromium_browser_channel}.sh
sed -i "s|@@CHROMIUM_BROWSER_CHANNEL@@|$CHROMIUM_BROWSER_CHANNEL|g" %{buildroot}%{chromium_path}/%{chromium_browser_channel}.sh
%if "%{chromium_channel}" == "%{nil}"
%if %{chromium_channel}" == "-beta" || %{chromium_channel}" == "-dev"
sed -i "s|@@EXTRA_FLAGS@@||g" %{buildroot}%{chromium_path}/%{chromium_browser_channel}.sh
%else
# Enable debug outputs for beta and dev channels
# Enable debug outputs for beta and dev channels
export EXTRA_FLAGS="--enable-logging=stderr --v=2"
export EXTRA_FLAGS="--enable-logging=stderr --v=2"
sed -i "s|@@EXTRA_FLAGS@@|$EXTRA_FLAGS|g" %{buildroot}%{chromium_path}/%{chromium_browser_channel}.sh
sed -i "s|@@EXTRA_FLAGS@@|$EXTRA_FLAGS|g" %{buildroot}%{chromium_path}/%{chromium_browser_channel}.sh
%else
sed -i "s|@@EXTRA_FLAGS@@||g" %{buildroot}%{chromium_path}/%{chromium_browser_channel}.sh
%endif
%endif
ln -s ../..%{chromium_path}/%{chromium_browser_channel}.sh %{buildroot}%{_bindir}/%{chromium_browser_channel}
ln -s ../..%{chromium_path}/%{chromium_browser_channel}.sh %{buildroot}%{_bindir}/%{chromium_browser_channel}
@ -1523,9 +1544,11 @@ pushd %{builddir}
%endif
%endif
%endif
%endif
%if %{build_chromedriver}
# chromedriver
# chromedriver
cp -a chromedriver %{buildroot}%{chromium_path}/chromedriver
cp -a chromedriver %{buildroot}%{chromium_path}/chromedriver
ln -s ../..%{chromium_path}/chromedriver %{buildroot}%{_bindir}/chromedriver
ln -s ../..%{chromium_path}/chromedriver %{buildroot}%{_bindir}/chromedriver
%endif
%if %{build_remoting}
%if %{build_remoting}
# Remote desktop bits
# Remote desktop bits
@ -1590,7 +1613,7 @@ popd
# need to strip binaries explicitly when debug is disable
# need to strip binaries explicitly when debug is disable
%if ! %{enable_debug}
%if ! %{enable_debug}
pushd %{buildroot}%{chromium_path}/
pushd %{buildroot}%{chromium_path}/
for f in *.so chrome_crashpad_handler chrome-sandbox chromium-browser headless_shell chromedriver ; do
for f in *.so chrome_crashpad_handler chrome-sandbox chromium-browser headless_shell %{?build_ chromedriver: chromedriver} ; do
[ -f $f ] && strip $f
[ -f $f ] && strip $f
done
done
popd
popd
@ -1603,6 +1626,10 @@ mkdir -p %{buildroot}%{_sysconfdir}/chromium/policies/recommended
cp -a out/Release/gen/chrome/app/policy/common/html/en-US/*.html .
cp -a out/Release/gen/chrome/app/policy/common/html/en-US/*.html .
cp -a out/Release/gen/chrome/app/policy/linux/examples/chrome.json .
cp -a out/Release/gen/chrome/app/policy/linux/examples/chrome.json .
%if %{with gost}
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/
tar xavf %{SOURCE103} -C %{buildroot}%{_datadir}/icons/hicolor/
%else
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/256x256/apps
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/256x256/apps
cp -a chrome/app/theme/chromium/product_logo_256.png %{buildroot}%{_datadir}/icons/hicolor/256x256/apps/%{chromium_browser_channel}.png
cp -a chrome/app/theme/chromium/product_logo_256.png %{buildroot}%{_datadir}/icons/hicolor/256x256/apps/%{chromium_browser_channel}.png
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/128x128/apps
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/128x128/apps
@ -1613,6 +1640,7 @@ mkdir -p %{buildroot}%{_datadir}/icons/hicolor/48x48/apps
cp -a chrome/app/theme/chromium/product_logo_48.png %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/%{chromium_browser_channel}.png
cp -a chrome/app/theme/chromium/product_logo_48.png %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/%{chromium_browser_channel}.png
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/24x24/apps
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/24x24/apps
cp -a chrome/app/theme/chromium/product_logo_24.png %{buildroot}%{_datadir}/icons/hicolor/24x24/apps/%{chromium_browser_channel}.png
cp -a chrome/app/theme/chromium/product_logo_24.png %{buildroot}%{_datadir}/icons/hicolor/24x24/apps/%{chromium_browser_channel}.png
%endif
# Install the master_preferences file
# Install the master_preferences file
install -m 0644 %{SOURCE11} %{buildroot}%{_sysconfdir}/%{name}/
install -m 0644 %{SOURCE11} %{buildroot}%{_sysconfdir}/%{name}/
@ -1795,14 +1823,16 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt
/var/lib/chrome-remote-desktop/
/var/lib/chrome-remote-desktop/
%endif
%endif
%if %{build_chromedriver}
%files -n chromedriver
%files -n chromedriver
%doc AUTHORS
%doc AUTHORS
%license LICENSE
%license LICENSE
%{_bindir}/chromedriver
%{_bindir}/chromedriver
%{chromium_path}/chromedriver
%{chromium_path}/chromedriver
%endif
%changelog
%changelog
* Sat Nov 25 2023 Arkady L. Shane <tigro@msvsphere-os.ru> - 119.0.6045.159-1.inferit.gost
* Sat Nov 25 2023 Arkady L. Shane <tigro@msvsphere-os.ru> - 119.0.6045.159-1.inferit
- Apply GOST patches
- Apply GOST patches
* Mon Nov 20 2023 Arkady L. Shane <tigro@msvsphere-os.ru> - 119.0.6045.159-1.inferit
* Mon Nov 20 2023 Arkady L. Shane <tigro@msvsphere-os.ru> - 119.0.6045.159-1.inferit