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
24 BuildRequires: libffi-devel
25 BuildRequires: ncurses-devel
26 BuildRequires: openssl-devel
27 BuildRequires: python-devel-tools
28 BuildRequires: rpm-pythonprov
30 BuildRequires: python-modules
34 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36 %define pypy_libdir %{_libdir}/%{name}-%{version}
39 PyPy is a fast, compliant alternative implementation of the Python
40 language (2.7.1). It has several advantages and distinct features:
42 - Speed: thanks to its Just-in-Time compiler, Python programs often
43 run faster on PyPy. (What is a JIT compiler?)
44 - Memory usage: large, memory-hungry Python programs might end up
45 taking less space than they do in CPython.
46 - Compatibility: PyPy is highly compatible with existing python code.
47 It supports ctypes and can run popular python libraries like twisted
49 - Sandboxing: PyPy provides the ability to run untrusted code in a
51 - Stackless: PyPy can be configured to run in stackless mode,
52 providing micro-threads for massive concurrency.
53 - As well as other features.
56 # %setup -q -n %{name}-%{name}-release-%{version}
57 %setup -q -n %{name}-%{name}-341e1e3821ff
63 cd pypy/translator/goal
65 CFLAGS="%{rpmcflags}" \
66 LDFLAGS="%{rpmldflags}" \
67 %{__python} translate.py -Ojit --make-jobs=1
71 pypy/translator/goal/pypy-c ./pytest.py
75 rm -rf $RPM_BUILD_ROOT
77 install -d $RPM_BUILD_ROOT{%{pypy_libdir},%{_bindir}}
79 cp -R ctypes_configure demo dotviewer include lib_pypy lib-python py pypy \
80 site-packages $RPM_BUILD_ROOT%{pypy_libdir}
82 rm -rf $RPM_BUILD_ROOT%{pypy_libdir}/pypy/doc \
83 $RPM_BUILD_ROOT%{pypy_libdir}/pypy/translator/goal/*.bat \
84 $RPM_BUILD_ROOT%{pypy_libdir}/pypy/translator/goal/test2 \
85 $RPM_BUILD_ROOT%{pypy_libdir}/pypy/translator/goal/win32 \
86 $RPM_BUILD_ROOT%{pypy_libdir}/site-packages/README
88 # do not require other python in installed scripts
89 find $RPM_BUILD_ROOT%{pypy_libdir} -name '*.py' | xargs \
90 sed -i -r -e'1s@^#! ?(/usr/bin/env python|/usr(/local)?/bin/python)@#!%{_bindir}/pypy@'
92 ln -s %{pypy_libdir}/pypy/translator/goal/pypy-c $RPM_BUILD_ROOT%{_bindir}/pypy
95 rm -rf $RPM_BUILD_ROOT
98 %defattr(644,root,root,755)
99 %doc README LICENSE pypy/doc
100 %attr(755,root,root) %{_bindir}/pypy
102 %{pypy_libdir}/ctypes_configure
104 %{pypy_libdir}/dotviewer
105 %{pypy_libdir}/include
106 %{pypy_libdir}/lib-python
107 %{pypy_libdir}/lib_pypy
109 %dir %{pypy_libdir}/pypy
110 %{pypy_libdir}/pypy/_cache
111 %{pypy_libdir}/pypy/annotation
112 %{pypy_libdir}/pypy/bin
113 %{pypy_libdir}/pypy/config
114 %{pypy_libdir}/pypy/interpreter
115 %{pypy_libdir}/pypy/jit
116 %{pypy_libdir}/pypy/module
117 %{pypy_libdir}/pypy/objspace
118 %{pypy_libdir}/pypy/rlib
119 %{pypy_libdir}/pypy/rpython
120 %{pypy_libdir}/pypy/tool
121 %dir %{pypy_libdir}/pypy/translator
122 %{pypy_libdir}/pypy/translator/backendopt
123 %{pypy_libdir}/pypy/translator/c
124 %{pypy_libdir}/pypy/translator/cli
125 %dir %{pypy_libdir}/pypy/translator/goal
126 %{pypy_libdir}/pypy/translator/goal/*.py
127 %{pypy_libdir}/pypy/translator/goal/*.pyc
128 %attr(755,root,root) %{pypy_libdir}/pypy/translator/goal/pypy-c
129 %{pypy_libdir}/pypy/translator/jvm
130 %{pypy_libdir}/pypy/translator/llsupport
131 %{pypy_libdir}/pypy/translator/microbench
132 %{pypy_libdir}/pypy/translator/oosupport
133 %{pypy_libdir}/pypy/translator/platform
134 %{pypy_libdir}/pypy/translator/sandbox
135 %{pypy_libdir}/pypy/translator/test
136 %{pypy_libdir}/pypy/translator/tool
137 %{pypy_libdir}/pypy/translator/*.py
138 %{pypy_libdir}/pypy/translator/*.pyc
139 %{pypy_libdir}/pypy/translator/goal/launch-bench-cronjob.sh
140 %{pypy_libdir}/pypy/*.py
141 %{pypy_libdir}/pypy/*.pyc
142 %{pypy_libdir}/pypy/*.cfg
143 %dir %{pypy_libdir}/site-packages