3 %bcond_without python2 # CPython 2.x module
4 %bcond_without python3 # CPython 3.x module
5 %bcond_without tests # unit tests
7 Summary: PyICU - Python 2 extension wrapping IBM's ICU C++ API
8 Summary(pl.UTF-8): PyICU - rozszerzenie Pythona 2 obudowujące API C++ biblioteki ICU firmy IBM
13 Group: Development/Languages/Python
14 #Source0Download: https://pypi.org/simple/PyICU/
15 Source0: https://files.pythonhosted.org/packages/source/P/PyICU/PyICU-%{version}.tar.gz
16 # Source0-md5: 9ea06979b28c132bca0df3cf26628704
17 Patch0: 0001-disable-failing-test.patch
18 URL: https://pypi.org/project/PyICU/
19 BuildRequires: libicu-devel >= 59
20 BuildRequires: libstdc++-devel >= 6:4.7
22 BuildRequires: python-devel >= 1:2.3
23 BuildRequires: python-modules >= 1:2.3
25 BuildRequires: python-six
29 BuildRequires: python3-2to3 >= 1:3.2
30 BuildRequires: python3-devel >= 1:3.2
31 BuildRequires: python3-modules >= 1:3.2
33 BuildRequires: python3-six
36 BuildRequires: rpm-pythonprov
37 BuildRequires: rpmbuild(macros) >= 1.714
38 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41 PyICU is a Python extension wrapping IBM's ICU C++ API.
43 This package contains Python 2 module.
45 %description -l pl.UTF-8
46 PyICU to rozszerzenie Pythona obudowujące API C++ biblioteki ICU firmy
49 Ten pakiet zawiera moduł Pythona 2.
51 %package -n python3-pyicu
52 Summary: PyICU - Python 3 extension wrapping IBM's ICU C++ API
53 Summary(pl.UTF-8): PyICU - rozszerzenie Pythona 3 obudowujące API C++ biblioteki ICU firmy IBM
54 Group: Development/Languages/Python
56 %description -n python3-pyicu
57 PyICU is a Python extension wrapping IBM's ICU C++ API.
59 This package contains Python 3 module.
61 %description -n python3-pyicu -l pl.UTF-8
62 PyICU to rozszerzenie Pythona obudowujące API C++ biblioteki ICU firmy
65 Ten pakiet zawiera moduł Pythona 3.
68 %setup -q -n PyICU-%{version}
72 # uses ICU C++ API, which (in case if icu 59+) needs char16_t as distinct type, i.e. C++ 11
73 CFLAGS="%{rpmcxxflags} %{rpmcppflags} -std=c++11"
78 # tests need module already built
79 %{?with_tests:PYTHONPATH=$(pwd)/$(echo build-2/lib.*) %{__python} -m unittest discover -s test}
85 # tests to be 2to3'ed (by setup) and module already built
86 %{?with_tests:PYTHONPATH=$(pwd)/$(echo build-3/lib.*) %{__python3} -m unittest discover -s test}
90 rm -rf $RPM_BUILD_ROOT
102 rm -rf $RPM_BUILD_ROOT
106 %defattr(644,root,root,755)
107 %doc CHANGES CREDITS LICENSE README.md
108 %dir %{py_sitedir}/icu
109 %{py_sitedir}/icu/__init__.py[co]
110 %attr(755,root,root) %{py_sitedir}/icu/_icu_.so
111 %if "%{py_ver}" > "2.4"
112 %{py_sitedir}/PyICU-%{version}-py*.egg-info
117 %files -n python3-pyicu
118 %defattr(644,root,root,755)
119 %doc CHANGES CREDITS LICENSE README.md
120 %dir %{py3_sitedir}/icu
121 %{py3_sitedir}/icu/__init__.py
122 %{py3_sitedir}/icu/__pycache__
123 %attr(755,root,root) %{py3_sitedir}/icu/_icu_.cpython-*.so
124 %{py3_sitedir}/PyICU-%{version}-py*.egg-info