python-cython/python-cython.spec

101 lines
2.5 KiB
RPMSpec
Raw Normal View History

2017-03-09 22:30:16 -05:00
%define tarname cython
2015-01-27 15:22:51 +03:00
# Force python3 build - required by new hplip
# % {?build_python3}%{?!build_python3:%bcond_without python3}
%bcond_without python3
2012-02-01 14:24:13 +04:00
2017-03-09 22:30:16 -05:00
Summary: Language for writing C extensions to Python
Name: python-cython
License: Apache License
Group: Development/Python
Url: http://www.cython.org
Version: 0.25.2
Release: 1
Source0: https://github.com/cython/cython/archive/%{version}%{?rctag:%{rctag}}/%{tarname}-%{version}%{?rctag:%{rctag}}.tar.gz
Source100: %{name}.rpmlintrc
BuildRequires: python-devel
BuildRequires: dos2unix
2014-06-25 15:30:12 +04:00
BuildRequires: python-distribute
%if %{with python3}
2014-06-25 15:30:12 +04:00
BuildRequires: python3-distribute
%endif
2012-02-01 14:24:13 +04:00
%description
Cython is a language that facilitates the writing of C extensions for
the Python language. It is based on Pyrex, but provides more cutting
edge functionality and optimizations.
%if %{with python3}
2013-03-28 16:43:26 +04:00
%package -n python3-cython
2017-03-09 22:30:16 -05:00
Summary: Language for writing C extensions to Python
Group: Development/Python
2013-03-28 16:43:26 +04:00
BuildRequires: python3-devel
%description -n python3-cython
Cython is a language that facilitates the writing of C extensions for
the Python language. It is based on Pyrex, but provides more cutting
edge functionality and optimizations.
%endif
2013-03-28 16:43:26 +04:00
2012-02-01 14:24:13 +04:00
%prep
2014-05-20 14:22:41 +04:00
%setup -q -c
2012-02-01 14:24:13 +04:00
2014-05-20 14:22:41 +04:00
mv %{tarname}-%{version} python2
%if %{with python3}
2014-05-20 14:22:41 +04:00
cp -r python2 python3
%endif
2013-03-28 16:43:26 +04:00
2017-03-09 22:30:16 -05:00
%build
2013-03-28 16:43:26 +04:00
pushd python2
2014-06-23 14:58:55 +04:00
python setup.py build
2013-03-28 16:43:26 +04:00
popd
%if %{with python3}
2013-03-28 16:43:26 +04:00
pushd python3
2015-12-27 15:50:22 +03:00
python3 setup.py build
2013-03-28 16:43:26 +04:00
popd
%endif
2013-03-28 16:43:26 +04:00
2012-02-01 14:24:13 +04:00
%install
%if %{with python3}
2013-03-28 16:43:26 +04:00
pushd python3
2015-12-27 15:50:22 +03:00
PYTHONDONTWRITEBYTECODE= python3 setup.py install --root %{buildroot}
2013-03-28 16:43:26 +04:00
mv %{buildroot}/usr/bin/cython %{buildroot}/usr/bin/cython3
mv %{buildroot}/usr/bin/cygdb %{buildroot}/usr/bin/cygdb3
2014-09-28 08:19:00 +04:00
mv %{buildroot}/usr/bin/cythonize %{buildroot}/usr/bin/cythonize3
2013-03-28 16:43:26 +04:00
popd
%endif
2013-03-28 16:43:26 +04:00
pushd python2
2012-02-01 14:24:13 +04:00
find -name .*DS_Store* | xargs rm -rf
2015-12-27 15:50:22 +03:00
PYTHONDONTWRITEBYTECODE= python setup.py install --root %{buildroot}
2012-02-01 14:24:13 +04:00
pushd Tools
dos2unix cython-mode.el
2015-12-27 15:50:22 +03:00
install -m 755 -d %{buildroot}%{_sysconfdir}/emacs/site-start.d
install -m 644 *.el* %{buildroot}%{_sysconfdir}/emacs/site-start.d
2012-02-01 14:24:13 +04:00
popd
2013-03-28 16:43:26 +04:00
popd
2012-02-01 14:24:13 +04:00
#%%check
#PYTHONPATH=`pwd`/../build/lib make test clean
2017-03-09 22:30:16 -05:00
%files
2012-02-01 14:24:13 +04:00
%{_sysconfdir}/emacs/site-start.d/*.el*
2014-06-23 14:58:55 +04:00
%{_bindir}/cython
%{_bindir}/cygdb
2014-09-28 08:19:00 +04:00
%{_bindir}/cythonize
2014-06-23 14:58:55 +04:00
%{py_platsitedir}/Cython*
%{py_platsitedir}/cython*
%{py_platsitedir}/pyximport*
2012-02-01 14:24:13 +04:00
%if %{with python3}
2013-03-28 16:43:26 +04:00
%files -n python3-cython
2014-06-23 14:58:55 +04:00
%{_bindir}/cython3
%{_bindir}/cygdb3
2014-09-28 08:19:00 +04:00
%{_bindir}/cythonize3
2014-06-23 14:58:55 +04:00
%{py3_platsitedir}/__pycache__/*
%{py3_platsitedir}/Cython*
%{py3_platsitedir}/cython*
%{py3_platsitedir}/pyximport*
%endif