2020-02-14 14:52:12 +00:00
|
|
|
#
|
|
|
|
# spec file for package python-pdfminer.six
|
|
|
|
#
|
2023-04-11 18:23:03 +00:00
|
|
|
# Copyright (c) 2023 SUSE LLC
|
2020-02-14 14:52:12 +00:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
2020-05-20 11:28:27 +00:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
2020-02-14 14:52:12 +00:00
|
|
|
|
2023-08-25 18:45:00 +00:00
|
|
|
%{?sle15_python_module_pythons}
|
2020-02-14 14:52:12 +00:00
|
|
|
Name: python-pdfminer.six
|
2020-09-08 18:34:28 +00:00
|
|
|
Version: 20200726
|
2020-02-14 14:52:12 +00:00
|
|
|
Release: 0
|
|
|
|
Summary: PDF parser and analyzer
|
|
|
|
License: MIT
|
|
|
|
URL: https://github.com/pdfminer/pdfminer.six
|
|
|
|
Source: https://github.com/pdfminer/pdfminer.six/archive/%{version}.tar.gz#/pdfminer.six-%{version}.tar.gz
|
2020-09-08 18:34:28 +00:00
|
|
|
# https://github.com/pdfminer/pdfminer.six/pull/489
|
|
|
|
Patch0: python-pdfminer.six-remove-nose.patch
|
2021-11-09 07:33:46 +00:00
|
|
|
Patch1: import-from-non-pythonpath-files.patch
|
2020-02-14 14:52:12 +00:00
|
|
|
BuildRequires: %{python_module chardet}
|
2020-09-08 18:34:28 +00:00
|
|
|
BuildRequires: %{python_module cryptography}
|
|
|
|
BuildRequires: %{python_module pytest}
|
2020-02-14 14:52:12 +00:00
|
|
|
BuildRequires: %{python_module setuptools}
|
|
|
|
BuildRequires: %{python_module sortedcontainers}
|
|
|
|
BuildRequires: fdupes
|
|
|
|
BuildRequires: python-rpm-macros
|
|
|
|
Requires: python-chardet
|
2020-09-08 18:34:28 +00:00
|
|
|
Requires: python-cryptography
|
2020-02-14 14:52:12 +00:00
|
|
|
Requires: python-sortedcontainers
|
2020-05-20 11:28:27 +00:00
|
|
|
Requires(post): update-alternatives
|
2021-11-09 07:33:46 +00:00
|
|
|
Requires(postun):update-alternatives
|
2020-02-14 14:52:12 +00:00
|
|
|
Provides: python-pdfminer3k = %{version}
|
|
|
|
Obsoletes: python-pdfminer3k < %{version}
|
|
|
|
BuildArch: noarch
|
|
|
|
%python_subpackages
|
|
|
|
|
|
|
|
%description
|
2023-04-11 18:23:03 +00:00
|
|
|
Pdfminer.six is a community maintained fork of the original PDFMiner. It
|
|
|
|
is a tool for extracting information from PDF documents. It focuses on
|
|
|
|
getting and analyzing text data. Pdfminer.six extracts the text from a
|
|
|
|
page directly from the sourcecode of the PDF. It can also be used to get
|
|
|
|
the exact location, font or color of the text.
|
2020-02-14 14:52:12 +00:00
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q -n pdfminer.six-%{version}
|
2021-11-09 07:33:46 +00:00
|
|
|
%autopatch -p1
|
2020-02-14 14:52:12 +00:00
|
|
|
sed -i -e '/^#!\//, 1d' pdfminer/psparser.py
|
2020-05-20 11:28:27 +00:00
|
|
|
sed -i '1i #!%{_bindir}/python3' tools/dumppdf.py tools/pdf2txt.py
|
2020-02-14 14:52:12 +00:00
|
|
|
|
|
|
|
%build
|
|
|
|
%python_build
|
|
|
|
|
|
|
|
%install
|
|
|
|
%python_install
|
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
|
|
|
|
|
|
|
mv %{buildroot}%{_bindir}/dumppdf.py %{buildroot}%{_bindir}/dumppdf
|
|
|
|
mv %{buildroot}%{_bindir}/pdf2txt.py %{buildroot}%{_bindir}/pdf2txt
|
2020-05-20 11:28:27 +00:00
|
|
|
%python_clone -a %{buildroot}%{_bindir}/pdf2txt
|
|
|
|
%python_clone -a %{buildroot}%{_bindir}/dumppdf
|
2020-02-14 14:52:12 +00:00
|
|
|
|
|
|
|
%check
|
2021-11-09 07:33:46 +00:00
|
|
|
%pytest
|
2020-02-14 14:52:12 +00:00
|
|
|
|
2020-05-20 11:28:27 +00:00
|
|
|
%post
|
|
|
|
%python_install_alternative pdf2txt
|
|
|
|
%python_install_alternative dumppdf
|
|
|
|
|
|
|
|
%postun
|
|
|
|
%python_uninstall_alternative pdf2txt
|
|
|
|
%python_uninstall_alternative dumppdf
|
|
|
|
|
2020-02-14 14:52:12 +00:00
|
|
|
%files %{python_files}
|
|
|
|
%license LICENSE
|
|
|
|
%doc README.md
|
2020-05-20 11:28:27 +00:00
|
|
|
%python_alternative %{_bindir}/dumppdf
|
|
|
|
%python_alternative %{_bindir}/pdf2txt
|
2020-02-14 14:52:12 +00:00
|
|
|
%{python_sitelib}/pdfminer*
|
|
|
|
|
|
|
|
%changelog
|