Adjust the build for Flatpak

An Evince Flatpak from this RPM cannot:
 * bundle texlive
 * install systemd unit service
 * install/require nautilus extension
This commit is contained in:
Felipe Borges 2019-04-03 13:04:00 +02:00
parent 1f8cc6fad9
commit 3aa7912252

View File

@ -6,7 +6,7 @@
Name: evince Name: evince
Version: 3.32.0 Version: 3.32.0
Release: 1%{?dist} Release: 2%{?dist}
Summary: Document viewer Summary: Document viewer
License: GPLv2+ and GPLv3+ and LGPLv2+ and MIT and Afmparse License: GPLv2+ and GPLv3+ and LGPLv2+ and MIT and Afmparse
@ -37,11 +37,13 @@ BuildRequires: yelp-tools
BuildRequires: /usr/bin/desktop-file-validate BuildRequires: /usr/bin/desktop-file-validate
BuildRequires: libappstream-glib-devel BuildRequires: libappstream-glib-devel
BuildRequires: gnome-common BuildRequires: gnome-common
%if ! 0%{?flatpak}
BuildRequires: pkgconfig(synctex) >= %{synctex_version} BuildRequires: pkgconfig(synctex) >= %{synctex_version}
# for the nautilus properties page # for the nautilus properties page
BuildRequires: pkgconfig(libnautilus-extension) BuildRequires: pkgconfig(libnautilus-extension)
# for the dvi backend # for the dvi backend
BuildRequires: texlive-lib-devel BuildRequires: texlive-lib-devel
%endif
%if 0%{?fedora} %if 0%{?fedora}
# for the djvu backend # for the djvu backend
BuildRequires: djvulibre-devel BuildRequires: djvulibre-devel
@ -104,6 +106,7 @@ Requires: %{name}-libs%{?_isa} = %{version}-%{release}
This package contains a backend to let evince display djvu files. This package contains a backend to let evince display djvu files.
%endif %endif
%if ! 0%{?flatpak}
%package nautilus %package nautilus
Summary: Evince extension for nautilus Summary: Evince extension for nautilus
Requires: %{name}%{?_isa} = %{version}-%{release} Requires: %{name}%{?_isa} = %{version}-%{release}
@ -112,7 +115,7 @@ Requires: nautilus%{?_isa}
%description nautilus %description nautilus
This package contains the evince extension for the nautilus file manager. This package contains the evince extension for the nautilus file manager.
It adds an additional tab called "Document" to the file properties dialog. It adds an additional tab called "Document" to the file properties dialog.
%endif
%prep %prep
%autosetup -p1 %autosetup -p1
@ -132,7 +135,10 @@ autoreconf -f -i
%endif %endif
--enable-xps=yes \ --enable-xps=yes \
--enable-t1lib=no \ --enable-t1lib=no \
%if 0%{?flatpak}
--without-systemduserunitdir \ --without-systemduserunitdir \
--disable-nautilus \
%endif
--enable-ps=yes --enable-ps=yes
make %{?_smp_mflags} V=1 LIBTOOL=/usr/bin/libtool make %{?_smp_mflags} V=1 LIBTOOL=/usr/bin/libtool
@ -154,8 +160,10 @@ mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
# Get rid of static libs and .la files. # Get rid of static libs and .la files.
rm -f $RPM_BUILD_ROOT%{_libdir}/mozilla/plugins/*.la rm -f $RPM_BUILD_ROOT%{_libdir}/mozilla/plugins/*.la
rm -f $RPM_BUILD_ROOT%{_libdir}/mozilla/plugins/*.a rm -f $RPM_BUILD_ROOT%{_libdir}/mozilla/plugins/*.a
%if ! 0%{?flatpak}
rm -f $RPM_BUILD_ROOT%{_libdir}/nautilus/extensions-3.0/*.la rm -f $RPM_BUILD_ROOT%{_libdir}/nautilus/extensions-3.0/*.la
rm -f $RPM_BUILD_ROOT%{_libdir}/nautilus/extensions-3.0/*.a rm -f $RPM_BUILD_ROOT%{_libdir}/nautilus/extensions-3.0/*.a
%endif
rm -f $RPM_BUILD_ROOT%{_libdir}/evince/4/backends/*.la rm -f $RPM_BUILD_ROOT%{_libdir}/evince/4/backends/*.la
rm -f $RPM_BUILD_ROOT%{_libdir}/evince/4/backends/*.a rm -f $RPM_BUILD_ROOT%{_libdir}/evince/4/backends/*.a
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
@ -181,6 +189,9 @@ desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/org.gnome.Evince-p
%{_datadir}/GConf/gsettings/evince.convert %{_datadir}/GConf/gsettings/evince.convert
%{_datadir}/metainfo/org.gnome.Evince.appdata.xml %{_datadir}/metainfo/org.gnome.Evince.appdata.xml
%{_datadir}/thumbnailers/evince.thumbnailer %{_datadir}/thumbnailers/evince.thumbnailer
%if ! 0%{?flatpak}
%{_userunitdir}/org.gnome.Evince.service
%endif
%files libs %files libs
%doc NEWS AUTHORS %doc NEWS AUTHORS
@ -228,10 +239,12 @@ desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/org.gnome.Evince-p
%{_datadir}/gir-1.0/EvinceDocument-3.0.gir %{_datadir}/gir-1.0/EvinceDocument-3.0.gir
%{_datadir}/gir-1.0/EvinceView-3.0.gir %{_datadir}/gir-1.0/EvinceView-3.0.gir
%if ! 0%{?flatpak}
%files dvi %files dvi
%{_libdir}/evince/4/backends/libdvidocument.so* %{_libdir}/evince/4/backends/libdvidocument.so*
%{_libdir}/evince/4/backends/dvidocument.evince-backend %{_libdir}/evince/4/backends/dvidocument.evince-backend
%{_datadir}/metainfo/evince-dvidocument.metainfo.xml %{_datadir}/metainfo/evince-dvidocument.metainfo.xml
%endif
%if 0%{?fedora} %if 0%{?fedora}
%files djvu %files djvu
@ -240,10 +253,15 @@ desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/org.gnome.Evince-p
%{_datadir}/metainfo/evince-djvudocument.metainfo.xml %{_datadir}/metainfo/evince-djvudocument.metainfo.xml
%endif %endif
%if ! 0%{?flatpak}
%files nautilus %files nautilus
%{_libdir}/nautilus/extensions-3.0/libevince-properties-page.so %{_libdir}/nautilus/extensions-3.0/libevince-properties-page.so
%endif
%changelog %changelog
* Thu Apr 04 2019 Felipe Borges <feborges@redhat.com> - 3.32.0-2
* Make the Evince RPM buildable as a Flatpak
* Thu Mar 14 2019 Kalev Lember <klember@redhat.com> - 3.32.0-1 * Thu Mar 14 2019 Kalev Lember <klember@redhat.com> - 3.32.0-1
- Update to 3.32.0 - Update to 3.32.0