]>
Commit | Line | Data |
---|---|---|
563f246f JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without python2 # CPython 2.x module | |
b76d1556 | 4 | %bcond_with python3 # CPython 3.x module (built from python3-unicodedata2.spec) |
4463821f | 5 | %bcond_without tests # unit tests |
563f246f JB |
6 | |
7 | Summary: Unicodedata backport/updates to Python 2.x | |
8 | Summary(pl.UTF-8): Uaktualnienia danych Unicode dla Pythona 2.x | |
9 | Name: python-unicodedata2 | |
b76d1556 | 10 | # keep 13.x for python2 support |
4463821f JB |
11 | Version: 13.0.0.post2 |
12 | Release: 1 | |
563f246f JB |
13 | License: Apache v2.0 |
14 | Group: Libraries/Python | |
9b55e7da | 15 | #Source0Download: https://pypi.org/simple/unicodedata2/ |
563f246f | 16 | Source0: https://files.pythonhosted.org/packages/source/u/unicodedata2/unicodedata2-%{version}.tar.gz |
4463821f | 17 | # Source0-md5: 86e686b640c1893a81d57e1a0a2affb1 |
3dd049f1 | 18 | URL: https://pypi.org/project/unicodedata2/ |
563f246f JB |
19 | BuildRequires: rpm-pythonprov |
20 | BuildRequires: rpmbuild(macros) >= 1.714 | |
21 | %if %{with python2} | |
4463821f | 22 | BuildRequires: python-devel >= 1:2.7 |
563f246f JB |
23 | BuildRequires: python-setuptools |
24 | %endif | |
25 | %if %{with python3} | |
4463821f | 26 | BuildRequires: python3-devel >= 1:3.5 |
563f246f JB |
27 | BuildRequires: python3-setuptools |
28 | %endif | |
4463821f | 29 | Requires: python-libs >= 1:2.7 |
563f246f JB |
30 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
31 | ||
32 | %description | |
33 | Unicodedata backport/updates to Python 2.x. | |
34 | ||
35 | Additionally this module backports named aliases and named sequences | |
36 | support to Python 2. | |
37 | ||
38 | %description -l pl.UTF-8 | |
39 | Uaktualnienia danych Unicode dla Pythona 2.x. | |
40 | ||
41 | Dodatkowo ten moduł zawiera backport nazwanych aliasów i nazwanych | |
42 | sekwencji do Pythona 2. | |
43 | ||
44 | %package -n python3-unicodedata2 | |
45 | Summary: Unicodedata backport/updates to Python 3.x | |
46 | Summary(pl.UTF-8): Uaktualnienia danych Unicode dla Pythona 3.x | |
47 | Group: Libraries/Python | |
4463821f | 48 | Requires: python3-libs >= 1:3.5 |
563f246f JB |
49 | |
50 | %description -n python3-unicodedata2 | |
51 | Unicodedata backport/updates to Python 3.x. | |
52 | ||
53 | %description -n python3-unicodedata2 -l pl.UTF-8 | |
54 | Uaktualnienia danych Unicode dla Pythona 3.x. | |
55 | ||
56 | %prep | |
57 | %setup -q -n unicodedata2-%{version} | |
58 | ||
59 | %build | |
60 | %if %{with python2} | |
61 | %py_build | |
4463821f JB |
62 | |
63 | %if %{with tests} | |
64 | PYTHONPATH=$(echo $(pwd)/build-2/lib.*) \ | |
65 | %{__python} tests/test_unicodedata2.py | |
66 | %endif | |
563f246f JB |
67 | %endif |
68 | ||
69 | %if %{with python3} | |
70 | %py3_build | |
4463821f JB |
71 | |
72 | %if %{with tests} | |
73 | PYTHONPATH=$(echo $(pwd)/build-3/lib.*) \ | |
74 | %{__python3} tests/test_unicodedata2.py | |
75 | %endif | |
563f246f JB |
76 | %endif |
77 | ||
78 | %install | |
79 | rm -rf $RPM_BUILD_ROOT | |
80 | ||
81 | %if %{with python2} | |
82 | %py_install | |
83 | ||
84 | %py_postclean | |
85 | %endif | |
86 | ||
87 | %if %{with python3} | |
88 | %py3_install | |
89 | %endif | |
90 | ||
91 | %clean | |
92 | rm -rf $RPM_BUILD_ROOT | |
93 | ||
94 | %if %{with python2} | |
95 | %files | |
96 | %defattr(644,root,root,755) | |
4463821f | 97 | %doc CHANGELOG.md README.md |
563f246f JB |
98 | %attr(755,root,root) %{py_sitedir}/unicodedata2.so |
99 | %{py_sitedir}/unicodedata2-%{version}-py*.egg-info | |
100 | %endif | |
101 | ||
102 | %if %{with python3} | |
103 | %files -n python3-unicodedata2 | |
104 | %defattr(644,root,root,755) | |
4463821f | 105 | %doc CHANGELOG.md README.md |
563f246f JB |
106 | %attr(755,root,root) %{py3_sitedir}/unicodedata2.cpython-*.so |
107 | %{py3_sitedir}/unicodedata2-%{version}-py*.egg-info | |
108 | %endif |