From 3490de3bbc63ba0c65bb4116dd9df0c43681e6dd Mon Sep 17 00:00:00 2001 From: James Antill Date: Mon, 8 Aug 2022 13:58:49 -0400 Subject: [PATCH] Import rpm: 1a2e8d49788c389313af6b4ead4e2deddd2a3d3d --- .fmf/version | 1 + .gitignore | 1 + Cython.spec | 137 +++++++++++++++++++++++ gating.yaml | 6 + plans.fmf | 11 ++ replace-gcc-attribute-os-with-cold.patch | 13 +++ sources | 1 + 7 files changed, 170 insertions(+) create mode 100644 .fmf/version create mode 100644 .gitignore create mode 100644 Cython.spec create mode 100644 gating.yaml create mode 100644 plans.fmf create mode 100644 replace-gcc-attribute-os-with-cold.patch create mode 100644 sources diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..04f393f --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/Cython-0.28.1.tar.gz diff --git a/Cython.spec b/Cython.spec new file mode 100644 index 0000000..7cfa111 --- /dev/null +++ b/Cython.spec @@ -0,0 +1,137 @@ +# python2X and python3X are built form the same module, so we need a conditional +# for python[23] bits the state of the conditional is not important in the spec, +# it is set in modulemd +%bcond_without python2 +%bcond_without python3 + +%global srcname Cython +%global upname cython + +Name: Cython +Version: 0.28.1 +Release: 7%{?dist} +Summary: Language for writing Python extension modules + +License: ASL 2.0 +URL: http://www.cython.org +Source: https://github.com/cython/cython/archive/%{version}/%{srcname}-%{version}.tar.gz + +# Replace GCC's attribute optimize("Os") by the better supported and similar (cold). +# We essentially disable again strict aliasing which makes some compiler warnings +# go away on python2. +# Fixed upstream: https://github.com/cython/cython/commit/9ddac7152091eac62830fea4f38b4d7f9edb6a86 +Patch0: replace-gcc-attribute-os-with-cold.patch + +BuildRequires: gcc + +%global _description \ +This is a development version of Pyrex, a language\ +for writing Python extension modules. + +%description %{_description} + +%if %{with python2} +%package -n python2-%{srcname} +Summary: %{summary} +%{?python_provide:%python_provide python2-%{srcname}} +Obsoletes: Cython < 0.28.1-5 +BuildRequires: python2-devel +BuildRequires: python2-setuptools + + +%description -n python2-%{srcname} %{_description} + +Python 2 version. + +%endif + +%if %{with python3} +%package -n python3-%{srcname} +Summary: %{summary} +%{?python_provide:%python_provide python3-%{srcname}} +BuildRequires: python3-devel +BuildRequires: python3-setuptools + +%description -n python3-%{srcname} %{_description} + +Python 3 version. + +%endif + +%prep +%autosetup -n %{upname}-%{version} -p1 + +%build +%{?with_python2:%py2_build} +%{?with_python3:%py3_build} + +%install +# Must do the python3 install first because the scripts in /usr/bin are +# overwritten with every setup.py install (and we want the python2 version +# to be the default for now). +%if %{with python3} +%py3_install +for bin in cython cythonize cygdb; do + mv %{buildroot}%{_bindir}/${bin} %{buildroot}%{_bindir}/${bin}3 +done +rm -rf %{buildroot}%{python3_sitelib}/setuptools/tests +%endif + +%if %{with python2} +%py2_install +for bin in cython cythonize cygdb; do + mv %{buildroot}%{_bindir}/${bin} %{buildroot}%{_bindir}/${bin}-%{python2_version} + ln -s ${bin}-%{python2_version} $RPM_BUILD_ROOT%{_bindir}/${bin}-2 +done +rm -rf %{buildroot}%{python2_sitelib}/setuptools/tests +%endif + +%if %{with python2} +%files -n python2-%{srcname} +%license LICENSE.txt +%doc *.txt Demos Doc Tools +%{_bindir}/cython-2 +%{_bindir}/cygdb-2 +%{_bindir}/cythonize-2 +%{_bindir}/cython-%{python2_version} +%{_bindir}/cygdb-%{python2_version} +%{_bindir}/cythonize-%{python2_version} +%{python2_sitearch}/%{srcname}-*.egg-info/ +%{python2_sitearch}/%{srcname}/ +%{python2_sitearch}/pyximport/ +%{python2_sitearch}/%{upname}.py* +%endif + +%if %{with python3} +%files -n python3-%{srcname} +%license LICENSE.txt +%doc *.txt Demos Doc Tools +%{_bindir}/cython3 +%{_bindir}/cythonize3 +%{_bindir}/cygdb3 +%{python3_sitearch}/%{srcname}-*.egg-info/ +%{python3_sitearch}/%{srcname}/ +%{python3_sitearch}/pyximport/ +%{python3_sitearch}/%{upname}.py +%{python3_sitearch}/__pycache__/%{upname}.* +%endif + +%changelog +* Wed Apr 03 2019 Tomas Orsava - 0.28.1-7 +- Bumping due to problems with modular RPM upgrade path +- Resolves: rhbz#1695587 + +* Wed Dec 12 2018 Charalampos Stratakis - 0.28.1-6 +- Replace GCC's attribute optimize("Os") by the better supported and similar (cold). +- Resolves: rhbz#1658621 + +* Tue Oct 09 2018 Lumír Balhar - 0.28.1-5 +- Remove unversioned provides +- Resolves: rhbz#1628242 + +* Wed Aug 08 2018 Lumír Balhar - 0.28.1-4 +- Remove unversioned binaries from python2 subpackage +- Resolves: rhbz#1613343 + +* Wed Aug 01 2018 Lumír Balhar - 0.28.1-3 +- First version for python27 module diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..648918d --- /dev/null +++ b/gating.yaml @@ -0,0 +1,6 @@ +--- !Policy +product_versions: + - rhel-9 +decision_context: osci_compose_gate +rules: + - !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional} diff --git a/plans.fmf b/plans.fmf new file mode 100644 index 0000000..45d4bb3 --- /dev/null +++ b/plans.fmf @@ -0,0 +1,11 @@ +discover: + - name: Smoke-tests + how: shell + tests: + - name: python-import-test + test: python3 -c 'import Cython' + require: + - python3-Cython + duration: 1m +execute: + how: tmt diff --git a/replace-gcc-attribute-os-with-cold.patch b/replace-gcc-attribute-os-with-cold.patch new file mode 100644 index 0000000..ec2bb41 --- /dev/null +++ b/replace-gcc-attribute-os-with-cold.patch @@ -0,0 +1,13 @@ +diff --git a/Cython/Utility/ModuleSetupCode.c b/Cython/Utility/ModuleSetupCode.c +index 2aeabd2..8b285bb 100644 +--- a/Cython/Utility/ModuleSetupCode.c ++++ b/Cython/Utility/ModuleSetupCode.c +@@ -669,7 +669,7 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + #if defined(__clang__) + #define CYTHON_SMALL_CODE + #elif defined(__GNUC__) +- #define CYTHON_SMALL_CODE __attribute__((optimize("Os"))) ++ #define CYTHON_SMALL_CODE __attribute__((cold)) + #else + #define CYTHON_SMALL_CODE + #endif diff --git a/sources b/sources new file mode 100644 index 0000000..256d8dd --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA1 (Cython-0.28.1.tar.gz) = 85d6abc9cded209bfa0e21f0f6876018e6125056