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