14
0
Files
python-natsort/python-natsort.spec
Tomáš Chvátal b6b9934e01 Accepting request 611422 from home:apersaud:branches:devel:languages:python
- specfile:
  * added setuptools as a requirements
- update to version 5.3.2:
  * Fix bug that prevented install on old versions of setuptools.
  * Revert layout from src/natsort/ back to natsort/ to make user
    testing simpler.

OBS-URL: https://build.opensuse.org/request/show/611422
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-natsort?expand=0&rev=5
2018-05-23 07:16:11 +00:00

84 lines
2.5 KiB
RPMSpec

#
# spec file for package python-natsort
#
# 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/
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%bcond_without test
Name: python-natsort
Version: 5.3.2
Release: 0
Summary: Natural sorting in Python
License: MIT
Group: Development/Languages/Python
URL: https://github.com/SethMMorton/natsort
Source: https://files.pythonhosted.org/packages/source/n/natsort/natsort-%{version}.tar.gz
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: help2man
BuildRequires: python-rpm-macros
Requires: python-setuptools
Recommends: python-PyICU
Recommends: python-fastnumbers
BuildArch: noarch
%if %{with test}
BuildRequires: %{python_module hypothesis}
BuildRequires: %{python_module pytest-cov}
BuildRequires: %{python_module pytest}
BuildRequires: python-mock
BuildRequires: python-pathlib
%endif
%ifpython2
Requires: python-pathlib
%endif
%python_subpackages
%description
Natsort provides a function natsorted that helps sort lists
"naturally" ("naturally" is rather ill-defined, but in general it means
sorting based on meaning and not computer code point).
%prep
%setup -q -n natsort-%{version}
%build
%python_build
%install
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
export PYTHONPATH=%{buildroot}%{python3_sitelib}
help2man -o natsort.1 -N %{buildroot}%{_bindir}/natsort
install -Dm0644 natsort.1 %{buildroot}%{_mandir}/man1/natsort.1
%if %{with test}
%check
%{python_expand export PYTHONPATH=%{buildroot}%{$python_sitelib}
pytest-%{$python_bin_suffix}
}
%endif
%files %{python_files}
%license LICENSE
%doc README.rst
%python3_only %{_mandir}/man1/natsort.1%{ext_man}
%python3_only %{_bindir}/natsort
%{python_sitelib}/*
%changelog