File evince.spec of Package evince.11494

#
# spec file for package evince
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


%define _major_version 3.0
%define pluginAPI 4

Name:           evince
Version:        3.26.0+20180128.1bd86963
Release:        0
Summary:        GNOME Document Viewer
License:        GPL-2.0+
Group:          Productivity/Office/Other
Url:            http://www.gnome.org/projects/evince/

#Source0:       http://download.gnome.org/sources/evince/3.26/%%{name}-%%{version}.tar.xz
Source:         %{name}-%{version}.tar.xz
# PATCH-FIX-UPSTREAM libdocument-return-96-dpi-if-unable-to-determine.patch bsc#1066138 bgo#719400 yfjiang@suse.com -- fix the broken zoom in/out when graphic backend does not return proper dpi
Patch1:         libdocument-return-96-dpi-if-unable-to-determine.patch
# PATCH-FIX-UPSTREAM CVE-2019-11459.patch boo#1122607 mgorse@suse.com -- fix display of uninitialized memory if TiffReadRGBAImageOriented fails.
Patch2: CVE-2019-11459.patch

BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  ghostscript-fonts-std
BuildRequires:  ghostscript-x11
BuildRequires:  gnome-common
BuildRequires:  intltool
BuildRequires:  libtiff-devel
BuildRequires:  texlive-devel
BuildRequires:  translation-update-upstream
BuildRequires:  yelp-tools
BuildRequires:  pkgconfig(adwaita-icon-theme) >= 2.17.1
BuildRequires:  pkgconfig(ddjvuapi) >= 3.5.22
BuildRequires:  pkgconfig(gio-2.0) >= 2.36.0
BuildRequires:  pkgconfig(gio-unix-2.0)
BuildRequires:  pkgconfig(gnome-desktop-3.0)
BuildRequires:  pkgconfig(gobject-introspection-1.0) >= 0.6
BuildRequires:  pkgconfig(gstreamer-1.0)
BuildRequires:  pkgconfig(gstreamer-base-1.0)
BuildRequires:  pkgconfig(gstreamer-video-1.0)
BuildRequires:  pkgconfig(gthread-2.0)
BuildRequires:  pkgconfig(gtk+-3.0) >= 3.16.0
BuildRequires:  pkgconfig(ice)
BuildRequires:  pkgconfig(libarchive) >= 3.1.2
BuildRequires:  pkgconfig(libgxps) >= 0.2.1
BuildRequires:  pkgconfig(libnautilus-extension) >= 2.91.4
BuildRequires:  pkgconfig(libsecret-1) >= 0.5
BuildRequires:  pkgconfig(libspectre) >= 0.2.0
BuildRequires:  pkgconfig(libxml-2.0) >= 2.5.0
BuildRequires:  pkgconfig(poppler-glib) >= 0.33.0
BuildRequires:  pkgconfig(sm) >= 1.0.0
BuildRequires:  pkgconfig(x11)
BuildRequires:  pkgconfig(zlib)
Recommends:     %{name}-lang
# Disable the browser plugin and package, and make main package provide-obsolete plugin package for upgrade; see bgo#738270
Provides:       evince-browser-plugin
Obsoletes:      evince-browser-plugin
%{glib2_gsettings_schema_requires}

%description
Evince is a document viewer capable of displaying multiple and
singlepage document formats like PDF and PostScript.

%package -n libevdocument3-4
Summary:        GNOME Document Viewer - System Library
Group:          System/Libraries

%description -n libevdocument3-4
Evince is a document viewer capable of displaying multiple and
singlepage document formats like PDF and PostScript.

%package -n libevview3-3
Summary:        GNOME Document Viewer - System Library
Group:          System/Libraries

%description -n libevview3-3
Evince is a document viewer capable of displaying multiple and
singlepage document formats like PDF and PostScript.

%package -n typelib-1_0-EvinceDocument-3_0
Summary:        GNOME Document Viewer -- Introspection bindings
Group:          System/Libraries

%description -n typelib-1_0-EvinceDocument-3_0
Evince is a document viewer capable of displaying multiple and
singlepage document formats like PDF and PostScript.

%package -n typelib-1_0-EvinceView-3_0
Summary:        GNOME Document Viewer -- Introspection bindings
Group:          System/Libraries

