]> git.pld-linux.org Git - packages/python-pyicu.git/blob - python-pyicu.spec
c618e16043108cbc838afff411e0058d29620f4a
[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:        5
12 License:        MIT-like
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:  622d9bc07bca7d5be4b5cc061f4770c4
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
21 %if %{with python2}
22 BuildRequires:  python-devel >= 1:2.3
23 BuildRequires:  python-modules >= 1:2.3
24 %if %{with tests}
25 BuildRequires:  python-six
26 %endif
27 %endif
28 %if %{with python3}
29 BuildRequires:  python3-2to3 >= 1:3.2
30 BuildRequires:  python3-devel >= 1:3.2
31 BuildRequires:  python3-modules >= 1:3.2
32 %if %{with tests}
33 BuildRequires:  python3-six
34 %endif
35 %endif
36 BuildRequires:  rpm-pythonprov
37 BuildRequires:  rpmbuild(macros) >= 1.714
38 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39
40 %description
41 PyICU is a Python extension wrapping IBM's ICU C++ API.
42
43 This package contains Python 2 module.
44
45 %description -l pl.UTF-8
46 PyICU to rozszerzenie Pythona obudowujące API C++ biblioteki ICU firmy
47 IBM.
48
49 Ten pakiet zawiera moduł Pythona 2.
50
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
55
56 %description -n python3-pyicu
57 PyICU is a Python extension wrapping IBM's ICU C++ API.
58
59 This package contains Python 3 module.
60
61 %description -n python3-pyicu -l pl.UTF-8
62 PyICU to rozszerzenie Pythona obudowujące API C++ biblioteki ICU firmy
63 IBM.
64
65 Ten pakiet zawiera moduł Pythona 3.
66
67 %prep
68 %setup -q -n PyICU-%{version}
69 %patch0 -p1
70
71 %build
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"
74
75 %if %{with python2}
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}
80 %endif
81
82 %if %{with python3}
83 %py3_build
84
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}
87 %endif
88
89 %install
90 rm -rf $RPM_BUILD_ROOT
91
92 %if %{with python2}
93 %py_install
94 %py_postclean
95 %endif
96
97 %if %{with python3}
98 %py3_install
99 %endif
100
101 %clean
102 rm -rf $RPM_BUILD_ROOT
103
104 %if %{with python2}
105 %files
106 %defattr(644,root,root,755)
107 %doc CHANGES CREDITS LICENSE README.md
108 %{py_sitedir}/PyICU.py[co]
109 %dir %{py_sitedir}/icu
110 %{py_sitedir}/icu/__init__.py[co]
111 %attr(755,root,root) %{py_sitedir}/_icu.so
112 %if "%{py_ver}" > "2.4"
113 %{py_sitedir}/PyICU-%{version}-py*.egg-info
114 %endif
115 %endif
116
117 %if %{with python3}
118 %files -n python3-pyicu
119 %defattr(644,root,root,755)
120 %doc CHANGES CREDITS LICENSE README.md
121 %{py3_sitedir}/PyICU.py
122 %dir %{py3_sitedir}/icu
123 %{py3_sitedir}/__pycache__/PyICU.*.py[co]
124 %{py3_sitedir}/icu/__init__.py
125 %dir %{py3_sitedir}/icu/__pycache__
126 %{py3_sitedir}/icu/__pycache__/__init__.*.py[co]
127 %attr(755,root,root) %{py3_sitedir}/_icu.cpython-*.so
128 %{py3_sitedir}/PyICU-%{version}-py*.egg-info
129 %endif
This page took 0.065091 seconds and 2 git commands to generate.