2 # - Reviow commented patch
3 # - Chack why libffi-static needed ? Now there is only libffi-devel
6 %bcond_with tests # do perform tests
7 %bcond_with bootstrap # use Python2 instead of PyPy
9 %if %{without bootstrap}
13 Summary: PyPy - a fast, alternative implementation of the Python language
17 License: distributable
18 Group: Development/Languages/Python
19 Source0: https://bitbucket.org/pypy/pypy/get/release-%{version}.tar.bz2
20 # Source0-md5: f92c0171a9578a3e4a0f74947ec596ab
21 Patch0: %{name}-curses.patch
22 Patch1: %{name}-cldflags.patch
23 Patch2: 006-always-log-stdout.patch
24 Patch3: 007-remove-startup-message.patch
25 Patch4: 008-fix-dynamic-symbols-script.patch
26 Patch5: pypy-1.2-suppress-mandelbrot-set-during-tty-build.patch
28 BuildRequires: libffi-devel
29 BuildRequires: ncurses-devel
30 BuildRequires: openssl-devel
31 BuildRequires: python-devel-tools
32 BuildRequires: rpm-pythonprov
34 BuildRequires: python-modules
38 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
40 %define pypy_libdir %{_libdir}/%{name}-%{version}
43 PyPy is a fast, compliant alternative implementation of the Python
44 language (2.7.1). It has several advantages and distinct features:
46 - Speed: thanks to its Just-in-Time compiler, Python programs often
47 run faster on PyPy. (What is a JIT compiler?)
48 - Memory usage: large, memory-hungry Python programs might end up
49 taking less space than they do in CPython.
50 - Compatibility: PyPy is highly compatible with existing python code.
51 It supports ctypes and can run popular python libraries like twisted
53 - Sandboxing: PyPy provides the ability to run untrusted code in a
55 - Stackless: PyPy can be configured to run in stackless mode,
56 providing micro-threads for massive concurrency.
57 - As well as other features.
60 # %setup -q -n %{name}-%{name}-release-%{version}
61 %setup -q -n %{name}-%{name}-341e1e3821ff
71 cd pypy/translator/goal
73 CFLAGS="%{rpmcflags}" \
74 LDFLAGS="%{rpmldflags}" \
75 %{__python} translate.py \
79 --gcrootfinder=shadowstack
83 pypy/translator/goal/pypy-c ./pytest.py
87 rm -rf $RPM_BUILD_ROOT
89 install -d $RPM_BUILD_ROOT{%{pypy_libdir},%{_bindir}}
91 cp -R ctypes_configure demo dotviewer include lib_pypy lib-python py pypy \
92 site-packages $RPM_BUILD_ROOT%{pypy_libdir}
94 rm -rf $RPM_BUILD_ROOT%{pypy_libdir}/pypy/doc \
95 $RPM_BUILD_ROOT%{pypy_libdir}/pypy/translator/goal/*.bat \
96 $RPM_BUILD_ROOT%{pypy_libdir}/pypy/translator/goal/test2 \
97 $RPM_BUILD_ROOT%{pypy_libdir}/pypy/translator/goal/win32 \
98 $RPM_BUILD_ROOT%{pypy_libdir}/site-packages/README
100 # do not require other python in installed scripts
101 find $RPM_BUILD_ROOT%{pypy_libdir} -name '*.py' | xargs \
102 sed -i -r -e'1s@^#! ?(/usr/bin/env python|/usr(/local)?/bin/python)@#!%{_bindir}/pypy@'
104 ln -s %{pypy_libdir}/pypy/translator/goal/pypy-c $RPM_BUILD_ROOT%{_bindir}/pypy
107 rm -rf $RPM_BUILD_ROOT
110 %defattr(644,root,root,755)
111 %doc README LICENSE pypy/doc
112 %attr(755,root,root) %{_bindir}/pypy
114 %{pypy_libdir}/ctypes_configure
116 %{pypy_libdir}/dotviewer
117 %{pypy_libdir}/include
118 %{pypy_libdir}/lib-python
119 %{pypy_libdir}/lib_pypy
121 %dir %{pypy_libdir}/pypy
122 %{pypy_libdir}/pypy/_cache
123 %{pypy_libdir}/pypy/annotation
124 %{pypy_libdir}/pypy/bin
125 %{pypy_libdir}/pypy/config
126 %{pypy_libdir}/pypy/interpreter
127 %{pypy_libdir}/pypy/jit
128 %{pypy_libdir}/pypy/module
129 %{pypy_libdir}/pypy/objspace
130 %{pypy_libdir}/pypy/rlib
131 %{pypy_libdir}/pypy/rpython
132 %{pypy_libdir}/pypy/tool
133 %dir %{pypy_libdir}/pypy/translator
134 %{pypy_libdir}/pypy/translator/backendopt
135 %{pypy_libdir}/pypy/translator/c
136 %{pypy_libdir}/pypy/translator/cli
137 %dir %{pypy_libdir}/pypy/translator/goal
138 %{pypy_libdir}/pypy/translator/goal/*.py
139 %{pypy_libdir}/pypy/translator/goal/*.pyc
140 %attr(755,root,root) %{pypy_libdir}/pypy/translator/goal/pypy-c
141 %{pypy_libdir}/pypy/translator/jvm
142 %{pypy_libdir}/pypy/translator/llsupport
143 %{pypy_libdir}/pypy/translator/microbench
144 %{pypy_libdir}/pypy/translator/oosupport
145 %{pypy_libdir}/pypy/translator/platform
146 %{pypy_libdir}/pypy/translator/sandbox
147 %{pypy_libdir}/pypy/translator/test
148 %{pypy_libdir}/pypy/translator/tool
149 %{pypy_libdir}/pypy/translator/*.py
150 %{pypy_libdir}/pypy/translator/*.pyc
151 %{pypy_libdir}/pypy/translator/goal/launch-bench-cronjob.sh
152 %{pypy_libdir}/pypy/*.py
153 %{pypy_libdir}/pypy/*.pyc
154 %{pypy_libdir}/pypy/*.cfg
155 %dir %{pypy_libdir}/site-packages