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 Source0: https://pypi.python.org/packages/bc/78/f4e26f67c9b6b9074baa576ae67947e42fb86039199a65e9ab91ddb51d26/PyICU-%{version}.tar.gz
15 # Source0-md5: bb7838411ba9c7363503745220c754e9
16 URL: https://pypi.python.org/pypi/PyICU
17 BuildRequires: libicu-devel >= 59
18 BuildRequires: libstdc++-devel >= 6:4.7
20 BuildRequires: python-devel >= 1:2.3
21 BuildRequires: python-modules >= 1:2.3
24 BuildRequires: python3-2to3 >= 1:3.2
25 BuildRequires: python3-devel >= 1:3.2
26 BuildRequires: python3-modules >= 1:3.2
28 BuildRequires: rpm-pythonprov
29 BuildRequires: rpmbuild(macros) >= 1.714
30 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33 PyICU is a Python extension wrapping IBM's ICU C++ API.
35 This package contains Python 2 module.
37 %description -l pl.UTF-8
38 PyICU to rozszerzenie Pythona obudowujące API C++ biblioteki ICU firmy
41 Ten pakiet zawiera moduł Pythona 2.
43 %package -n python3-pyicu
44 Summary: PyICU - Python 3 extension wrapping IBM's ICU C++ API
45 Summary(pl.UTF-8): PyICU - rozszerzenie Pythona 3 obudowujące API C++ biblioteki ICU firmy IBM
46 Group: Development/Languages/Python
48 %description -n python3-pyicu
49 PyICU is a Python extension wrapping IBM's ICU C++ API.
51 This package contains Python 3 module.
53 %description -n python3-pyicu -l pl.UTF-8
54 PyICU to rozszerzenie Pythona obudowujące API C++ biblioteki ICU firmy
57 Ten pakiet zawiera moduł Pythona 3.
60 %setup -q -n PyICU-%{version}
63 # uses ICU C++ API, which (in case if icu 59+) needs char16_t as distinct type, i.e. C++ 11
64 CFLAGS="%{rpmcxxflags} %{rpmcppflags} -std=c++11"
69 # tests need module already built
70 %{?with_tests:PYTHONPATH=$(pwd)/$(echo build-2/lib.*) %{__python} -m unittest discover -s test}
76 # tests to be 2to3'ed (by setup) and module already built
77 %{?with_tests:PYTHONPATH=$(pwd)/$(echo build-3/lib.*) %{__python3} -m unittest discover -s test}
81 rm -rf $RPM_BUILD_ROOT
93 rm -rf $RPM_BUILD_ROOT
97 %defattr(644,root,root,755)
98 %doc CHANGES CREDITS LICENSE README.md
99 %{py_sitedir}/PyICU.py[co]
100 %dir %{py_sitedir}/icu
101 %{py_sitedir}/icu/__init__.py[co]
102 %{py_sitedir}/icu/docs.py[co]
103 %attr(755,root,root) %{py_sitedir}/_icu.so
104 %if "%{py_ver}" > "2.4"
105 %{py_sitedir}/PyICU-%{version}-py*.egg-info
110 %files -n python3-pyicu
111 %defattr(644,root,root,755)
112 %doc CHANGES CREDITS LICENSE README.md
113 %{py3_sitedir}/PyICU.py
114 %dir %{py3_sitedir}/icu
115 %{py3_sitedir}/__pycache__/PyICU.*.py[co]
116 %{py3_sitedir}/icu/__init__.py
117 %{py3_sitedir}/icu/docs.py
118 %dir %{py3_sitedir}/icu/__pycache__
119 %{py3_sitedir}/icu/__pycache__/__init__.*.py[co]
120 %{py3_sitedir}/icu/__pycache__/docs.*.py[co]
121 %attr(755,root,root) %{py3_sitedir}/_icu.cpython-*.so
122 %{py3_sitedir}/PyICU-%{version}-py*.egg-info