]>
Commit | Line | Data |
---|---|---|
bf250edf MT |
1 | ############################################################################### |
2 | # IPFire.org - An Open Source Firewall Solution # | |
3 | # Copyright (C) - IPFire Development Team <info@ipfire.org> # | |
4 | ############################################################################### | |
5 | ||
6 | name = python3 | |
7 | major_ver = 3.3 | |
8 | version = %{major_ver}.0 | |
9 | release = 1 | |
10 | thisapp = Python-%{version} | |
11 | ||
12 | groups = Development/Languages | |
13 | url = http://www.python.org | |
14 | license = Python | |
15 | summary = Version 3 of the Python programming language. | |
16 | ||
17 | description | |
18 | Python is an interpreted, interactive, object-oriented programming | |
19 | language often compared to Tcl, Perl, Scheme or Java. Python includes | |
20 | modules, classes, exceptions, very high level dynamic data types and | |
21 | dynamic typing. Python supports interfaces to many system calls and | |
22 | libraries, as well as to various windowing systems. | |
23 | end | |
24 | ||
25 | source_dl = http://python.org/ftp/python/%{version}/ | |
26 | sources = %{thisapp}.tar.xz | |
27 | ||
28 | pylibdir = %{libdir}/python%{major_ver} | |
29 | dynload_dir= %{pylibdir}/lib-dynload | |
30 | ||
31 | build | |
32 | requires | |
33 | autoconf | |
34 | automake | |
35 | bzip2 | |
36 | bzip2-devel | |
37 | db4-devel >= 1:4.8 | |
38 | expat-devel >= 2.1.0 | |
39 | findutils | |
40 | gdbm-devel >= 1.10 | |
41 | gcc-c++ | |
42 | glibc-devel | |
43 | gmp-devel | |
44 | libffi-devel | |
45 | libGL-devel | |
46 | libX11-devel | |
47 | ncurses-devel | |
48 | openssl-devel | |
49 | pkg-config | |
50 | readline-devel | |
51 | sqlite-devel | |
52 | tar | |
53 | tcl-devel | |
54 | util-linux | |
55 | xz-devel | |
56 | zlib-devel | |
57 | end | |
58 | ||
59 | export CFLAGS += -D_GNU_SOURCE -fwrapv | |
60 | export CXXFLAGS += -D_GNU_SOURCE -fwrapv | |
61 | export OPT = %{CFLAGS} | |
62 | export LINKCC = gcc | |
63 | ||
64 | prepare_cmds | |
65 | # Apply patches for x86_64. | |
66 | if [ "$(uname -m)" = "x86_64" ]; then | |
67 | patch -Np1 -i %{DIR_SOURCE}/python-3.3.0b1-lib64.patch | |
68 | fi | |
69 | ||
70 | # Remove embedded copies of expat and libffi | |
71 | rm -rf Modules/{expat,zlib} | |
72 | rm -rf Modules/_ctypes/{darwin,libffi,libffi_arm_wince,libffi_msvc,libffi_osx} | |
73 | ||
74 | # Make all source files owned by root. | |
75 | chown root.root -R . | |
76 | ||
77 | autoreconf --force | |
78 | end | |
79 | ||
80 | configure_options += \ | |
81 | --enable-ipv6 \ | |
82 | --with-computed-gotos=yes \ | |
83 | --with-dbmliborder=gdbm:ndbm:bdb \ | |
84 | --with-system-expat \ | |
85 | --with-system-ffi \ | |
86 | --enable-shared | |
87 | ||
88 | #test | |
89 | # make test | |
90 | #end | |
91 | ||
92 | install_cmds | |
93 | install -d -m 0755 %{BUILDROOT}%{pylibdir}/site-packages/__pycache__ | |
94 | install -d -m 0755 %{BUILDROOT}/usr/lib/python${major_ver}/site-packages/__pycache__ | |
95 | ||
96 | # Development tools | |
97 | mv -v %{BUILDROOT}%{bindir}/{,python3-}2to3 | |
98 | install -m 755 -d %{BUILDROOT}%{pylibdir}/Tools | |
99 | install Tools/README %{BUILDROOT}%{pylibdir}/Tools/ | |
100 | cp -avr Tools/{freeze,i18n,pynche,scripts} %{BUILDROOT}%{pylibdir}/Tools/ | |
101 | ||
102 | rm -vf %{BUILDROOT}%{pylibdir}/email/test/data/audiotest.au %{BUILDROOT}%{pylibdir}/test/audiotest.au | |
103 | ||
104 | # Switch all shebangs to refer to the specific Python version. | |
105 | LD_LIBRARY_PATH=. ./python Tools/scripts/pathfix.py \ | |
106 | -i "%{bindir}/python%{major_ver}" \ | |
107 | %{BUILDROOT} | |
108 | ||
109 | # Remove shebang lines from .py files that aren't executable, and | |
110 | # remove executability from .py files that don't have a shebang line: | |
111 | find %{BUILDROOT} -name \*.py \ | |
112 | \( \( \! -perm /u+x,g+x,o+x -exec sed -e '/^#!/Q 0' -e 'Q 1' {} \; \ | |
113 | -print -exec sed -i '1d' {} \; \) -o \( \ | |
114 | -perm /u+x,g+x,o+x ! -exec grep -m 1 -q '^#!' {} \; \ | |
115 | -exec chmod a-x {} \; \) \) | |
116 | ||
117 | # .xpm and .xbm files should not be executable: | |
118 | find %{BUILDROOT} \ | |
119 | \( -name \*.xbm -o -name \*.xpm -o -name \*.xpm.1 \) \ | |
120 | -exec chmod a-x {} \; | |
121 | ||
122 | # Remove executable flag from files that shouldn't have it: | |
123 | chmod a-x \ | |
124 | %{BUILDROOT}%{pylibdir}/distutils/tests/Setup.sample \ | |
125 | %{BUILDROOT}%{pylibdir}/Tools/README | |
126 | ||
127 | # Get rid of DOS batch files: | |
128 | find %{BUILDROOT} -name \*.bat -exec rm {} \; | |
129 | ||
130 | # Get rid of backup files: | |
131 | find %{BUILDROOT}/ -name "*~" -exec rm -f {} \; | |
132 | rm -f %{BUILDROOT}%{pylibdir}/LICENSE.txt | |
133 | ||
134 | # Junk, no point in putting in -test sub-pkg | |
135 | rm -f %{BUILDROOT}%{pylibdir}/idlelib/testcode.py* | |
136 | ||
137 | # Fix end-of-line encodings: | |
138 | find %{BUILDROOT}/ -name \*.py -exec sed -i 's/\r//' {} \; | |
139 | ||
140 | # Do bytecompilation with the newly installed interpreter. | |
141 | # compile *.pyo | |
142 | find %{BUILDROOT} -type f -a -name "*.py" -print0 | \ | |
143 | LD_LIBRARY_PATH="%{BUILDROOT}%{dynload_dir}:%{BUILDROOT}%{libdir}" \ | |
144 | PYTHONPATH="%{BUILDROOT}%{libdir}python%{major_ver} %{BUILDROOT}/%{libdir}python%{major_ver}/site-packages" \ | |
145 | xargs -0 %{BUILDROOT}%{bindir}/python%{major_ver} -O -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("%{BUILDROOT}")[2]) for f in sys.argv[1:]]' || : | |
146 | # compile *.pyc | |
147 | find %{BUILDROOT} -type f -a -name "*.py" -print0 | \ | |
148 | LD_LIBRARY_PATH="%{BUILDROOT}%{dynload_dir}:%{BUILDROOT}%{libdir}" \ | |
149 | PYTHONPATH="%{BUILDROOT}%{libdir}python%{major_ver} %{BUILDROOT}/%{libdir}python%{major_ver}/site-packages" \ | |
150 | xargs -0 %{BUILDROOT}%{bindir}/python%{major_ver} -O -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("%{BUILDROOT}")[2], optimize=0) for f in sys.argv[1:]]' || : | |
151 | ||
152 | # Fixup permissions for shared libraries from non-standard 555 to standard 755: | |
153 | find %{BUILDROOT} -perm 555 -exec chmod 755 {} \; | |
154 | end | |
155 | end | |
156 | ||
157 | packages | |
158 | package %{name} | |
159 | # Define python-abi manually. | |
160 | provides | |
161 | python-abi = %{major_ver} | |
162 | end | |
163 | ||
164 | requires | |
165 | %{name}-libs = %{thisver} | |
166 | end | |
167 | end | |
168 | ||
169 | package %{name}-libs | |
170 | template LIBS | |
171 | ||
172 | requires | |
173 | expat >= 2.1.0 | |
174 | end | |
175 | ||
176 | files += %{dynload_dir} | |
177 | end | |
178 | ||
179 | package %{name}-devel | |
180 | template DEVEL | |
181 | ||
182 | requires += %{name}-libs = %{thisver} | |
183 | ||
184 | files += \ | |
185 | !%{libdir}/python*/config*/Makefile \ | |
186 | !%{includedir}/python*/pyconfig.h | |
187 | end | |
188 | ||
189 | package %{name}-test | |
190 | requires | |
191 | %{name} = %{thisver} | |
192 | end | |
193 | ||
194 | files | |
195 | %{pylibdir}/ctypes/test | |
196 | %{pylibdir}/distutils/testi | |
197 | %{pylibdir}/lib2to3/test | |
198 | %{pylibdir}/sqlite3/test | |
199 | %{pylibdir}/test | |
200 | %{pylibdir}/tkinter/test | |
201 | %{pylibdir}/unittest/test | |
202 | %{dynload_dir}/_ctypes_test* | |
203 | %{dynload_dir}/_testbuffer* | |
204 | %{dynload_dir}/_testcapi* | |
205 | end | |
206 | end | |
207 | ||
208 | package %{name}-tools | |
209 | requires | |
210 | %{name} = %{thisver} | |
211 | end | |
212 | ||
213 | files | |
214 | %{bindir}/python3-2to3 | |
215 | %{bindir}/2to3* | |
216 | %{bindir}/idle* | |
217 | %{pylibdir}/Tools | |
218 | end | |
219 | end | |
220 | ||
221 | package %{name}-debuginfo | |
222 | template DEBUGINFO | |
223 | end | |
224 | end |