]> git.pld-linux.org Git - packages/python-pyicu.git/blame - python-pyicu.spec
- up to 2.9
[packages/python-pyicu.git] / python-pyicu.spec
CommitLineData
cc11606c
JB
1#
2# Conditional build:
3%bcond_without python2 # CPython 2.x module
4%bcond_without python3 # CPython 3.x module
6e490d5e 5%bcond_without tests # unit tests
cc11606c
JB
6#
7Summary: PyICU - Python 2 extension wrapping IBM's ICU C++ API
8Summary(pl.UTF-8): PyICU - rozszerzenie Pythona 2 obudowujące API C++ biblioteki ICU firmy IBM
01cab8ba 9Name: python-pyicu
ee0d80bc
JR
10Version: 2.9
11Release: 1
01cab8ba 12License: MIT-like
bf26a09a 13Group: Development/Languages/Python
18356095
JB
14#Source0Download: https://pypi.org/simple/PyICU/
15Source0: https://files.pythonhosted.org/packages/source/P/PyICU/PyICU-%{version}.tar.gz
ee0d80bc 16# Source0-md5: 9ea06979b28c132bca0df3cf26628704
4b18033f 17Patch0: 0001-disable-failing-test.patch
18356095 18URL: https://pypi.org/project/PyICU/
a93faa77
JB
19BuildRequires: libicu-devel >= 59
20BuildRequires: libstdc++-devel >= 6:4.7
cc11606c 21%if %{with python2}
a64306b6 22BuildRequires: python-devel >= 1:2.3
cc11606c 23BuildRequires: python-modules >= 1:2.3
18356095
JB
24%if %{with tests}
25BuildRequires: python-six
26%endif
cc11606c
JB
27%endif
28%if %{with python3}
a93faa77 29BuildRequires: python3-2to3 >= 1:3.2
6e490d5e
JB
30BuildRequires: python3-devel >= 1:3.2
31BuildRequires: python3-modules >= 1:3.2
18356095
JB
32%if %{with tests}
33BuildRequires: python3-six
34%endif
cc11606c 35%endif
2a710a52 36BuildRequires: rpm-pythonprov
bc6615bb 37BuildRequires: rpmbuild(macros) >= 1.714
a64306b6
ER
38BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39
40%description
01cab8ba
JB
41PyICU is a Python extension wrapping IBM's ICU C++ API.
42
cc11606c
JB
43This package contains Python 2 module.
44
01cab8ba
JB
45%description -l pl.UTF-8
46PyICU to rozszerzenie Pythona obudowujące API C++ biblioteki ICU firmy
47IBM.
a64306b6 48
cc11606c
JB
49Ten pakiet zawiera moduł Pythona 2.
50
51%package -n python3-pyicu
52Summary: PyICU - Python 3 extension wrapping IBM's ICU C++ API
53Summary(pl.UTF-8): PyICU - rozszerzenie Pythona 3 obudowujące API C++ biblioteki ICU firmy IBM
54Group: Development/Languages/Python
55
56%description -n python3-pyicu
57PyICU is a Python extension wrapping IBM's ICU C++ API.
58
59This package contains Python 3 module.
60
61%description -n python3-pyicu -l pl.UTF-8
62PyICU to rozszerzenie Pythona obudowujące API C++ biblioteki ICU firmy
63IBM.
64
65Ten pakiet zawiera moduł Pythona 3.
66
a64306b6
ER
67%prep
68%setup -q -n PyICU-%{version}
4b18033f 69%patch0 -p1
a64306b6
ER
70
71%build
a93faa77
JB
72# uses ICU C++ API, which (in case if icu 59+) needs char16_t as distinct type, i.e. C++ 11
73CFLAGS="%{rpmcxxflags} %{rpmcppflags} -std=c++11"
74
cc11606c 75%if %{with python2}
a93faa77
JB
76%py_build
77
78# tests need module already built
79%{?with_tests:PYTHONPATH=$(pwd)/$(echo build-2/lib.*) %{__python} -m unittest discover -s test}
cc11606c
JB
80%endif
81
82%if %{with python3}
bc6615bb 83%py3_build
6e490d5e 84
a93faa77
JB
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}
cc11606c 87%endif
a64306b6
ER
88
89%install
90rm -rf $RPM_BUILD_ROOT
cc11606c
JB
91
92%if %{with python2}
bc6615bb 93%py_install
a64306b6 94%py_postclean
cc11606c
JB
95%endif
96
97%if %{with python3}
bc6615bb 98%py3_install
cc11606c 99%endif
a64306b6
ER
100
101%clean
102rm -rf $RPM_BUILD_ROOT
103
cc11606c 104%if %{with python2}
a64306b6
ER
105%files
106%defattr(644,root,root,755)
77896448 107%doc CHANGES CREDITS LICENSE README.md
8f268e25
JR
108%dir %{py_sitedir}/icu
109%{py_sitedir}/icu/__init__.py[co]
ee0d80bc 110%attr(755,root,root) %{py_sitedir}/icu/_icu_.so
a64306b6 111%if "%{py_ver}" > "2.4"
01cab8ba 112%{py_sitedir}/PyICU-%{version}-py*.egg-info
a64306b6 113%endif
cc11606c
JB
114%endif
115
116%if %{with python3}
117%files -n python3-pyicu
118%defattr(644,root,root,755)
77896448 119%doc CHANGES CREDITS LICENSE README.md
8f268e25 120%dir %{py3_sitedir}/icu
8f268e25 121%{py3_sitedir}/icu/__init__.py
ee0d80bc
JR
122%{py3_sitedir}/icu/__pycache__
123%attr(755,root,root) %{py3_sitedir}/icu/_icu_.cpython-*.so
cc11606c
JB
124%{py3_sitedir}/PyICU-%{version}-py*.egg-info
125%endif
This page took 0.089556 seconds and 4 git commands to generate.