File python3-krop.spec of Package python3-krop

#
# spec file for package python3-krop
#
# 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/
#


Name:           python3-krop
Summary:        A simple graphical tool to crop the pages of PDF files
Version:        0.5.1
Release:        0
Url:            http://arminstraub.com/software/krop
Source:         https://github.com/arminstraub/krop/archive/v%{version}.tar.gz#/krop-%{version}.tar.gz
License:        GPL-3.0
Group:          Productivity/Publishing/PDF
Requires:       python3
Requires:       python3-PyPDF2
Requires:       python3-sip
Requires:       python3-qt5
Requires:       python-poppler-qt5
Recommends:     ghostscript
BuildRequires:  python3
BuildRequires:  update-desktop-files
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch

%description
krop is a simple graphical tool to crop the pages of PDF files.
  • The functionality of krop is perhaps best indicated by some screenshots.
  • krop should work on any recent Linux distribution, see how to install krop.
    I don't know if krop can be used on Windows or Mac after a sufficient amount
    of tinkering: please let me know in case you succeed.
  • It is written in Python and relies on PyQT, python-poppler-qt4 and pyPdf
    or PyPDF2 for its functionality.
  • It is free software, released under GPLv3+ in the sole hope that you or
    someone else may find it useful.
  • A unique feature of krop, at least to my knowledge, is its ability to
    automatically split pages into subpages to fit the limited screensize of
    devices such as eReaders. This is particularly useful, if your eReader does
    not support convenient scrolling. (In fact, I wrote krop to be able to read
    mathematical papers on my Nook.)
  • Possible alternatives to krop include PDF-Shuffler and briss.
  • Please report bugs to mail@arminstraub.com.
    Patches with improvements would, of course, be wonderful.

%prep
%setup -q -n krop-%{version}

%build
python3 setup.py build

%install
python3 setup.py install --prefix=%{_prefix} --root=%{buildroot}
install -D -m644 krop.desktop %{buildroot}%{_datadir}/applications/krop.desktop
install -D -m644 krop.appdata.xml %{buildroot}%{_datadir}/metainfo/krop.appdata.xml
install -D -m644 krop.1 %{buildroot}%{_mandir}/man1/krop.1

%suse_update_desktop_file -r krop Office Viewer

%if 0%{?suse_version} < 1500
%post
%desktop_database_post

%postun
%desktop_database_postun
%endif

%files
%defattr(-,root,root)
%doc ChangeLog README.md TODO
%license LICENSE
%{_bindir}/krop
%{_datadir}/applications/krop.desktop
%dir %{_datadir}/metainfo
%{_datadir}/metainfo/krop.appdata.xml
%{_mandir}/man1/krop.1.gz
%{python3_sitelib}/*

%changelog