]>
Commit | Line | Data |
---|---|---|
cd5c7a23 MK |
1 | # TODO: |
2 | # - Reviow commented patch | |
5bcb8431 | 3 | # - Chack why libffi-static needed ? Now there is only libffi-devel |
cd5c7a23 | 4 | |
d5e52ae4 | 5 | # Conditional build: |
8eee9219 | 6 | %bcond_with tests # do perform tests |
879c193f | 7 | %bcond_with bootstrap # use Python2 instead of PyPy |
d5e52ae4 JK |
8 | |
9 | %if %{without bootstrap} | |
10 | %define __python pypy | |
11 | %endif | |
12 | ||
13 | Summary: PyPy - a fast, alternative implementation of the Python language | |
14 | Name: pypy | |
cd5c7a23 | 15 | Version: 1.9 |
5368dfb8 | 16 | Release: 3 |
d5e52ae4 JK |
17 | License: distributable |
18 | Group: Development/Languages/Python | |
868e0e21 | 19 | Source0: https://bitbucket.org/pypy/pypy/get/release-%{version}.tar.bz2 |
cd5c7a23 | 20 | # Source0-md5: f92c0171a9578a3e4a0f74947ec596ab |
9cf3b6ee | 21 | Patch0: %{name}-curses.patch |
92ff825a | 22 | Patch1: %{name}-cldflags.patch |
d5e52ae4 | 23 | URL: http://pypy.org |
5bcb8431 | 24 | BuildRequires: libffi-devel |
d32f720c MK |
25 | BuildRequires: ncurses-devel |
26 | BuildRequires: openssl-devel | |
868e0e21 | 27 | BuildRequires: python-devel-tools |
28 | BuildRequires: rpm-pythonprov | |
d5e52ae4 JK |
29 | %if %{with bootstrap} |
30 | BuildRequires: python-modules | |
31 | %else | |
879c193f | 32 | BuildRequires: pypy |
d5e52ae4 JK |
33 | %endif |
34 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
35 | ||
8eee9219 JK |
36 | %define pypy_libdir %{_libdir}/%{name}-%{version} |
37 | ||
d5e52ae4 JK |
38 | %description |
39 | PyPy is a fast, compliant alternative implementation of the Python | |
40 | language (2.7.1). It has several advantages and distinct features: | |
41 | ||
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 | |
48 | and django. | |
49 | - Sandboxing: PyPy provides the ability to run untrusted code in a | |
50 | fully secure way. | |
51 | - Stackless: PyPy can be configured to run in stackless mode, | |
52 | providing micro-threads for massive concurrency. | |
53 | - As well as other features. | |
54 | ||
55 | %prep | |
cd5c7a23 MK |
56 | # %setup -q -n %{name}-%{name}-release-%{version} |
57 | %setup -q -n %{name}-%{name}-341e1e3821ff | |
9cf3b6ee | 58 | %patch0 -p1 |
cd5c7a23 | 59 | # %patch1 -p1 |
d5e52ae4 JK |
60 | |
61 | %build | |
cd5c7a23 | 62 | |
d5e52ae4 JK |
63 | cd pypy/translator/goal |
64 | CC="%{__cc}" \ | |
65 | CFLAGS="%{rpmcflags}" \ | |
92ff825a JK |
66 | LDFLAGS="%{rpmldflags}" \ |
67 | %{__python} translate.py -Ojit --make-jobs=1 | |
8eee9219 JK |
68 | cd ../../.. |
69 | ||
70 | %if %{with tests} | |
71 | pypy/translator/goal/pypy-c ./pytest.py | |
72 | %endif | |
d5e52ae4 JK |
73 | |
74 | %install | |
75 | rm -rf $RPM_BUILD_ROOT | |
76 | ||
8eee9219 JK |
77 | install -d $RPM_BUILD_ROOT{%{pypy_libdir},%{_bindir}} |
78 | ||
79 | cp -R ctypes_configure demo dotviewer include lib_pypy lib-python py pypy \ | |
80 | site-packages $RPM_BUILD_ROOT%{pypy_libdir} | |
81 | ||
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 | |
87 | ||
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@' | |
91 | ||
92 | ln -s %{pypy_libdir}/pypy/translator/goal/pypy-c $RPM_BUILD_ROOT%{_bindir}/pypy | |
93 | ||
d5e52ae4 JK |
94 | %clean |
95 | rm -rf $RPM_BUILD_ROOT | |
96 | ||
97 | %files | |
98 | %defattr(644,root,root,755) | |
8eee9219 | 99 | %doc README LICENSE pypy/doc |
d9d48c2c | 100 | %attr(755,root,root) %{_bindir}/pypy |
8eee9219 JK |
101 | %dir %{pypy_libdir} |
102 | %{pypy_libdir}/ctypes_configure | |
103 | %{pypy_libdir}/demo | |
104 | %{pypy_libdir}/dotviewer | |
105 | %{pypy_libdir}/include | |
106 | %{pypy_libdir}/lib-python | |
107 | %{pypy_libdir}/lib_pypy | |
108 | %{pypy_libdir}/py | |
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 | |
6c5c8f95 | 128 | %attr(755,root,root) %{pypy_libdir}/pypy/translator/goal/pypy-c |
8eee9219 JK |
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 | |
8eee9219 JK |
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 |