]> git.pld-linux.org Git - packages/python-greenlet.git/blob - python-greenlet.spec
ac5d6f36ba88ec6b3cf40cebbba30d885959a0c8
[packages/python-greenlet.git] / python-greenlet.spec
1 # Conditional build:
2 %bcond_without  tests   # do not perform "make test"
3 %bcond_without  python2 # CPython 2.x module
4 %bcond_without  python3 # CPython 3.x module
5 %bcond_without  python2_tests # CPython 2.x module tests
6
7 %if %{without tests}
8 %undefine       with_python2_tests
9 %endif
10
11 %define         module  greenlet
12 Summary:        Lightweight in-process concurrent programming
13 Name:           python-%{module}
14 Version:        0.4.5
15 Release:        3
16 License:        MIT & PSF
17 Group:          Libraries/Python
18 Source0:        http://pypi.python.org/packages/source/g/greenlet/%{module}-%{version}.zip
19 # Source0-md5:  ce383f6475e6311cf8932ea779938703
20 URL:            http://pypi.python.org/pypi/greenlet
21 BuildRequires:  rpm-pythonprov
22 BuildRequires:  rpmbuild(macros) >= 1.219
23 %if %{with python2}
24 BuildRequires:  python-devel
25 BuildRequires:  python-setuptools
26 %endif
27 %if %{with python3}
28 BuildRequires:  python3-2to3
29 BuildRequires:  python3-devel
30 BuildRequires:  python3-distribute
31 BuildRequires:  python3-modules
32 %endif
33 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34
35 # -fno-tree-dominator-opts because https://bugzilla.opensuse.org/show_bug.cgi?id=902146
36 %define         specflags_x32   -fno-tree-dominator-opts
37
38 %description
39 The greenlet package is a spin-off of Stackless, a version of CPython
40 that supports micro-threads called "tasklets". Tasklets run
41 pseudo-concurrently (typically in a single or a few OS-level threads)
42 and are synchronized with data exchanges on "channels".
43
44 %package devel
45 Summary:        C development headers for python-greenlet
46 Group:          Development/Libraries
47 Requires:       %{name} = %{version}-%{release}
48
49 %description devel
50 This package contains header files required for C modules development.
51
52 %package -n python3-%{module}
53 Summary:        Lightweight in-process concurrent programming
54 Group:          Libraries/Python
55
56 %description -n python3-%{module}
57 The greenlet package is a spin-off of Stackless, a version of CPython
58 that supports micro-threads called "tasklets". Tasklets run
59 pseudo-concurrently (typically in a single or a few OS-level threads)
60 and are synchronized with data exchanges on "channels".
61
62 %package -n python3-%{module}-devel
63 Summary:        C development headers for python3-greenlet
64 Group:          Development/Libraries
65 Requires:       python3-%{module} = %{version}-%{release}
66
67 %description -n python3-%{module}-devel
68 This package contains header files required for C modules development.
69
70 %prep
71 %setup -q -n greenlet-%{version}
72
73 %build
74 %if %{with python2}
75 CC="%{__cc}" \
76 CFLAGS="%{rpmcflags} " \
77 %{__python} setup.py build
78
79 %if %{with python2_tests}
80 %{__python} setup.py test
81
82 # Run the upstream benchmarking suite to further exercise the code:
83 PYTHONPATH=$(echo $(pwd)/build/lib.*-2.?) %{__python} benchmarks/chain.py
84 %endif
85 %endif
86
87 %if %{with python3}
88 CC="%{__cc}" \
89 CFLAGS="%{rpmcflags}" \
90 %{__python3} setup.py build %{?with_tests:test}
91
92 %if %{with tests}
93 # Run the upstream benchmarking suite to further exercise the code:
94 mkdir -p benchmarks-3
95 2to3-3.4 -o benchmarks-3 -n -w --no-diffs benchmarks
96 PYTHONPATH=$(echo $(pwd)/build/lib.*-3.?) %{__python3} benchmarks-3/chain.py
97 %endif
98 %endif
99
100 %install
101 rm -rf $RPM_BUILD_ROOT
102 %if %{with python2}
103 %{__python} setup.py \
104         install --skip-build \
105         --optimize=2 \
106         --root=$RPM_BUILD_ROOT
107
108 %py_postclean
109 %endif
110
111 %if %{with python3}
112 %{__python3} setup.py \
113         install --skip-build \
114         --optimize=2 \
115         --root=$RPM_BUILD_ROOT
116 %endif
117
118 %clean
119 rm -rf $RPM_BUILD_ROOT
120
121 %files
122 %defattr(644,root,root,755)
123 %doc doc/greenlet.txt README.rst benchmarks AUTHORS NEWS LICENSE
124 %attr(755,root,root) %{py_sitedir}/%{module}.so
125 %{py_sitedir}/%{module}*.egg-info
126
127 %files devel
128 %defattr(644,root,root,755)
129 %{_includedir}/python%{py_ver}/greenlet
130
131 %files -n python3-%{module}
132 %defattr(644,root,root,755)
133 %doc doc/greenlet.txt README.rst benchmarks AUTHORS NEWS LICENSE
134 %attr(755,root,root) %{py3_sitedir}/%{module}.*.so
135 %{py3_sitedir}/%{module}*.egg-info
136
137 %files -n python3-%{module}-devel
138 %defattr(644,root,root,755)
139 %{_includedir}/python%{py3_ver}*/greenlet
This page took 0.053194 seconds and 2 git commands to generate.