Generate distribution.ini using /etc/os-release values

Resolves: RHEL-61139
This commit is contained in:
Andrew Lukoshko 2024-10-01 10:01:06 +00:00 committed by Eike Rathke
parent de9215e1e0
commit fef2701ad5
3 changed files with 15 additions and 18 deletions

View File

@ -1,9 +0,0 @@
[Global]
id=redhat
version=1.0
about=Mozilla Firefox for Red Hat Enterprise Linux
[Preferences]
app.distributor=redhat
app.distributor.channel=redhat
app.partner.redhat=redhat

9
distribution.ini.in Normal file
View File

@ -0,0 +1,9 @@
[Global]
id=__ID__
version=1.0
about=Mozilla Firefox for __NAME__
[Preferences]
app.distributor=__ID__
app.distributor.channel=__ID__
app.partner.__ID__=__ID__

View File

@ -179,7 +179,7 @@ Source21: firefox.sh.in
Source23: firefox.1 Source23: firefox.1
Source24: mozilla-api-key Source24: mozilla-api-key
Source25: firefox-symbolic.svg Source25: firefox-symbolic.svg
Source26: distribution.ini Source26: distribution.ini.in
Source27: google-api-key Source27: google-api-key
Source30: firefox-x11.sh.in Source30: firefox-x11.sh.in
Source31: firefox-x11.desktop Source31: firefox-x11.desktop
@ -1718,14 +1718,11 @@ ln -s %{_datadir}/myspell %{buildroot}%{mozappdir}/dictionaries
# Add distribution.ini # Add distribution.ini
%{__mkdir_p} %{buildroot}%{mozappdir}/distribution %{__mkdir_p} %{buildroot}%{mozappdir}/distribution
%{__cp} %{SOURCE26} %{buildroot}%{mozappdir}/distribution %{__sed} -e "s/__NAME__/%(source /etc/os-release; echo ${NAME})/g" \
-e "s/__ID__/%(source /etc/os-release; echo ${ID})/g" \
# CentOS -e "s/rhel/redhat/g" \
%if 0%{?centos} -e "s/Fedora.*/Fedora/g" \
%{__sed} -ie 's/redhat/centos/g' %{buildroot}%{mozappdir}/distribution %{SOURCE26} > %{buildroot}%{mozappdir}/distribution/distribution.ini
(source /etc/os-release; %{__sed} -ie 's/Red Hat Enterprise Linux/$NAME/' %{buildroot}%{mozappdir}/distribution)
cat %{buildroot}%{mozappdir}/distribution
%endif
# Install appdata file # Install appdata file
mkdir -p %{buildroot}%{_datadir}/metainfo mkdir -p %{buildroot}%{_datadir}/metainfo