summaryrefslogtreecommitdiffstats
path: root/python/python3-greenlet.spec
blob: 814dc6f2007ee283fb450c79a529def44665448e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# Python 3 version of greenlet for EPEL
# python-greenlet is retired in epel7 since it is in
# rhel7-extras -- see rhbz#1108884
# but rhel7-extras only contains the Python 2 version
%global         modname greenlet

# Allow SRPM to be built on Fedora, where python3_pkgversion == 3
%{?fedora:%global python3_pkgversion 34}

Name:           python3-%{modname}
Version:        0.4.11
Release:        1%{?dist}
Summary:        Lightweight in-process concurrent programming
Group:          Development/Libraries
License:        MIT
URL:            http://pypi.python.org/pypi/%{modname}
Source0:        https://github.com/python-greenlet/greenlet/archive/%{version}.tar.gz

BuildRequires:  python-tools
BuildRequires:  python%{python3_pkgversion}-devel
BuildRequires:  python%{python3_pkgversion}-setuptools
%{?python_provide:%python_provide python%{python3_pkgversion}-%{modname}}

%description
The greenlet package is a spin-off of Stackless, a version of CPython
that supports micro-threads called "tasklets". Tasklets run
pseudo-concurrently (typically in a single or a few OS-level threads)
and are synchronized with data exchanges on "channels".

%package -n     python%{python3_pkgversion}-%{modname}
Summary:        %{summary}
%{?python_provide:%python_provide python%{python3_pkgversion}-%{modname}}
Group:          Development/Libraries

%description -n python%{python3_pkgversion}-%{modname}
The greenlet package is a spin-off of Stackless, a version of CPython
that supports micro-threads called "tasklets". Tasklets run
pseudo-concurrently (typically in a single or a few OS-level threads)
and are synchronized with data exchanges on "channels".

This is the Python 3 version of greenlet.

%package -n     python%{python3_pkgversion}-greenlet-devel
Summary:        C development headers for python%{python3_pkgversion}-greenlet
%{?python_provide:%python_provide python%{python3_pkgversion}-%{modname}-devel}
Group:          Development/Libraries
Requires:       python%{python3_pkgversion}-%{modname} = %{version}-%{release}

%description -n python%{python3_pkgversion}-%{modname}-devel
This package contains header files required for C modules development.

%prep
%setup -q -n greenlet-%{version}
chmod 644 benchmarks/*.py
# fix shebang
for f in benchmarks/chain.py; do
  sed -i.orig 's|#!/usr/bin/env python|#!/usr/bin/python3|' $f
  touch -r $f.orig $f
  rm $f.orig
done

%build
%py3_build

%install
%py3_install
 
%check
# Run the upstream test suite and benchmarking suite to further exercise the code
%{__python3} setup.py test || :
2to3 -w --no-diffs -n  benchmarks/chain.py
PYTHONPATH=$(pwd) %{__python3} benchmarks/chain.py

%files -n python%{python3_pkgversion}-greenlet
%license LICENSE LICENSE.PSF
%doc AUTHORS NEWS README.rst
%doc doc/greenlet.txt benchmarks
%{python3_sitearch}/greenlet.cpython-*.so
%{python3_sitearch}/greenlet*.egg-info

%files -n python%{python3_pkgversion}-greenlet-devel
%license LICENSE LICENSE.PSF
%doc AUTHORS NEWS README.rst
%{_includedir}/python3*/greenlet

%changelog
* Sun Jul 09 2017 Michel Alexandre Salim <releng@fedoraproject.org> - 0.4.11-1
- Initial el7 package, based on python-greenlet-0.4.11-3