Avoid hardcoding /usr in launcher scripts

This fixes the launcher scripts to work when thunderbird is built with a
prefix that is not /usr, such as is the case with flatpak builds when
it's built with prefix=/app.
This commit is contained in:
Kalev Lember 2019-02-21 13:45:05 +01:00
parent 1bb9684a5f
commit 832da56201
3 changed files with 14 additions and 9 deletions

View File

@ -9,4 +9,4 @@
if [ "$XDG_CURRENT_DESKTOP" == "GNOME" ]; then
export MOZ_ENABLE_WAYLAND=1
fi
exec /usr/bin/thunderbird "$@"
exec __PREFIX__/bin/thunderbird "$@"

View File

@ -10,12 +10,12 @@
MOZ_ARCH=$(uname -m)
case $MOZ_ARCH in
x86_64 | s390x | sparc64 )
MOZ_LIB_DIR="/usr/lib64"
SECONDARY_LIB_DIR="/usr/lib"
MOZ_LIB_DIR="__PREFIX__/lib64"
SECONDARY_LIB_DIR="__PREFIX__/lib"
;;
* )
MOZ_LIB_DIR="/usr/lib"
SECONDARY_LIB_DIR="/usr/lib64"
MOZ_LIB_DIR="__PREFIX__/lib"
SECONDARY_LIB_DIR="__PREFIX__/lib64"
;;
esac
@ -46,7 +46,7 @@ MOZ_LAUNCHER="$MOZ_DIST_BIN/thunderbird"
##
## Set MOZ_APP_LAUNCHER for gnome-session
##
export MOZ_APP_LAUNCHER="/usr/bin/thunderbird"
export MOZ_APP_LAUNCHER="__PREFIX__/bin/thunderbird"
##
## Disable the GNOME crash dialog, Moz has it's own

View File

@ -82,7 +82,7 @@
Summary: Mozilla Thunderbird mail/newsgroup client
Name: thunderbird
Version: 60.5.1
Release: 1%{?dist}
Release: 2%{?dist}
URL: http://www.mozilla.org/projects/thunderbird/
License: MPLv1.1 or GPLv2+ or LGPLv2+
Group: Applications/Internet
@ -486,9 +486,11 @@ desktop-file-install --vendor mozilla \
# set up the thunderbird start script
rm -f $RPM_BUILD_ROOT/%{_bindir}/thunderbird
%{__cat} %{SOURCE21} > $RPM_BUILD_ROOT%{_bindir}/thunderbird
%{__cat} %{SOURCE21} | %{__sed} -e 's,__PREFIX__,%{_prefix},g' > \
$RPM_BUILD_ROOT%{_bindir}/thunderbird
%{__chmod} 755 $RPM_BUILD_ROOT/%{_bindir}/thunderbird
%{__cat} %{SOURCE28} > %{buildroot}%{_bindir}/thunderbird-wayland
%{__cat} %{SOURCE28} | %{__sed} -e 's,__PREFIX__,%{_prefix},g' > \
%{buildroot}%{_bindir}/thunderbird-wayland
%{__chmod} 755 %{buildroot}%{_bindir}/thunderbird-wayland
# set up our default preferences
@ -678,6 +680,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
#===============================================================================
%changelog
* Thu Feb 21 2019 Kalev Lember <klember@redhat.com> - 60.5.1-2
- Avoid hardcoding /usr in launcher scripts
* Mon Feb 18 2019 Martin Stransky <stransky@redhat.com> - 60.5.1-1
- Update to 60.5.1