# Conditional build:
%bcond_without python2 # CPython 2.x module
%bcond_without python3 # CPython 3.x module
+%bcond_without tests # unit tests
Summary: Unicodedata backport/updates to Python 2.x
Summary(pl.UTF-8): Uaktualnienia danych Unicode dla Pythona 2.x
Name: python-unicodedata2
-Version: 12.1.0
-Release: 3
+Version: 13.0.0.post2
+Release: 1
License: Apache v2.0
Group: Libraries/Python
#Source0Download: https://pypi.org/simple/unicodedata2/
Source0: https://files.pythonhosted.org/packages/source/u/unicodedata2/unicodedata2-%{version}.tar.gz
-# Source0-md5: a4d781b0d59a8cb9243d4a84aa10fbd9
+# Source0-md5: 86e686b640c1893a81d57e1a0a2affb1
URL: https://pypi.org/project/unicodedata2/
BuildRequires: rpm-pythonprov
BuildRequires: rpmbuild(macros) >= 1.714
%if %{with python2}
-BuildRequires: python-devel >= 2.0
+BuildRequires: python-devel >= 1:2.7
BuildRequires: python-setuptools
%endif
%if %{with python3}
-BuildRequires: python3-devel >= 1:3.2
+BuildRequires: python3-devel >= 1:3.5
BuildRequires: python3-setuptools
%endif
-Requires: python-libs >= 2.0
+Requires: python-libs >= 1:2.7
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
Summary: Unicodedata backport/updates to Python 3.x
Summary(pl.UTF-8): Uaktualnienia danych Unicode dla Pythona 3.x
Group: Libraries/Python
-Requires: python3-libs >= 1:3.2
+Requires: python3-libs >= 1:3.5
%description -n python3-unicodedata2
Unicodedata backport/updates to Python 3.x.
%build
%if %{with python2}
%py_build
+
+%if %{with tests}
+PYTHONPATH=$(echo $(pwd)/build-2/lib.*) \
+%{__python} tests/test_unicodedata2.py
+%endif
%endif
%if %{with python3}
%py3_build
+
+%if %{with tests}
+PYTHONPATH=$(echo $(pwd)/build-3/lib.*) \
+%{__python3} tests/test_unicodedata2.py
+%endif
%endif
%install
%if %{with python2}
%files
%defattr(644,root,root,755)
-%doc README.md
+%doc CHANGELOG.md README.md
%attr(755,root,root) %{py_sitedir}/unicodedata2.so
%{py_sitedir}/unicodedata2-%{version}-py*.egg-info
%endif
%if %{with python3}
%files -n python3-unicodedata2
%defattr(644,root,root,755)
-%doc README.md
+%doc CHANGELOG.md README.md
%attr(755,root,root) %{py3_sitedir}/unicodedata2.cpython-*.so
%{py3_sitedir}/unicodedata2-%{version}-py*.egg-info
%endif