python-cython/python-cython.spec
Your Name a7e9d53bcd
All checks were successful
Run CI/CD... / main (push) Successful in 19m37s
0.29.36
2025-02-10 20:55:56 +00:00

147 lines
3.5 KiB
RPMSpec

# Python module not linking to libpython
%global _disable_ld_no_undefined 1
%bcond_with check
%define tarname cython
%global optflags %optflags -O3
%define python38 /usr/libexec/python3.8
Summary: Language for writing C extensions to Python
Name: python-cython
Version: 0.29.36
Release: 1
License: Python
Group: Development/Python
URL: https://cython.org
Source0: https://github.com/cython/cython/archive/%{version}/%{tarname}-%{version}.tar.gz
Source1: %{name}.rpmlintrc
Patch0: cython-0.29.28-missing-header.patch
BuildRequires: pkgconfig(python)
BuildRequires: python-setuptools
BuildRequires: pkgconfig(python3)
BuildRequires: python3-setuptools
BuildRequires: python38-devel
BuildRequires: python38-setuptools
BuildRequires: dos2unix
%if %{with check}
BuildRequires: gdb
BuildRequires: gomp-devel
BuildRequires: python3-numpy-devel
%endif
%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.
#--------------------------------------------------------------------
%package -n python3-cython
Summary: Language for writing C extensions to Python
Group: Development/Python
Provides: python-cython = %{version}-%{release}
%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.
%files -n python3-cython
%{_bindir}/cython3
%{_bindir}/cythonize3
%{_bindir}/cygdb3
%{py3_platsitedir}/Cython
%{py3_platsitedir}/Cython-%{version}-*.egg-info
%{py3_platsitedir}/cython*
%{py3_platsitedir}/pyximport
%{py3_platsitedir}/__pycache__/
#--------------------------------------------------------------------
%package -n python38-cython
Summary: Language for writing C extensions to Python
Group: Development/Python
Provides: python-cython = %{version}-%{release}
%description -n python38-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.
%files -n python38-cython
%{_bindir}/cython38
%{_bindir}/cythonize38
%{_bindir}/cygdb38
%{py38_platsitedir}/Cython
%{py38_platsitedir}/Cython-%{version}-*.egg-info
%{py38_platsitedir}/cython*
%{py38_platsitedir}/pyximport
%{py38_platsitedir}/__pycache__/
#--------------------------------------------------------------------
%prep
%setup -qn %{tarname}-%{version}
#patch0 -p1
find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
cp -r . %{py38dir}
cp -r . %{py3dir}
%build
%py2_build
pushd %{py3dir}
%py3_build
popd
pushd %{py38dir}
%py38_build
popd
%install
#{__python3} setup.py install -O1 --skip-build --root %{buildroot}
#rm -rf %{buildroot}%{python3_sitelib}/setuptools/tests
#rm -rf %{buildroot}/%{python3_sitearch}/__pycache__/
%py_install
pushd %{buildroot}%{_bindir}
mv cygdb cygdb2
mv cython cython2
mv cythonize cythonize2
popd
pushd %{py3dir}
%py3_install
pushd %{buildroot}%{_bindir}
mv cygdb cygdb3
mv cython cython3
mv cythonize cythonize3
popd
popd
pushd %{py38dir}
%py38_install
pushd %{buildroot}%{_bindir}
mv cygdb cygdb38
mv cython cython38
mv cythonize cythonize38
popd
popd
%if %{with check}
%check
python3 runtests.py
%{python38} runtests.py
%endif
%files
%{_bindir}/cython2
%{_bindir}/cythonize2
%{_bindir}/cygdb2
%{py_platsitedir}/Cython
%{py_platsitedir}/Cython-%{version}-*.egg-info
%{py_platsitedir}/cython*
%{py_platsitedir}/pyximport