]>
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 |
d928d70a | 16 | Release: 5 |
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 |
d928d70a AM |
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 | |
d5e52ae4 | 27 | URL: http://pypy.org |
5bcb8431 | 28 | BuildRequires: libffi-devel |
d32f720c MK |
29 | BuildRequires: ncurses-devel |
30 | BuildRequires: openssl-devel | |
868e0e21 | 31 | BuildRequires: python-devel-tools |
32 | BuildRequires: rpm-pythonprov | |
d5e52ae4 JK |
33 | %if %{with bootstrap} |
34 | BuildRequires: python-modules | |
35 | %else | |
879c193f | 36 | BuildRequires: pypy |
d5e52ae4 JK |
37 | %endif |
38 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
39 | ||
8eee9219 JK |
40 | %define pypy_libdir %{_libdir}/%{name}-%{version} |
41 | ||
d5e52ae4 JK |
42 | %description |
43 | PyPy is a fast, compliant alternative implementation of the Python | |
44 | language (2.7.1). It has several advantages and distinct features: | |
45 | ||
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 | |
52 | and django. | |
53 | - Sandboxing: PyPy provides the ability to run untrusted code in a | |
54 | fully secure way. | |
55 | - Stackless: PyPy can be configured to run in stackless mode, | |
56 | providing micro-threads for massive concurrency. | |
57 | - As well as other features. | |
58 | ||
59 | %prep | |
cd5c7a23 MK |
60 | # %setup -q -n %{name}-%{name}-release-%{version} |
61 | %setup -q -n %{name}-%{name}-341e1e3821ff | |
9cf3b6ee | 62 | %patch0 -p1 |
cd5c7a23 | 63 | # %patch1 -p1 |
d928d70a AM |
64 | %patch2 -p1 |
65 | %patch3 -p1 | |
66 | %patch4 -p1 | |
67 | %patch5 -p1 | |
d5e52ae4 JK |
68 | |
69 | %build | |
cd5c7a23 | 70 | |
d5e52ae4 JK |
71 | cd pypy/translator/goal |
72 | CC="%{__cc}" \ | |
73 | CFLAGS="%{rpmcflags}" \ | |
92ff825a | 74 | LDFLAGS="%{rpmldflags}" \ |
d928d70a AM |
75 | %{__python} translate.py \ |
76 | -Ojit \ | |
77 | --make-jobs=1 \ | |
78 | --batch \ | |
79 | --gcrootfinder=shadowstack | |
8eee9219 JK |
80 | cd ../../.. |
81 | ||
82 | %if %{with tests} | |
83 | pypy/translator/goal/pypy-c ./pytest.py | |
84 | %endif | |
d5e52ae4 JK |
85 | |
86 | %install | |
87 | rm -rf $RPM_BUILD_ROOT | |
88 | ||
8eee9219 JK |
89 | install -d $RPM_BUILD_ROOT{%{pypy_libdir},%{_bindir}} |
90 | ||
91 | cp -R ctypes_configure demo dotviewer include lib_pypy lib-python py pypy \ | |
92 | site-packages $RPM_BUILD_ROOT%{pypy_libdir} | |
93 | ||
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 | |
99 | ||
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@' | |
103 | ||
104 | ln -s %{pypy_libdir}/pypy/translator/goal/pypy-c $RPM_BUILD_ROOT%{_bindir}/pypy | |
105 | ||
d5e52ae4 JK |
106 | %clean |
107 | rm -rf $RPM_BUILD_ROOT | |
108 | ||
109 | %files | |
110 | %defattr(644,root,root,755) | |
8eee9219 | 111 | %doc README LICENSE pypy/doc |
d9d48c2c | 112 | %attr(755,root,root) %{_bindir}/pypy |
8eee9219 JK |
113 | %dir %{pypy_libdir} |
114 | %{pypy_libdir}/ctypes_configure | |
115 | %{pypy_libdir}/demo | |
116 | %{pypy_libdir}/dotviewer | |
117 | %{pypy_libdir}/include | |
118 | %{pypy_libdir}/lib-python | |
119 | %{pypy_libdir}/lib_pypy | |
120 | %{pypy_libdir}/py | |
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 | |
6c5c8f95 | 140 | %attr(755,root,root) %{pypy_libdir}/pypy/translator/goal/pypy-c |
8eee9219 JK |
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 | |
8eee9219 JK |
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 |