db791b
# python2X and python3X are built form the same module, so we need a conditional
db791b
# for python[23] bits the state of the conditional is not important in the spec,
db791b
# it is set in modulemd
db791b
%bcond_without python2
db791b
%bcond_without python3
db791b
db791b
%global srcname Cython
db791b
%global upname cython
db791b
db791b
Name:           Cython
db791b
Version:        0.28.1
4b5428
Release:        7%{?dist}
db791b
Summary:        Language for writing Python extension modules
db791b
db791b
License:        ASL 2.0
db791b
URL:            http://www.cython.org
db791b
Source:         https://github.com/cython/cython/archive/%{version}/%{srcname}-%{version}.tar.gz
db791b
db791b
# Replace GCC's attribute optimize("Os") by the better supported and similar (cold).
db791b
# We essentially disable again strict aliasing which makes some compiler warnings
db791b
# go away on python2.
db791b
# Fixed upstream: https://github.com/cython/cython/commit/9ddac7152091eac62830fea4f38b4d7f9edb6a86
db791b
Patch0:         replace-gcc-attribute-os-with-cold.patch
db791b
db791b
BuildRequires:  gcc
db791b
db791b
%global _description \
db791b
This is a development version of Pyrex, a language\
db791b
for writing Python extension modules.
db791b
db791b
%description %{_description}
db791b
db791b
%if %{with python2}
db791b
%package -n python2-%{srcname}
db791b
Summary:        %{summary}
db791b
%{?python_provide:%python_provide python2-%{srcname}}
db791b
Obsoletes:      Cython < 0.28.1-5
db791b
BuildRequires:  python2-devel
db791b
BuildRequires:  python2-setuptools
db791b
db791b
db791b
%description -n python2-%{srcname} %{_description}
db791b
db791b
Python 2 version.
db791b
db791b
%endif
db791b
db791b
%if %{with python3}
db791b
%package -n python3-%{srcname}
db791b
Summary:        %{summary}
db791b
%{?python_provide:%python_provide python3-%{srcname}}
db791b
BuildRequires:  python3-devel
db791b
BuildRequires:  python3-setuptools
db791b
db791b
%description -n python3-%{srcname} %{_description}
db791b
db791b
Python 3 version.
db791b
db791b
%endif
db791b
db791b
%prep
db791b
%autosetup -n %{upname}-%{version} -p1
db791b
db791b
%build
db791b
%{?with_python2:%py2_build}
db791b
%{?with_python3:%py3_build}
db791b
db791b
%install
db791b
# Must do the python3 install first because the scripts in /usr/bin are
db791b
# overwritten with every setup.py install (and we want the python2 version
db791b
# to be the default for now).
db791b
%if %{with python3}
db791b
%py3_install
db791b
for bin in cython cythonize cygdb; do
db791b
  mv %{buildroot}%{_bindir}/${bin} %{buildroot}%{_bindir}/${bin}3
db791b
done
db791b
rm -rf %{buildroot}%{python3_sitelib}/setuptools/tests
db791b
%endif
db791b
db791b
%if %{with python2}
db791b
%py2_install
db791b
for bin in cython cythonize cygdb; do
db791b
  mv %{buildroot}%{_bindir}/${bin} %{buildroot}%{_bindir}/${bin}-%{python2_version}
db791b
  ln -s ${bin}-%{python2_version} $RPM_BUILD_ROOT%{_bindir}/${bin}-2
db791b
done
db791b
rm -rf %{buildroot}%{python2_sitelib}/setuptools/tests
db791b
%endif
db791b
db791b
%if %{with python2}
db791b
%files -n python2-%{srcname}
db791b
%license LICENSE.txt
db791b
%doc *.txt Demos Doc Tools
db791b
%{_bindir}/cython-2
db791b
%{_bindir}/cygdb-2
db791b
%{_bindir}/cythonize-2
db791b
%{_bindir}/cython-%{python2_version}
db791b
%{_bindir}/cygdb-%{python2_version}
db791b
%{_bindir}/cythonize-%{python2_version}
db791b
%{python2_sitearch}/%{srcname}-*.egg-info/
db791b
%{python2_sitearch}/%{srcname}/
db791b
%{python2_sitearch}/pyximport/
db791b
%{python2_sitearch}/%{upname}.py*
db791b
%endif
db791b
db791b
%if %{with python3}
db791b
%files -n python3-%{srcname}
db791b
%license LICENSE.txt
db791b
%doc *.txt Demos Doc Tools
db791b
%{_bindir}/cython3
db791b
%{_bindir}/cythonize3
db791b
%{_bindir}/cygdb3
db791b
%{python3_sitearch}/%{srcname}-*.egg-info/
db791b
%{python3_sitearch}/%{srcname}/
db791b
%{python3_sitearch}/pyximport/
db791b
%{python3_sitearch}/%{upname}.py
db791b
%{python3_sitearch}/__pycache__/%{upname}.*
db791b
%endif
db791b
db791b
%changelog
4b5428
* Wed Apr 03 2019 Tomas Orsava <torsava@redhat.com> - 0.28.1-7
7436f8
- Bumping due to problems with modular RPM upgrade path
7436f8
- Resolves: rhbz#1695587
4b5428
db791b
* Wed Dec 12 2018 Charalampos Stratakis <cstratak@redhat.com> - 0.28.1-6
db791b
- Replace GCC's attribute optimize("Os") by the better supported and similar (cold).
db791b
- Resolves: rhbz#1658621
db791b
db791b
* Tue Oct 09 2018 Lumír Balhar <lbalhar@redhat.com> - 0.28.1-5
db791b
- Remove unversioned provides
db791b
- Resolves: rhbz#1628242
db791b
db791b
* Wed Aug 08 2018 Lumír Balhar <lbalhar@redhat.com> - 0.28.1-4
db791b
- Remove unversioned binaries from python2 subpackage
db791b
- Resolves: rhbz#1613343
db791b
db791b
* Wed Aug 01 2018 Lumír Balhar <lbalhar@redhat.com> - 0.28.1-3
db791b
- First version for python27 module