%description -n typelib-1_0-EvinceView-3_0
Evince is a document viewer capable of displaying multiple and
singlepage document formats like PDF and PostScript.

%package devel
Summary:        GNOME Document Viewer
Group:          Development/Languages/C and C++
Requires:       %{name} = %{version}
Requires:       libevdocument3-4 = %{version}
Requires:       libevview3-3 = %{version}
Requires:       typelib-1_0-EvinceDocument-3_0 = %{version}
Requires:       typelib-1_0-EvinceView-3_0 = %{version}

%description devel
Evince is a document viewer capable of displaying multiple and
singlepage document formats like PDF and PostScript.

%package browser-plugin
Summary:        Browser Plugin Based on Evince
Group:          Productivity/Office/Other
Requires:       %{name} = %{version}
Supplements:    packageand(%{name}:MozillaFirefox)

%description browser-plugin
Evince is a document viewer capable of displaying multiple and
singlepage document formats like PDF and PostScript.

%package -n nautilus-evince
Summary:        Evince Plugin for Nautilus
Group:          Productivity/Office/Other
Requires:       %{name} = %{version}
# For "send to" action; the action will be hidden if nautilus-sendto is not available
Recommends:     nautilus-sendto
Supplements:    packageand(evince:nautilus)

%description -n nautilus-evince
Evince is a document viewer capable of displaying multiple and
singlepage document formats like PDF and PostScript.

This package contains a plugin to integrate Evince into Nautilus.

%package -n evince-plugin-comicsdocument
Summary:        Evince - comics document support
Group:          Productivity/Office/Other
Requires:       %{name}
Enhances:       %{name}

%description -n evince-plugin-comicsdocument
Add comics document support to Evince

%package -n evince-plugin-djvudocument
Summary:        Evince - DjVu document support
Group:          Productivity/Office/Other
Requires:       %{name}
Enhances:       %{name}

%description -n evince-plugin-djvudocument
Add DjVu document support to Evince

%package -n evince-plugin-dvidocument
Summary:        Evince - DVI document support
Group:          Productivity/Office/Other
Requires:       %{name}
Enhances:       %{name}

%description -n evince-plugin-dvidocument
Add DVI document support to Evince

%package -n evince-plugin-pdfdocument
Summary:        Evince - PDF document support
Group:          Productivity/Office/Other
Requires:       %{name}
Supplements:    %{name}

%description -n evince-plugin-pdfdocument
Add PDF document support to Evince

%package -n evince-plugin-psdocument
Summary:        Evince - PS document support
Group:          Productivity/Office/Other
Requires:       %{name}

%description -n evince-plugin-psdocument
Add PostScript document support to Evince

%package -n evince-plugin-tiffdocument
Summary:        Evince - TIFF document support
Group:          Productivity/Office/Other
Requires:       %{name}
Enhances:       %{name}

%description -n evince-plugin-tiffdocument
Add TIFF document support to Evince

%package -n evince-plugin-xpsdocument
Summary:        Evince - XPS document support
Group:          Productivity/Office/Other
Requires:       %{name}
Enhances:       %{name}

%description -n evince-plugin-xpsdocument
Add XPS document support to Evince

%lang_package

%prep
%autosetup -p1
translation-update-upstream

%build
# on openSUSE, we share the browser plugins between browsers; do not use mozilla's default.
export BROWSER_PLUGIN_DIR=%{_libdir}/browser-plugins
NOCONFIGURE=1 ./autogen.sh
%configure \
	--disable-static \
	--with-pic \
	--libexecdir=%{_libexecdir}/%{name} \
	--enable-djvu \
	--enable-dvi \
	--enable-comics \
	--enable-nautilus \
	--enable-introspection \
	--enable-multimedia \
	--disable-browser-plugin \
	--enable-gtk-doc \
	%{nil}
%make_build

%install
%make_install
%find_lang %{name} %{?no_lang_C} --metainfo %{name}
find %{buildroot} -type f -name "*.la" -delete -print
%fdupes %{buildroot}/%{_prefix}

%post -n libevdocument3-4 -p /sbin/ldconfig
%postun -n libevdocument3-4 -p /sbin/ldconfig

%post -n libevview3-3 -p /sbin/ldconfig
%postun -n libevview3-3 -p /sbin/ldconfig

