Add Flatpak wrapper and helper scripts

This commit is contained in:
Milan Crha 2019-07-15 18:35:28 +02:00
parent c9c5188faa
commit e1ade46049
3 changed files with 54 additions and 0 deletions

View File

@ -41,6 +41,8 @@ Summary: Mail and calendar client for GNOME
License: GPLv2+ and GFDL License: GPLv2+ and GFDL
URL: https://wiki.gnome.org/Apps/Evolution URL: https://wiki.gnome.org/Apps/Evolution
Source: http://download.gnome.org/sources/%{name}/3.33/%{name}-%{version}.tar.xz Source: http://download.gnome.org/sources/%{name}/3.33/%{name}-%{version}.tar.xz
Source1: flatpak-evolution-fix-service-names.sh
Source2: flatpak-evolution-wrapper.sh.in
### Patches ### ### Patches ###
@ -308,6 +310,13 @@ rm -rf $RPM_BUILD_ROOT
cd _build cd _build
make DESTDIR=$RPM_BUILD_ROOT install make DESTDIR=$RPM_BUILD_ROOT install
%if 0%{?flatpak}
%{S:1} <%{S:2} >flatpak-evolution-wrapper.sh
chmod a+x flatpak-evolution-wrapper.sh
mv $RPM_BUILD_ROOT%{_bindir}/evolution $RPM_BUILD_ROOT%{_bindir}/evolution.bin
cp flatpak-evolution-wrapper.sh $RPM_BUILD_ROOT%{_bindir}/evolution
%endif
%find_lang evolution --all-name --with-gnome %find_lang evolution --all-name --with-gnome
grep "%{_datadir}/locale" evolution.lang > translations.lang grep "%{_datadir}/locale" evolution.lang > translations.lang
@ -348,6 +357,10 @@ grep -v "%{_datadir}/locale" evolution.lang > help.lang
# The main executable # The main executable
%{_bindir}/evolution %{_bindir}/evolution
%if 0%{?flatpak}
%{_bindir}/evolution.bin
%endif
%{_datadir}/metainfo/org.gnome.Evolution.appdata.xml %{_datadir}/metainfo/org.gnome.Evolution.appdata.xml
# Desktop files: # Desktop files:

View File

@ -0,0 +1,10 @@
#!/bin/bash
# see https://gitlab.gnome.org/GNOME/glib/issues/1737
# previous versions used milliseconds instead of seconds as the timeout argument",
(`pkg-config --atleast-version 2.60.1 gio-2.0` || `pkg-config --atleast-version 2.61.0 gio-2.0`) && TIMEOUTMULT= || TIMEOUTMULT=000
sed -e "s|\@SOURCES_SERVICE\@|$(pkg-config --variable=sourcesdbusservicename evolution-data-server-1.2)|" \
-e "s|\@ADDRESSBOOK_SERVICE\@|$(pkg-config --variable=addressbookdbusservicename evolution-data-server-1.2)|" \
-e "s|\@CALENDAR_SERVICE\@|$(pkg-config --variable=calendardbusservicename evolution-data-server-1.2)|" \
-e "s|\@TIMEOUTMULT\@|${TIMEOUTMULT}|"

View File

@ -0,0 +1,31 @@
#!/bin/bash
if [ "$1" = "--quit" -o "$1" = "--force-shutdown" ]; then
/app/bin/evolution.bin "$@"
else
export BOGOFILTER_DIR="${XDG_DATA_HOME}/bogofilter/"
export GIO_USE_NETWORK_MONITOR=base
gsettings reset org.gnome.evolution-data-server network-monitor-gio-name
gpg-agent --homedir ~/.gnupg --daemon --pinentry-program=/app/bin/pinentry
LINES=$(gdbus call --session --dest org.freedesktop.DBus --object-path /org/freedesktop/DBus --method org.freedesktop.DBus.ListNames | grep @SOURCES_SERVICE@ | wc -l)
if [ "${LINES}" = "0" ]; then
/app/libexec/evolution-source-registry &
gdbus wait --session --timeout=1@TIMEOUTMULT@ @SOURCES_SERVICE@
fi
LINES=$(gdbus call --session --dest org.freedesktop.DBus --object-path /org/freedesktop/DBus --method org.freedesktop.DBus.ListNames | grep @ADDRESSBOOK_SERVICE@ | wc -l)
if [ "${LINES}" = "0" ]; then
/app/libexec/evolution-addressbook-factory -r &
gdbus wait --session --timeout=1@TIMEOUTMULT@ @ADDRESSBOOK_SERVICE@
fi
LINES=$(gdbus call --session --dest org.freedesktop.DBus --object-path /org/freedesktop/DBus --method org.freedesktop.DBus.ListNames | grep @CALENDAR_SERVICE@ | wc -l)
if [ "${LINES}" = "0" ]; then
/app/libexec/evolution-calendar-factory -r &
gdbus wait --session --timeout=1@TIMEOUTMULT@ @CALENDAR_SERVICE@
fi
/app/bin/evolution.bin "$@"
fi