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