]>
Commit | Line | Data |
---|---|---|
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: 1.9.6 | |
11 | Release: 1 | |
12 | License: MIT-like | |
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 | |
19 | %if %{with python2} | |
20 | BuildRequires: python-devel >= 1:2.3 | |
21 | BuildRequires: python-modules >= 1:2.3 | |
22 | %endif | |
23 | %if %{with python3} | |
24 | BuildRequires: python3-2to3 >= 1:3.2 | |
25 | BuildRequires: python3-devel >= 1:3.2 | |
26 | BuildRequires: python3-modules >= 1:3.2 | |
27 | %endif | |
28 | BuildRequires: rpm-pythonprov | |
29 | BuildRequires: rpmbuild(macros) >= 1.714 | |
30 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
31 | ||
32 | %description | |
33 | PyICU is a Python extension wrapping IBM's ICU C++ API. | |
34 | ||
35 | This package contains Python 2 module. | |
36 | ||
37 | %description -l pl.UTF-8 | |
38 | PyICU to rozszerzenie Pythona obudowujące API C++ biblioteki ICU firmy | |
39 | IBM. | |
40 | ||
41 | Ten pakiet zawiera moduł Pythona 2. | |
42 | ||
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 | |
47 | ||
48 | %description -n python3-pyicu | |
49 | PyICU is a Python extension wrapping IBM's ICU C++ API. | |
50 | ||
51 | This package contains Python 3 module. | |
52 | ||
53 | %description -n python3-pyicu -l pl.UTF-8 | |
54 | PyICU to rozszerzenie Pythona obudowujące API C++ biblioteki ICU firmy | |
55 | IBM. | |
56 | ||
57 | Ten pakiet zawiera moduł Pythona 3. | |
58 | ||
59 | %prep | |
60 | %setup -q -n PyICU-%{version} | |
61 | ||
62 | %build | |
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" | |
65 | ||
66 | %if %{with python2} | |
67 | %py_build | |
68 | ||
69 | # tests need module already built | |
70 | %{?with_tests:PYTHONPATH=$(pwd)/$(echo build-2/lib.*) %{__python} -m unittest discover -s test} | |
71 | %endif | |
72 | ||
73 | %if %{with python3} | |
74 | %py3_build | |
75 | ||
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} | |
78 | %endif | |
79 | ||
80 | %install | |
81 | rm -rf $RPM_BUILD_ROOT | |
82 | ||
83 | %if %{with python2} | |
84 | %py_install | |
85 | %py_postclean | |
86 | %endif | |
87 | ||
88 | %if %{with python3} | |
89 | %py3_install | |
90 | %endif | |
91 | ||
92 | %clean | |
93 | rm -rf $RPM_BUILD_ROOT | |
94 | ||
95 | %if %{with python2} | |
96 | %files | |
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 | |
106 | %endif | |
107 | %endif | |
108 | ||
109 | %if %{with python3} | |
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 | |
123 | %endif |