File xreader.spec of Package xreader

#
# spec file for package xreader
#
# Copyright (c) 2017 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 sover   3
%define typelib1 typelib-1_0-XreaderDocument-1_5
%define typelib2 typelib-1_0-XreaderView-1_5
Name:           xreader
Version:        1.6.2
Release:        0
Summary:        Document viewer for documents like PDF/PostScript
License:        GPL-2.0 AND LGPL-2.0
Group:          Productivity/Office/Other
Url:            https://github.com/linuxmint/xreader
Source:         https://github.com/linuxmint/%{name}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  gnome-common
BuildRequires:  libtiff-devel >= 3.6
BuildRequires:  pkgconfig
BuildRequires:  texlive-devel
BuildRequires:  update-desktop-files
BuildRequires:  yelp-tools
BuildRequires:  pkgconfig(ddjvuapi) >= 3.5.17
BuildRequires:  pkgconfig(gail-3.0)
BuildRequires:  pkgconfig(glib-2.0) >= 2.36.0
BuildRequires:  pkgconfig(gobject-introspection-1.0) >= 0.6
BuildRequires:  pkgconfig(gtk+-3.0) >= 3.14.0
BuildRequires:  pkgconfig(gtk+-unix-print-3.0)
BuildRequires:  pkgconfig(libgxps) >= 0.2.0
BuildRequires:  pkgconfig(libnemo-extension)
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.22.0
BuildRequires:  pkgconfig(sm) >= 1.0.0
BuildRequires:  pkgconfig(zlib)
Requires:       %{name}-backends = %{version}
Recommends:     %{name}-lang
%glib2_gsettings_schema_requires
%if 0%{?suse_version} > 1320 || (0%{?sle_version} > 120200 && 0%{?is_opensuse})
BuildRequires:  pkgconfig(libcaja-extension)
%endif
%if 0%{?suse_version} >= 1320 || (0%{?sle_version} >= 120100 && 0%{?is_opensuse})
BuildRequires:  pkgconfig(webkit2gtk-4.0) >= 2.4.3
%endif

%description
Xreader is a document viewer capable of displaying multiple and
single page document formats like PDF and Postscript.

%lang_package

%package -n libxreaderdocument%{sover}
Summary:        X-Apps Document Reader -- System Library
Group:          System/Libraries

%description -n libxreaderdocument%{sover}
Xreader is a document viewer capable of displaying multiple and
single page document formats like PDF and Postscript.

%package -n libxreaderview%{sover}
Summary:        X-Apps Document Reader -- System Library
Group:          System/Libraries

%description -n libxreaderview%{sover}
Xreader is a document viewer capable of displaying multiple and
single page document formats like PDF and Postscript.

%package -n %{typelib1}
Summary:        XReaderDocument -- Introspection Bindings
# typelib-1_0-XreaderDocument-1_5_0 was last used in openSUSE Leap 42.3.
Group:          System/Libraries
Provides:       typelib-1_0-XreaderDocument-1_5_0 = %{version}
Obsoletes:      typelib-1_0-XreaderDocument-1_5_0 < %{version}

%description -n %{typelib1}
Xreader is a document viewer capable of displaying multiple and
single page document formats like PDF and Postscript.

%package -n %{typelib2}
Summary:        XReaderView -- Introspection Bindings
# typelib-1_0-XreaderView-1_5_0 was last used in openSUSE Leap 42.3.
Group:          System/Libraries
Provides:       typelib-1_0-XreaderView-1_5_0 = %{version}
Obsoletes:      typelib-1_0-XreaderView-1_5_0 < %{version}

%description -n %{typelib2}
Xreader is a document viewer capable of displaying multiple and
single page document formats like PDF and Postscript.

%package backends
Summary:        XReader shared libraries (View and Document)
Group:          System/Libraries

%description backends
Xreader is a document viewer capable of displaying multiple and
single page document formats like PDF and Postscript.

%package -n nemo-extension-%{name}
Summary:        X-Apps Document Reader file manager extension
Group:          Productivity/Office/Other
Requires:       %{name} = %{version}
Requires:       nemo
Recommends:     nemo-extension-sendto

%description -n nemo-extension-%{name}
Xreader is a document viewer capable of displaying multiple and
single page document formats like PDF and Postscript.

This package contains the xreader extension for the Nemo file
manager. It adds an additional tab called "Document" to the file
properties dialog.

