Build the main Chromium as GOST-enabled instead of a separate package chromium-gost

This commit is contained in:
Mikhail Novosyolov 2019-09-22 14:11:43 +03:00
parent 8b4fc265c2
commit 580cf7fa19
2 changed files with 31 additions and 68 deletions

View file

@ -16,13 +16,7 @@
%define dont_fix_eol 1 %define dont_fix_eol 1
%define _disable_lto 1 %define _disable_lto 1
%if %{with gost}
%define crname chromium-gost
%define chromedriver chromedriver-gost
%else
%define crname chromium-browser %define crname chromium-browser
%define chromedriver chromedriver
%endif
%define _crdir %{_libdir}/%{crname} %define _crdir %{_libdir}/%{crname}
%define _src %{_topdir}/SOURCES %define _src %{_topdir}/SOURCES
@ -45,17 +39,10 @@
%define msspi_commit 11be3c144405ac712432d172bca2863545f81fea %define msspi_commit 11be3c144405ac712432d172bca2863545f81fea
%define _gostsourcedir %{_builddir}/chromium-gost %define _gostsourcedir %{_builddir}/chromium-gost
%if ! %{with gost}
Summary: A fast web browser based on the Blink engine Summary: A fast web browser based on the Blink engine
Name: chromium-browser-stable Name: chromium-browser-stable
Version: 77.0.3865.90 Version: 77.0.3865.90
Release: 1 Release: 2
%else
Summary: Chromium web-browser with patches to make GOST TLS work via CryptoPro
Name: chromium-gost
Version: 77.0.3865.90
Release: 1
%endif
License: BSD, LGPL License: BSD, LGPL
Group: Networking/WWW Group: Networking/WWW
Url: https://www.chromium.org/Home Url: https://www.chromium.org/Home
@ -246,6 +233,9 @@ This is the stable channel Chromium browser. It offers a rock solid
browser which is updated with features and fixes once they have been browser which is updated with features and fixes once they have been
thoroughly tested. thoroughly tested.
If you need support of GOST cryptography,
additionally install chromium-gost-libs package.
Note: If you are reverting from unstable to stable or beta channel, you may Note: If you are reverting from unstable to stable or beta channel, you may
experience tab crashes on startup. This crash only affects tabs restored experience tab crashes on startup. This crash only affects tabs restored
during the first launch due to a change in how tab state is stored. during the first launch due to a change in how tab state is stored.
@ -266,10 +256,6 @@ your profile before changing channels.
%{_crdir}/themes %{_crdir}/themes
%{_crdir}/default_apps %{_crdir}/default_apps
%{_crdir}/swiftshader %{_crdir}/swiftshader
%if %{with gost}
%{_crdir}/libgostssl.so
%{_crdir}/gostssl.so
%endif
%dir %{_crdir}/pepper %dir %{_crdir}/pepper
%{_datadir}/applications/*.desktop %{_datadir}/applications/*.desktop
%{_iconsdir}/hicolor/*/apps/chromium* %{_iconsdir}/hicolor/*/apps/chromium*
@ -282,42 +268,45 @@ then
fi fi
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
%if ! %{with gost} %if %{with gost}
%package -n chromium-browser %package -n chromium-gost-lib
Summary: A fast web browser based on the Blink engine Summary: Library to enable GOST TLS in Chromium browser via CryptoPro
Epoch: 1 Group: System/Libraries
Group: Networking/WWW Requires: %{name} = %{EVRD}
# No %%{EVRD}
Requires: %{name} = %{version}-%{release}
%description -n chromium-browser %description -n chromium-gost-lib
Chromium is a browser that combines a minimal design with sophisticated If you need to make TLS work with GOST cryptography in Chromium browser,
technology to make the web faster, safer, and easier. install this package and proprietary CryptoPro packages.
This is a transition package that installs the stable channel Chromium Chromium looks for libgostssl.so from this package, if it finds it,
browser. If you prefer the dev channel browser, install the then it dlopens it. CryptoPro's libcapi10.so and libcapi20.so are
chromium-browser-unstable package instead. loaded by libgostssl.so. All this allows to use GOST TLS encryption
via CryptoPro libraries which implement GOST TLS.
%files -n chromium-browser %files -n chromium-gost-lib
%{_crdir}/libgostssl.so
%{_crdir}/gostssl.so
# Symlink to chromium-browser
# Disabled to prevent conflicts with chromium-gost RPMs
#%%{_bindir}/chromium-gost
%endif %endif
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
%package -n %{chromedriver} %package -n chromedriver
Summary: WebDriver for Google Chrome/Chromium Summary: WebDriver for Google Chrome/Chromium
Group: Development/Other Group: Development/Other
# No %%{EVRD} Requires: %{name} = %{EVRD}
Requires: %{name} = %{version}-%{release}
%description -n %{chromedriver} %description -n chromedriver
WebDriver is an open source tool for automated testing of webapps across many WebDriver is an open source tool for automated testing of webapps across many
browsers. It provides capabilities for navigating to web pages, user input, browsers. It provides capabilities for navigating to web pages, user input,
JavaScript execution, and more. ChromeDriver is a standalone server which JavaScript execution, and more. ChromeDriver is a standalone server which
implements WebDriver's wire protocol for Chromium. It is being developed by implements WebDriver's wire protocol for Chromium. It is being developed by
members of the Chromium and WebDriver teams. members of the Chromium and WebDriver teams.
%files -n %{chromedriver} %files -n chromedriver
%doc LICENSE AUTHORS %doc LICENSE AUTHORS
%{_bindir}/%{chromedriver} %{_bindir}/chromedriver
%{_crdir}/chromedriver %{_crdir}/chromedriver
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
@ -822,10 +811,11 @@ install -m 0644 %{SOURCE31} %{buildroot}%{_sysconfdir}/%{crname}/
install -m0644 %{_gostsourcedir}/libgostssl.so %{buildroot}%{_crdir}/libgostssl.so install -m0644 %{_gostsourcedir}/libgostssl.so %{buildroot}%{_crdir}/libgostssl.so
# Compatibility symlink: it is named gostssl.so in other builds of Chromium-GOST # Compatibility symlink: it is named gostssl.so in other builds of Chromium-GOST
# but it is common to prefix libraries with "lib" # but it is common to prefix libraries with "lib"
( cd %{buildroot}%{_crdir}/ ; ln -s libgostssl.so gostssl.so ) ( cd %{buildroot}%{_crdir}/ && ln -s libgostssl.so gostssl.so )
mv %{buildroot}%{_bindir}/chromedriver %{buildroot}%{_bindir}/%{chromedriver} # Disabled to prevent conflicts with chromium-gost RPMs
#( cd %{buildroot}%{_bindir}/ && ln -s %{crname} chromium-gost )
# find all files # Find all files and process them (idea from ALT)
find %{buildroot}%{_crdir} -type f | find %{buildroot}%{_crdir} -type f |
while read f; do while read f; do
# resolve symlinks # resolve symlinks

View file

@ -1,27 +0,0 @@
[Desktop Entry]
Version=1.0
Name=Chromium-GOST Web Browser
Name[ru]=Браузер Chromium-ГОСТ
GenericName=Chromium-GOST Web Browser
GenericName[ru]=Браузер Chromium-ГОСТ
Comment=Web Browser with support of GOST cryptography
Comment[ru]=Веб-браузер Chromium с поддержкой ГОСТ-шифрования
Exec=chromium-gost %u
Icon=chromium-gost
Terminal=false
Type=Application
StartupWMClass=Chromium-browser
MimeType=application/x-extension-htm;application/x-extension-html;application/x-extension-shtml;application/x-extension-xht;application/x-extension-xhtml;application/xhtml+xml;text/html;x-scheme-handler/chrome;x-scheme-handler/ftp;x-scheme-handler/http;x-scheme-handler/https;
Categories=GTK;Network;WebBrowser;X-MandrivaLinux-Internet-WebBrowsers;X-MandrivaLinux-CrossDesktop;
Actions=new-window;new-private-window;
[Desktop Action new-window]
Name=New Window
Name[ru]=Новое окно
Exec=chromium-gost --new-window
[Desktop Action new-private-window]
Name=New Incognito Window
Name[ru]=Новое окно в режиме инкогнито
Exec=chromium-gost --incognito