- build both python2/python3 modules from single spec
[packages/python-Cython.git] / python-Cython.spec
CommitLineData
50da0181
JB
1#
2# Conditional build:
3%bcond_without python2 # CPython 2.x module
4%bcond_without python3 # CPython 3.x module
c851376d 5
6%define module Cython
7
50da0181
JB
8Summary: Language for writing Python Extension Modules (Python 2.x version)
9Summary(pl.UTF-8): Język służący do pisania modułów rozszerzających Pythona (wersja dla Pythona 2.x)
c851376d 10Name: python-%{module}
2a873ba1 11Version: 0.20.1
52da8e1d 12Release: 1
e752d74b 13License: Apache v2.0
c851376d 14Group: Libraries/Python
81b5c351 15Source0: http://www.cython.org/release/%{module}-%{version}.tar.gz
2a873ba1 16# Source0-md5: 52431696c64e618036537c4d9aa79d99
c851376d 17URL: http://www.cython.org/
50da0181 18%if %{with python2}
c851376d 19BuildRequires: python >= 1:2.5
455ac150 20BuildRequires: python-devel
50da0181
JB
21%endif
22%if %{with python3}
23BuildRequires: python3
24BuildRequires: python3-2to3
25BuildRequires: python3-devel
26BuildRequires: python3-distribute
27BuildRequires: python3-modules
28%endif
c851376d 29BuildRequires: rpm-pythonprov
50da0181 30Requires: python-devel
c851376d 31BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32
33%define _noautocompressdoc *.c
34
35%description
36Cython lets you write code that mixes Python and C data types any way
6f08c5d3 37you want, and compiles it into a C extension for Python. Cython is
38based on Pyrex.
c851376d 39
50da0181
JB
40This package contains Cython module for Python 2.x.
41
c851376d 42%description -l pl.UTF-8
e752d74b 43Cython pozwala pisać kod zawierający dane Pythona i języka C połączone
c851376d 44w jakikolwiek sposób i kompiluje to jako rozszerzenie C dla Pythona.
6f08c5d3 45Cython jest oparty na Pyreksie.
c851376d 46
50da0181
JB
47Ten pakiet zawiera moduł Cython dla Pythona 2.x.
48
49%package -n python3-Cython
50Summary: Language for writing Python Extension Modules (Python 3.x version)
51Summary(pl.UTF-8): Język służący do pisania modułów rozszerzających Pythona (wersja dla Pythona 3.x)
52Group: Libraries/Python
53Requires: python3-devel
54
55%description -n python3-Cython
56Cython lets you write code that mixes Python and C data types any way
57you want, and compiles it into a C extension for Python. Cython is
58based on Pyrex.
59
60This package contains Cython module for Python 3.x.
61
62%description -n python3-Cython -l pl.UTF-8
63Pyrex pozwala pisać kod zawierający dane Pythona i języka C połączone
64w jakikolwiek sposób i kompiluje to jako rozszerzenie C dla Pythona.
65Cython jest oparty na Pyreksie.
66
67Ten pakiet zawiera moduł Cython dla Pythona 3.x.
68
c851376d 69%package examples
e752d74b
JB
70Summary: Examples for Cython language
71Summary(pl.UTF-8): Przykłady programów w języku Cython
c851376d 72Group: Libraries/Python
50da0181 73Obsoletes: python3-Cython-examples
c851376d 74
75%description examples
e752d74b 76This package contains example programs for Cython language.
c851376d 77
78%description examples -l pl.UTF-8
e752d74b 79Pakiet zawierający przykładowe programy napisane w języku Cython.
c851376d 80
81%prep
82%setup -q -n %{module}-%{version}
83
7f7a7361 84%build
50da0181 85%if %{with python2}
7f7a7361
JB
86CC="%{__cc}" \
87CFLAGS="%{rpmcflags}" \
50da0181
JB
88%{__python} setup.py build \
89 --build-base build-2
90%endif
91
92%if %{with python3}
93CC="%{__cc}" \
94CFLAGS="%{rpmcflags}" \
95%{__python3} setup.py build \
96 --build-base build-3
97%endif
7f7a7361 98
c851376d 99%install
100rm -rf $RPM_BUILD_ROOT
101install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
102
50da0181
JB
103%if %{with python3}
104%{__python3} setup.py \
105 build \
106 --build-base build-3 \
107 install \
108 --optimize=2 \
109 --skip-build \
110 --root=$RPM_BUILD_ROOT
111
112%{__mv} $RPM_BUILD_ROOT%{_bindir}/cython{,3}
113%{__mv} $RPM_BUILD_ROOT%{_bindir}/cygdb{,3}
114%endif
115
116%if %{with python2}
117%{__python} setup.py \
118 build \
119 --build-base build-2 \
120 install \
121 --optimize=2 \
122 --skip-build \
123 --root=$RPM_BUILD_ROOT
c851376d 124
f7af39b5 125find $RPM_BUILD_ROOT%{py_sitedir} -name "*.py" -a ! -name 'Lexicon.py' -exec rm -f {} \;
50da0181 126%endif
c851376d 127
128cp -a Demos/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
129
130%clean
131rm -rf $RPM_BUILD_ROOT
132
50da0181 133%if %{with python2}
c851376d 134%files
135%defattr(644,root,root,755)
e752d74b 136%doc COPYING.txt README.txt ToDo.txt USAGE.txt Doc/*.html Doc/*.c
f7af39b5 137%attr(755,root,root) %{_bindir}/cython
52da8e1d 138%attr(755,root,root) %{_bindir}/cygdb
81b5c351 139%{py_sitedir}/cython.py[co]
f7af39b5 140%{py_sitedir}/Cython
141%{py_sitedir}/pyximport
50da0181
JB
142%{py_sitedir}/Cython-%{version}-py*.egg-info
143%endif
144
145%if %{with python3}
146%files -n python3-Cython
147%defattr(644,root,root,755)
148%doc COPYING.txt README.txt ToDo.txt USAGE.txt Doc/*.html Doc/*.c
149%attr(755,root,root) %{_bindir}/cython3
150%attr(755,root,root) %{_bindir}/cygdb3
151%{py3_sitedir}/cython.py
152%{py3_sitedir}/__pycache__/cython.*
153%{py3_sitedir}/Cython
154%{py3_sitedir}/pyximport
155%{py3_sitedir}/Cython-%{version}-py*.egg-info
156%endif
c851376d 157
158%files examples
159%defattr(644,root,root,755)
160%{_examplesdir}/%{name}-%{version}
This page took 0.118308 seconds and 4 git commands to generate.