%if 0%{?suse_version} > 1320 || (0%{?sle_version} > 120200 && 0%{?is_opensuse})
%package -n caja-extension-%{name}
Summary:        X-Apps Document Reader file manager extension
Group:          Productivity/Office/Other
Requires:       %{name} = %{version}
Requires:       caja
Recommends:     caja-extension-sendto

%description -n caja-extension-%{name}
Xreader is a document viewer capable of displaying multiple and
single page document formats like PDF and Postscript.

This package contains the xreader extension for the Caja file
manager. It adds an additional tab called "Document" to the file
properties dialog.
%endif

%package devel
Summary:        X-Apps Document Reader development files
Group:          Development/Libraries/C and C++
Requires:       %{name}-backends = %{version}
Requires:       %{typelib1} = %{version}
Requires:       %{typelib2} = %{version}

%description devel
Xreader is a document viewer capable of displaying multiple and
single page document formats like PDF and Postscript.

%prep
%setup -q

%build
NOCONFIGURE=1 gnome-autogen.sh
%configure \
  --disable-static                    \
  --libexecdir=%{_libexecdir}/%{name} \
%if 0%{?suse_version} <= 1320 && !(0%{?sle_version} > 120200 && 0%{?is_opensuse})
  --disable-caja                      \
%endif
  --enable-introspection              \
  --enable-gtk-doc
make %{?_smp_mflags} V=1

%install
%make_install
%find_lang %{name} %{?no_lang_C}
find %{buildroot} -type f -name "*.la" -delete -print
%suse_update_desktop_file -r %{name} GTK Office Viewer
%fdupes %{buildroot}%{_datadir}/

%post -n libxreaderview%{sover} -p /sbin/ldconfig

%postun -n libxreaderview%{sover} -p /sbin/ldconfig

%post -n libxreaderdocument%{sover} -p /sbin/ldconfig

%postun -n libxreaderdocument%{sover} -p /sbin/ldconfig

%if 0%{?suse_version} <= 1320
%post
%icon_theme_cache_post
%desktop_database_post
%mime_database_post
%glib2_gsettings_schema_post

%postun
%icon_theme_cache_post
%desktop_database_postun
%mime_database_postun
%glib2_gsettings_schema_post
%endif

%files
%doc AUTHORS COPYING README
%{_bindir}/%{name}
%{_bindir}/%{name}-previewer
%{_bindir}/%{name}-thumbnailer
%{_datadir}/%{name}/
%dir %{_libdir}/%{name}/
%dir %{_libdir}/%{name}/%{sover}/
%dir %{_libexecdir}/%{name}/
%{_libexecdir}/%{name}/%{name}*
%dir %{_datadir}/thumbnailers/
%{_datadir}/thumbnailers/%{name}.thumbnailer
%{_datadir}/dbus-1/services/*.service
%{_datadir}/glib-2.0/schemas/*.xml
%{_datadir}/help/C/%{name}/
%{_datadir}/applications/%{name}.desktop
%dir %{_datadir}/appdata/
%{_datadir}/appdata/%{name}.appdata.xml
%{_datadir}/icons/hicolor/*/*/*
%{_mandir}/man?/*.?%{?ext_man}

%files lang -f %{name}.lang

%files -n libxreaderview%{sover}
%doc AUTHORS COPYING README
%{_libdir}/libxreaderview.so.%{sover}*

%files -n libxreaderdocument%{sover}
%doc AUTHORS COPYING README
%{_libdir}/libxreaderdocument.so.%{sover}*

%files devel
%{_includedir}/%{name}/
%{_libdir}/*.so
%{_libdir}/pkgconfig/*.pc
%{_datadir}/gir-1.0/*.gir
%{_datadir}/gtk-doc/html/

%files -n nemo-extension-%{name}
%dir %{_datadir}/nemo/extensions/
%{_datadir}/nemo/extensions/libxreader-properties-page.nemo-extension
%{_libdir}/nemo/

%if 0%{?suse_version} > 1320 || (0%{?sle_version} > 120200 && 0%{?is_opensuse})
%files -n caja-extension-%{name}
%dir %{_datadir}/caja/extensions/
%{_datadir}/caja/extensions/libxreader-properties-page.caja-extension
%{_libdir}/caja/
%endif

%files -n %{typelib1}
%{_libdir}/girepository-1.0/XreaderDocument-1.5.typelib

%files -n %{typelib2}
%{_libdir}/girepository-1.0/XreaderView-1.5.typelib

%files backends
%doc AUTHORS README COPYING
%{_libdir}/%{name}/%{sover}/backends/

%changelog
openSUSE Build Service is sponsored by