From e00946054d75a141f2e308f7e57bb92d4c8ea48348802213b03337f0cb8ad9f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Wed, 20 May 2020 11:28:27 +0000 Subject: [PATCH] Accepting request 807600 from home:pgajdos:python submit OBS-URL: https://build.opensuse.org/request/show/807600 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pdfminer.six?expand=0&rev=3 --- python-pdfminer.six.changes | 5 +++++ python-pdfminer.six.spec | 26 ++++++++++++++++++++------ 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/python-pdfminer.six.changes b/python-pdfminer.six.changes index 57d8410..732ba81 100644 --- a/python-pdfminer.six.changes +++ b/python-pdfminer.six.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed May 20 07:26:10 UTC 2020 - Petr Gajdos + +- %python3_only -> %python_alternative + ------------------------------------------------------------------- Thu Feb 13 19:29:31 UTC 2020 - Martin Hauke diff --git a/python-pdfminer.six.spec b/python-pdfminer.six.spec index 5cc97a7..197b2a3 100644 --- a/python-pdfminer.six.spec +++ b/python-pdfminer.six.spec @@ -1,7 +1,7 @@ # # spec file for package python-pdfminer.six # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,7 +12,9 @@ # 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/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define skip_python2 1 @@ -24,17 +26,19 @@ 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 BuildRequires: %{python_module chardet} +BuildRequires: %{python_module nose} BuildRequires: %{python_module pycryptodome} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module six} BuildRequires: %{python_module sortedcontainers} -BuildRequires: %{python_module nose} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-chardet Requires: python-pycryptodome Requires: python-six Requires: python-sortedcontainers +Requires(post): update-alternatives +Requires(postun): update-alternatives Provides: python-pdfminer3k = %{version} Obsoletes: python-pdfminer3k < %{version} BuildArch: noarch @@ -55,7 +59,7 @@ of text analysis. %prep %setup -q -n pdfminer.six-%{version} sed -i -e '/^#!\//, 1d' pdfminer/psparser.py -sed -i '1i #!/usr/bin/python3' tools/dumppdf.py tools/pdf2txt.py +sed -i '1i #!%{_bindir}/python3' tools/dumppdf.py tools/pdf2txt.py %build %python_build @@ -66,15 +70,25 @@ sed -i '1i #!/usr/bin/python3' tools/dumppdf.py tools/pdf2txt.py mv %{buildroot}%{_bindir}/dumppdf.py %{buildroot}%{_bindir}/dumppdf mv %{buildroot}%{_bindir}/pdf2txt.py %{buildroot}%{_bindir}/pdf2txt +%python_clone -a %{buildroot}%{_bindir}/pdf2txt +%python_clone -a %{buildroot}%{_bindir}/dumppdf %check %python_expand nosetests-%{$python_bin_suffix} -v +%post +%python_install_alternative pdf2txt +%python_install_alternative dumppdf + +%postun +%python_uninstall_alternative pdf2txt +%python_uninstall_alternative dumppdf + %files %{python_files} %license LICENSE %doc README.md -%python3_only %{_bindir}/dumppdf -%python3_only %{_bindir}/pdf2txt +%python_alternative %{_bindir}/dumppdf +%python_alternative %{_bindir}/pdf2txt %{python_sitelib}/pdfminer* %changelog