%files
%license COPYING
%doc %{_datadir}/help/C/%{name}/
%{_bindir}/*
%dir %{_datadir}/appdata
%{_datadir}/appdata/evince.appdata.xml
%{_datadir}/applications/*.desktop
%{_datadir}/dbus-1/services/org.gnome.evince.Daemon.service
%{_datadir}/evince
%{_datadir}/GConf/gsettings/evince.convert
%{_datadir}/glib-2.0/schemas/org.gnome.Evince.gschema.xml
%{_datadir}/icons/hicolor/*/apps/evince*.*
%dir %{_datadir}/thumbnailers
%{_datadir}/thumbnailers/evince.thumbnailer
# backends directory structure - backends go to their own packages
%dir %{_libdir}/evince/
%dir %{_libdir}/evince/%{pluginAPI}
%dir %{_libdir}/evince/%{pluginAPI}/backends
# helpers & daemon
%dir %{_libexecdir}/evince
%{_libexecdir}/evince/evinced
%doc %{_mandir}/man?/*.*
%{_userunitdir}/evince.service

%files lang -f %{name}.lang

#%%files browser-plugin
#%%defattr(-,root,root)
#%%{_libdir}/browser-plugins/libevbrowserplugin.so

%files -n libevdocument3-4
%{_libdir}/libevdocument3.so.4*

%files -n libevview3-3
%{_libdir}/libevview3.so.3*

%files -n typelib-1_0-EvinceDocument-3_0
%{_libdir}/girepository-1.0/EvinceDocument-3.0.typelib

%files -n typelib-1_0-EvinceView-3_0
%{_libdir}/girepository-1.0/EvinceView-3.0.typelib

%files devel
%{_includedir}/evince
%{_libdir}/*.so
%{_libdir}/pkgconfig/evince*.pc
%{_datadir}/gir-1.0/*.gir
%{_datadir}/gtk-doc/html/evince
%{_datadir}/gtk-doc/html/libevdocument-%{_major_version}
%{_datadir}/gtk-doc/html/libevview-%{_major_version}
# Own these repositories to not depend on gtk-doc while building:
%dir %{_datadir}/gtk-doc
%dir %{_datadir}/gtk-doc/html

%files -n nautilus-evince
%{_libdir}/nautilus/extensions-*/*.so

%files -n evince-plugin-comicsdocument
%{_datadir}/appdata/evince-comicsdocument.metainfo.xml
%{_libdir}/evince/%{pluginAPI}/backends/comicsdocument.evince-backend
%{_libdir}/evince/%{pluginAPI}/backends/libcomicsdocument.so

%files -n evince-plugin-djvudocument
%{_datadir}/appdata/evince-djvudocument.metainfo.xml
%{_libdir}/evince/%{pluginAPI}/backends/djvudocument.evince-backend
%{_libdir}/evince/%{pluginAPI}/backends/libdjvudocument.so

%files -n evince-plugin-dvidocument
%{_datadir}/appdata/evince-dvidocument.metainfo.xml
%{_libdir}/evince/%{pluginAPI}/backends/dvidocument.evince-backend
%{_libdir}/evince/%{pluginAPI}/backends/libdvidocument.so

%files -n evince-plugin-pdfdocument
%{_datadir}/appdata/evince-pdfdocument.metainfo.xml
%{_libdir}/evince/%{pluginAPI}/backends/pdfdocument.evince-backend
%{_libdir}/evince/%{pluginAPI}/backends/libpdfdocument.so

%files -n evince-plugin-psdocument
%{_datadir}/appdata/evince-psdocument.metainfo.xml
%{_libdir}/evince/%{pluginAPI}/backends/psdocument.evince-backend
%{_libdir}/evince/%{pluginAPI}/backends/libpsdocument.so

%files -n evince-plugin-tiffdocument
%{_datadir}/appdata/evince-tiffdocument.metainfo.xml
%{_libdir}/evince/%{pluginAPI}/backends/tiffdocument.evince-backend
%{_libdir}/evince/%{pluginAPI}/backends/libtiffdocument.so

%files -n evince-plugin-xpsdocument
%{_datadir}/appdata/evince-xpsdocument.metainfo.xml
%{_libdir}/evince/%{pluginAPI}/backends/xpsdocument.evince-backend
%{_libdir}/evince/%{pluginAPI}/backends/libxpsdocument.so

%changelog