/[packages]/cauldron/python3/current/SPECS/python3.spec
ViewVC logotype

Contents of /cauldron/python3/current/SPECS/python3.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1351038 - (show annotations) (download)
Mon Jan 7 16:56:41 2019 UTC (5 years, 2 months ago) by wally
File size: 32872 byte(s)
- update versions for bundled pip and setuptools (SILENT)
1 # NOTES ON BOOTSTRAPING PYTHON 3.x:
2 #
3 # Due to a dependency cycle between Python, rpm, pip, setuptools, wheel,
4 # and other packages, in order to rebase Python 3 one has to build in the
5 # following order:
6 #
7 # 1. gdb %%bcond_with python
8 # 2. rpm-mageia-setup %%bcond_without bootstrap
9 # 3. python-rpm-generators %%define bootstrapping_python 1
10 # 4 python3 (if python3 is build to core/udpates_testing there's no need to use %bcond_with rpmwheels)
11 # 5. python-setuptools %%bcond_without bootstrap
12 # 6. python-rpm-generators %%define bootstrapping_python 0
13 # 7. python-pip %%bcond_without bootstrap
14 # 8. python-wheel %%bcond_without bootstrap
15 # 9. python-setuptools %%bcond_with bootstrap
16 # 10. python-pip %%bcond_with bootstrap
17 # 11. python-wheel %%bcond_with bootstrap
18 # 12. rpm
19 # 13. gdb %%bcond_without python
20 # 14. meson
21 # 15. python-coverage
22 # 16. python-nose
23 # 17. python-cython
24 # 18. python-yaml
25 # 19. python-markdown
26 # 20. python-markupsafe
27 # 21. python-beaker
28 # 22. python-six
29 # 23. python-pbr
30 # 24. python-argparse
31 # 25. python-traceback2
32 # 26. python-linecache2
33 # 27. python-unittest2
34 # 28. python-funcsigs
35 # 29. python-mock
36 # 30. python-mako
37 # 31. gobject-introspection
38 # 32. python-enchant
39 # 33. file
40 # 34. rpmlint
41 # 35. rpm-mageia-setup %%bcond_with bootstrap
42
43 # Then the most important packages have to be built, starting from their
44 # various leaf dependencies recursively. After these have been built, a
45 # targeted rebuild should be requested for the rest.
46 #
47 # Currently these packages are recommended to have been built before a targeted
48 # rebuild after a python abi change:
49 # python-sphinx, python-pytest, python-requests
50
51 %global docver 3.7.2
52
53 %global pybasever 3.7
54 %global familyver 3
55
56 #pybasever without the dot:
57 %global pyshortver 37
58
59 # Whether to use RPM build wheels from the python-{pip,setuptools}-wheel package
60 # Uses upstream bundled prebuilt wheels otherwise
61 %bcond_without rpmwheels
62
63 # Run the test suite in %%check
64 %bcond_without tests
65
66 # Support for the GDB debugger
67 %bcond_without gdb_hooks
68
69 # The dbm.gnu module (key-value database)
70 %bcond_without gdbm
71
72 # Support for the Valgrind debugger/profiler
73 %ifarch %{valgrind_arches}
74 %bcond_without valgrind
75 %else
76 %bcond_with valgrind
77 %endif
78
79 # Some defines to ease files list
80 %global pylibdir %{_libdir}/python%{pybasever}
81 %global dynload_dir %{pylibdir}/lib-dynload
82 %global site_packages %{pylibdir}/site-packages
83
84 # ABIFLAGS, LDVERSION and SOABI are in the upstream configure.ac
85 # See PEP 3149 for some background: http://www.python.org/dev/peps/pep-3149/
86 %global ABIFLAGS_optimized m
87
88 %global LDVERSION_optimized %{pybasever}%{ABIFLAGS_optimized}
89
90 %global SOABI_optimized cpython-%{pyshortver}%{ABIFLAGS_optimized}-%{_arch}-linux%{_gnu}
91
92 # All bytecode files are in a __pycache__ subdirectory, with a name
93 # reflecting the version of the bytecode.
94 # See PEP 3147: http://www.python.org/dev/peps/pep-3147/
95 # For example,
96 # foo/bar.py
97 # has bytecode at:
98 # foo/__pycache__/bar.cpython-%%{pyshortver}.pyc
99 # foo/__pycache__/bar.cpython-%%{pyshortver}.opt-1.pyc
100 # foo/__pycache__/bar.cpython-%%{pyshortver}.opt-2.pyc
101 %global bytecode_suffixes .cpython-%{pyshortver}*.py?
102
103 # Disable automatic bytecompilation. The python3 binary is not yet be
104 # available in /usr/bin when Python is built. Also, the bytecompilation fails
105 # on files that test invalid syntax.
106 %global __brp_python_bytecompile %nil
107
108 %define lib_major %{pybasever}
109 %define lib_name_orig libpython%{familyver}
110 %define lib_name %mklibname python %{lib_major}
111 %define develname %mklibname python3 -d
112
113 Summary: An interpreted, interactive object-oriented programming language
114 Name: python3
115 Version: 3.7.2
116 Release: %mkrel 1
117 License: Modified CNRI Open Source License
118 Group: Development/Python
119
120 BuildRequires: automake
121 BuildRequires: gcc-c++
122 BuildRequires: blt
123 BuildRequires: db-devel
124 BuildRequires: pkgconfig(expat)
125 BuildRequires: gdbm-devel
126 BuildRequires: gmp-devel
127 BuildRequires: pkgconfig(libffi)
128 BuildRequires: pkgconfig(ncursesw)
129 BuildRequires: pkgconfig(openssl)
130 BuildRequires: readline-devel
131 BuildRequires: termcap-devel
132 BuildRequires: tcl
133 BuildRequires: pkgconfig(tcl)
134 BuildRequires: tk
135 BuildRequires: pkgconfig(tk)
136 BuildRequires: autoconf
137 BuildRequires: bzip2-devel
138 BuildRequires: pkgconfig(sqlite3)
139 BuildRequires: pkgconfig(liblzma)
140 # uncomment once the emacs part no longer conflict with python 2.X
141 #BuildRequires: emacs
142 #BuildRequires: emacs-bin
143 %if %{with valgrind}
144 BuildRequires: pkgconfig(valgrind)
145 %endif
146
147 %if %{with rpmwheels}
148 BuildRequires: python-setuptools-wheel
149 BuildRequires: python-pip-wheel
150 %endif
151
152 Source0: https://www.python.org/ftp/python/%{version}/Python-%{version}.tar.xz
153 Source1: https://docs.python.org/%{pybasever}/archives/python-%{docver}-docs-html.tar.bz2
154
155 # A simple script to check timestamps of bytecode files
156 # Run in check section with Python that is currently being built
157 # Originally written by bkabrda
158 Source8: check-pyc-timestamps.py
159
160 #
161 # Upstream patches
162 #
163
164 #
165 # Fedora patches
166 #
167
168 # 00001 #
169 # Fixup distutils/unixccompiler.py to remove standard library path from rpath:
170 # Was Patch0 in ivazquez' python3000 specfile:
171 Patch1: 00001-rpath.patch
172
173 # 00102 #
174 # Change the various install paths to use /usr/lib64/ instead or /usr/lib
175 # Only used when "%%{_lib}" == "lib64"
176 # Not yet sent upstream.
177 Patch102: 00102-lib64.patch
178
179 # 00111 #
180 # Patch the Makefile.pre.in so that the generated Makefile doesn't try to build
181 # a libpythonMAJOR.MINOR.a
182 # See https://bugzilla.redhat.com/show_bug.cgi?id=556092
183 # Downstream only: not appropriate for upstream
184 Patch111: 00111-no-static-lib.patch
185
186 # 00132 #
187 # Add non-standard hooks to unittest for use in the "check" phase below, when
188 # running selftests within the build:
189 # @unittest._skipInRpmBuild(reason)
190 # for tests that hang or fail intermittently within the build environment, and:
191 # @unittest._expectedFailureInRpmBuild
192 # for tests that always fail within the build environment
193 #
194 # The hooks only take effect if WITHIN_PYTHON_RPM_BUILD is set in the
195 # environment, which we set manually in the appropriate portion of the "check"
196 # phase below (and which potentially other python-* rpms could set, to reuse
197 # these unittest hooks in their own "check" phases)
198 Patch132: 00132-add-rpmbuild-hooks-to-unittest.patch
199
200 # 00155 #
201 # Avoid allocating thunks in ctypes unless absolutely necessary, to avoid
202 # generating SELinux denials on "import ctypes" and "import uuid" when
203 # embedding Python within httpd
204 # See https://bugzilla.redhat.com/show_bug.cgi?id=814391
205 Patch155: 00155-avoid-ctypes-thunks.patch
206
207 # 00160 #
208 # Python 3.3 added os.SEEK_DATA and os.SEEK_HOLE, which may be present in the
209 # header files in the build chroot, but may not be supported in the running
210 # kernel, hence we disable this test in an rpm build.
211 # Adding these was upstream issue http://bugs.python.org/issue10142
212 # Not yet sent upstream
213 Patch160: 00160-disable-test_fs_holes-in-rpm-build.patch
214
215 # 00163 #
216 # Some tests within test_socket fail intermittently when run inside Koji;
217 # disable them using unittest._skipInRpmBuild
218 # Not yet sent upstream
219 Patch163: 00163-disable-parts-of-test_socket-in-rpm-build.patch
220
221 # 00170 #
222 # In debug builds, try to print repr() when a C-level assert fails in the
223 # garbage collector (typically indicating a reference-counting error
224 # somewhere else e.g in an extension module)
225 # The new macros/functions within gcmodule.c are hidden to avoid exposing
226 # them within the extension API.
227 # Sent upstream: http://bugs.python.org/issue9263
228 # See https://bugzilla.redhat.com/show_bug.cgi?id=614680
229 Patch170: 00170-gc-assertions.patch
230
231 # 00178 #
232 # Don't duplicate various FLAGS in sysconfig values
233 # http://bugs.python.org/issue17679
234 # Does not affect python2 AFAICS (different sysconfig values initialization)
235 Patch178: 00178-dont-duplicate-flags-in-sysconfig.patch
236
237 # 00189 #
238 # Instead of bundled wheels, use our RPM packaged wheels from
239 # /usr/share/python-wheels
240 Patch189: 00189-use-rpm-wheels.patch
241
242 # 00205 #
243 # LIBPL variable in makefile takes LIBPL from configure.ac
244 # but the LIBPL variable defined there doesn't respect libdir macro
245 Patch205: 00205-make-libpl-respect-lib64.patch
246
247 # 00251
248 # Set values of prefix and exec_prefix in distutils install command
249 # to /usr/local if executable is /usr/bin/python* and RPM build
250 # is not detected to make pip and distutils install into separate location
251 # Fedora Change: https://fedoraproject.org/wiki/Changes/Making_sudo_pip_safe
252 Patch251: 00251-change-user-install-location.patch
253
254 # 00312 #
255 # Revert "bpo-6721: Hold logging locks across fork() 3b699932e5ac3e7
256 # This is a TEMPORARY WORKAROUND for an urgent Fedora bug
257 # TODO Investigate properly and get a real fix (here or in anaconda)!
258 # See: https://bugzilla.redhat.com/show_bug.cgi?id=1644936
259 Patch312: 00312-revert-bpo-6721.patch
260
261 # 00316 #
262 # We remove the exe files from distutil's bdist_wininst
263 # So we mark the command as unsupported - and the tests are skipped
264 Patch316: 00316-mark-bdist_wininst-unsupported.patch
265
266 #
267 # Mageia patches
268 #
269 Patch500: python3-3.7.1-module-linkage.patch
270 Patch501: python3-3.5.2-skip-distutils-tests-that-fail-in-rpmbuild.patch
271 Patch502: python3-3.7.1-uid-gid-overflows.patch
272 Patch503: python3-3.5.2-dont-raise-from-py_compile.patch
273 Patch504: python3-3.5.2-remove-hf-from-arm-triplet.patch
274 Patch506: python3-3.6.2-python3-config-LIBPLUSED-cmp0004-error.patch
275
276
277 Provides: python(abi) = %{pybasever}
278 Provides: /usr/bin/python%{LDVERSION_optimized}
279 Provides: /usr/bin/python%{pybasever}
280 Requires: python-rpm-macros
281 Requires: python3-rpm-macros
282
283 Conflicts: tkinter3 < %{version}
284 Requires: %{lib_name} = %{version}-%{release}
285
286 %description
287 Python is an interpreted, interactive, object-oriented programming
288 language often compared to Tcl, Perl, Scheme or Java. Python includes
289 modules, classes, exceptions, very high level dynamic data types and
290 dynamic typing. Python supports interfaces to many system calls and
291 libraries, as well as to various windowing systems (X11, Motif, Tk,
292 Mac and MFC).
293
294 Programmers can write new built-in modules for Python in C or C++.
295 Python can be used as an extension language for applications that
296 need a programmable interface. This package contains most of the
297 standard Python modules, as well as modules for interfacing to the
298 Tix widget set for Tk and RPM.
299
300 Note that documentation for Python is provided in the python-docs
301 package.
302
303 %package -n %{lib_name}
304 Summary: Shared libraries for Python %{version}
305 Group: System/Libraries
306 Requires: %{lib_name}-stdlib = %{version}-%{release}
307
308 %description -n %{lib_name}
309 This packages contains Python shared object library. Python is an
310 interpreted, interactive, object-oriented programming language often
311 compared to Tcl, Perl, Scheme or Java.
312
313 %package -n %{lib_name}-stdlib
314 Summary: Python %{version} standard library
315 Group: Development/Python
316 %if %{with rpmwheels}
317 Requires: python-setuptools-wheel
318 Requires: python-pip-wheel
319 %else
320 Provides: bundled(python3-pip) = 18.1
321 Provides: bundled(python3-setuptools) = 40.6.2
322 %endif
323
324 %description -n %{lib_name}-stdlib
325 This package contains Python 3's standard library.
326 It is normally not used on its own, but as a dependency of Python %{version}.
327
328 %package -n %{lib_name}-testsuite
329 Summary: Testsuite for the Python %{version} standard library
330 Group: Development/Python
331 Requires: %{lib_name}-stdlib = %{version}-%{release}
332 Requires: %{lib_name} = %{version}-%{release}
333 Recommends: tkinter3
334
335 %description -n %{lib_name}-testsuite
336 The complete testsuite for the Python standard library.
337 It is normally not used on its own, but as a dependency of Python %{version}.
338
339 %package -n %{develname}
340 Summary: The libraries and header files needed for Python development
341 Group: Development/Python
342 Requires: %{name} = %version
343 Requires: %{lib_name} = %{version}-%{release}
344 Provides: %{name}-devel = %{version}-%{release}
345 Provides: %{lib_name_orig}-devel = %{version}-%{release}
346 Obsoletes: %{_lib}python3.1-devel < %{version}
347 Obsoletes: %{_lib}python3.2-devel < %{version}
348 Obsoletes: %{_lib}python3.3-devel < %{version}
349 Recommends: %{lib_name}-testsuite
350 Recommends: %{name}-docs
351
352 %description -n %{develname}
353 The Python programming language's interpreter can be extended with
354 dynamically loaded extensions and can be embedded in other programs.
355 This package contains the header files and libraries needed to do
356 these types of tasks.
357
358 Install %{develname} if you want to develop Python extensions. The
359 python package will also need to be installed. You'll probably also
360 want to install the python-docs package, which contains Python
361 documentation.
362
363 %package docs
364 Summary: Documentation for the Python programming language
365 Requires: %{name} = %{version}
366 Requires: xdg-utils
367 Group: Development/Python
368 BuildArch: noarch
369
370 %description docs
371 The python-docs package contains documentation on the Python
372 programming language and interpreter. The documentation is provided
373 in ASCII text files and in LaTeX source files.
374
375 Install the python-docs package if you'd like to use the documentation
376 for the Python language.
377
378 %package -n tkinter3
379 Summary: A graphical user interface for the Python scripting language
380 Group: Development/Python
381 Requires: %{name} = %{version}-%{release}
382 Requires: tcl tk
383 Provides: python3-tkinter
384
385 %description -n tkinter3
386 The Tkinter (Tk interface) program is an graphical user interface for
387 the Python scripting language.
388
389 You should install the tkinter package if you'd like to use a graphical
390 user interface for Python programming.
391
392 %package -n tkinter3-apps
393 Summary: Various applications written using tkinter
394 Group: Development/Python
395 Requires: tkinter3
396
397 %description -n tkinter3-apps
398 Various applications written using tkinter
399
400 %prep
401 %setup -qn Python-%{version}
402 # Remove all exe files to ensure we are not shipping prebuilt binaries
403 # note that those are only used to create Microsoft Windows installers
404 # and that functionality is broken on Linux anyway
405 find -name '*.exe' -print -delete
406
407 # Remove bundled libraries to ensure that we're using the system copy.
408 rm -r Modules/expat
409
410 # Fedora patches
411 %patch1 -p1
412
413 %if "%{_lib}" == "lib64"
414 %patch102 -p1
415 %endif
416 %patch111 -p1
417 %patch132 -p1
418 %patch155 -p1
419 %patch160 -p1
420 %patch163 -p1
421 %patch170 -p1
422 %patch178 -p1
423
424 %if %{with rpmwheels}
425 %patch189 -p1
426 rm Lib/ensurepip/_bundled/*.whl
427 %endif
428
429 %patch205 -p1
430 %patch251 -p1
431 %patch312 -p1
432 %patch316 -p1
433
434 # Mageia patches
435 %patch500 -p1
436 %patch501 -p1
437 %patch502 -p1
438 %patch503 -p1
439 %patch504 -p1
440 %patch506 -p1
441
442 # Remove files that should be generated by the build
443 # (This is after patching, so that we can use patches directly from upstream)
444 rm configure pyconfig.h.in
445
446 # drop Autoconf version requirement
447 sed -i 's/^AC_PREREQ/dnl AC_PREREQ/' configure.ac
448
449 # docs
450 mkdir html
451 bzcat %{SOURCE1} | tar x -C html
452
453 find . -type f -print0 | xargs -0 perl -p -i -e 's@/usr/local/bin/python@/usr/bin/python3@'
454
455 %build
456 autoreconf -vfi
457
458 # We need -fwrapv
459 # https://bugs.python.org/issue34096
460 export OPT="%{optflags} -D_GNU_SOURCE -fPIC -fwrapv"
461 export CFLAGS="%{optflags} -D_GNU_SOURCE -fPIC -fwrapv"
462 export CXXFLAGS="%{optflags} -D_GNU_SOURCE -fPIC -fwrapv"
463
464 # to fix curses module build
465 # https://bugs.mageia.org/show_bug.cgi?id=6702
466 export CPPFLAGS="-I/usr/include/ncursesw"
467
468 # Remove -Wl,--no-undefined in accordance with MGA #9395 :
469 # https://bugs.mageia.org/show_bug.cgi?id=9395
470 %define _disable_ld_no_undefined 1
471
472 %configure2_5x \
473 --enable-ipv6 \
474 --enable-shared \
475 --with-dbmliborder=gdbm \
476 --with-system-expat \
477 --with-system-ffi \
478 --enable-loadable-sqlite-extensions \
479 --without-dtrace \
480 --with-lto \
481 --with-ssl-default-suites=openssl \
482 %if %{with valgrind}
483 --with-valgrind \
484 %endif
485 --with-threads \
486 --without-ensurepip
487
488 # (misc) if the home is nfs mounted, rmdir fails due to delay
489 export TMP="/tmp" TMPDIR="/tmp"
490
491 make EXTRA_CFLAGS="$CFLAGS" LN="ln -sf"
492
493 %install
494
495 %if %{with gdb_hooks}
496 DirHoldingGdbPy=%{_prefix}/lib/debug/%{_libdir}
497 mkdir -p %{buildroot}$DirHoldingGdbPy
498 %endif # with gdb_hooks
499
500 # fix Makefile to get rid of reference to distcc
501 perl -pi -e "/^CC=/ and s/distcc/gcc/" Makefile
502
503 # set the install path
504 echo '[install_scripts]' >setup.cfg
505 echo 'install_dir='"${RPM_BUILD_ROOT}/usr/bin" >>setup.cfg
506
507 %make_install LN="ln -sf"
508
509 %if %{with gdb_hooks}
510 # See comment on $DirHoldingGdbPy above
511 PathOfGdbPy=$DirHoldingGdbPy/libpython%{pybasever}%{ABIFLAGS_optimized}-%{version}-%{release}.%{_arch}.debug-gdb.py
512 cp Tools/gdb/libpython.py %{buildroot}$PathOfGdbPy
513 %endif # with gdb_hooks
514
515 # Install directories for additional packages
516 install -d -m 0755 %{buildroot}%{pylibdir}/site-packages/__pycache__
517 %if "%{_lib}" == "lib64"
518 # The 64-bit version needs to create "site-packages" in /usr/lib/ (for
519 # pure-Python modules) as well as in /usr/lib64/ (for packages with extension
520 # modules).
521 # Note that rpmlint will complain about hardcoded library path;
522 # this is intentional.
523 install -d -m 0755 %{buildroot}%{_prefix}/lib/python%{pybasever}/site-packages/__pycache__
524 %endif
525
526 # overwrite the copied binary with a link
527 pushd %{buildroot}%{_bindir}
528 ln -sf python%{LDVERSION_optimized} python%{pybasever}
529 ln -sf python%{pybasever} python%{familyver}
530 popd
531
532 pushd %{buildroot}%{_libdir}
533 ln -sf $(ls libpython%{lib_major}*.so.*) libpython%{lib_major}.so
534 popd
535
536 # fix files conflicting with python2
537 mv %{buildroot}/%{_bindir}/2to3 %{buildroot}/%{_bindir}/python3-2to3
538
539 # install pynche as pynche3
540 cat << EOF > %{buildroot}%{_bindir}/pynche3
541 #!/usr/bin/bash
542 exec %{_libdir}/python%{pybasever}/site-packages/pynche/pynche
543 EOF
544 rm -f Tools/pynche/*.pyw
545 cp -r Tools/pynche %{buildroot}%{_libdir}/python%{pybasever}/site-packages/
546
547 chmod 755 %{buildroot}%{_bindir}/{idle3,pynche3}
548
549 ln -f Tools/pynche/README Tools/pynche/README.pynche
550
551 %if %{with valgrind}
552 install Misc/valgrind-python.supp -D %{buildroot}%{_libdir}/valgrind/valgrind-python3.supp
553 %endif
554
555 mkdir -p %{buildroot}%{_datadir}/applications
556 cat > %{buildroot}%{_datadir}/applications/%{_real_vendor}-tkinter3.desktop << EOF
557 [Desktop Entry]
558 Name=IDLE
559 Comment=IDE for Python3
560 Exec=%{_bindir}/idle3
561 Icon=development_environment_section
562 Terminal=false
563 Type=Application
564 Categories=Development;IDE;
565 EOF
566
567 cat > %{buildroot}%{_datadir}/applications/%{_real_vendor}-%{name}-docs.desktop << EOF
568 [Desktop Entry]
569 Name=Python documentation
570 Comment=Python complete reference
571 Exec=%{_bindir}/xdg-open %_defaultdocdir/%{name}-docs/index.html
572 Icon=documentation_section
573 Terminal=false
574 Type=Application
575 Categories=Documentation;
576 EOF
577
578 # fix non real scripts
579 #chmod 644 %{buildroot}%{_libdir}/python*/test/test_{binascii,grp,htmlparser}.py*
580 find %{buildroot} -type f \( -name "test_binascii.py*" -o -name "test_grp.py*" -o -name "test_htmlparser.py*" \) -exec chmod 644 {} \;
581
582 # fix python library not stripped
583 chmod u+w %{buildroot}%{_libdir}/libpython%{lib_major}*.so.1.0 $RPM_BUILD_ROOT%{_libdir}/libpython3.so
584
585 # Make python3-devel multilib-ready
586 mv %{buildroot}%{_includedir}/python%{LDVERSION_optimized}/pyconfig.h \
587 %{buildroot}%{_includedir}/python%{LDVERSION_optimized}/pyconfig-%{__isa_bits}.h
588 cat > %{buildroot}%{_includedir}/python%{LDVERSION_optimized}/pyconfig.h << EOF
589 #include <bits/wordsize.h>
590
591 #if __WORDSIZE == 32
592 #include "pyconfig-32.h"
593 #elif __WORDSIZE == 64
594 #include "pyconfig-64.h"
595 #else
596 #error "Unknown word size"
597 #endif
598 EOF
599
600 # Make sure distutils looks at the right pyconfig.h file
601 # See https://bugzilla.redhat.com/show_bug.cgi?id=201434
602 # Similar for sysconfig: sysconfig.get_config_h_filename tries to locate
603 # pyconfig.h so it can be parsed, and needs to do this at runtime in site.py
604 # when python starts up (see https://bugzilla.redhat.com/show_bug.cgi?id=653058)
605 #
606 # Split this out so it goes directly to the pyconfig-32.h/pyconfig-64.h
607 # variants:
608 sed -i -e "s/'pyconfig.h'/'pyconfig-%{__isa_bits}.h'/" \
609 %{buildroot}%{pylibdir}/distutils/sysconfig.py \
610 %{buildroot}%{pylibdir}/sysconfig.py
611
612 # Install pathfix.py to bindir
613 # See https://github.com/fedora-python/python-rpm-porting/issues/24
614 cp -p Tools/scripts/pathfix.py %{buildroot}%{_bindir}/
615
616 # Switch all shebangs to refer to the specific Python version.
617 # This currently only covers files matching ^[a-zA-Z0-9_]+\.py$,
618 # so handle files named using other naming scheme separately.
619 LD_LIBRARY_PATH=./ ./python \
620 Tools/scripts/pathfix.py \
621 -i "%{_bindir}/python%{pybasever}" -pn \
622 %{buildroot} \
623 %{?with_gdb_hooks:%{buildroot}$DirHoldingGdbPy/*.py}
624
625 # Remove shebang lines from .py files that aren't executable, and
626 # remove executability from .py files that don't have a shebang line:
627 find %{buildroot} -name \*.py \
628 \( \( \! -perm /u+x,g+x,o+x -exec sed -e '/^#!/Q 0' -e 'Q 1' {} \; \
629 -print -exec sed -i '1d' {} \; \) -o \( \
630 -perm /u+x,g+x,o+x ! -exec grep -m 1 -q '^#!' {} \; \
631 -exec chmod a-x {} \; \) \)
632
633 # .xpm and .xbm files should not be executable:
634 find %{buildroot} \
635 \( -name \*.xbm -o -name \*.xpm -o -name \*.xpm.1 \) \
636 -exec chmod a-x {} \;
637
638 # Get rid of DOS batch files:
639 find %{buildroot} -name \*.bat -exec rm {} \;
640
641 # Get rid of backup files:
642 find %{buildroot}/ -name "*~" -exec rm -f {} \;
643 find . -name "*~" -exec rm -f {} \;
644
645 # Get rid of a stray copy of the license:
646 rm -f %{buildroot}%{pylibdir}/LICENSE.txt
647
648 # Do bytecompilation with the newly installed interpreter.
649 # This is similar to the script in macros.pybytecompile
650 # compile *.pyc
651 find %{buildroot}%{_libdir}/python%{pybasever} -type f -a -name "*.py" -print0 | \
652 LD_LIBRARY_PATH="%{buildroot}%{dynload_dir}/:%{buildroot}%{_libdir}" \
653 PYTHONPATH="%{buildroot}%{_libdir}/python%{pybasever} %{buildroot}%{_libdir}/python%{pybasever}/site-packages" \
654 xargs -0 %{buildroot}%{_bindir}/python%{pybasever} -O -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("%{buildroot}")[2], optimize=opt) for opt in range(3) for f in sys.argv[1:]]' || :
655
656 # Since we have pathfix.py in bindir, this is created, but we don't want it
657 rm -rf %{buildroot}%{_bindir}/__pycache__
658
659 # Fixup permissions for shared libraries from non-standard 555 to standard 755:
660 find %{buildroot} -perm 555 -exec chmod 755 {} \;
661
662 # There's 2to3-X.X executable and 2to3 soft link to it.
663 # No reason to have both, so keep only 2to3 as an executable.
664 # See https://bugzilla.redhat.com/show_bug.cgi?id=1111275
665 #mv %{buildroot}%{_bindir}/2to3-%{pybasever} %{buildroot}%{_bindir}/2to3
666
667 %if %{with tests}
668 %check
669 # (misc) if the home is nfs mounted, rmdir fails
670 export TMP="/tmp" TMPDIR="/tmp"
671
672 # Exclude some tests that hangs on the BS
673 EXCLUDE="test_ssl test_socket test_epoll"
674 %ifarch x86_64
675 EXCLUDE="$EXCLUDE test_faulthandler"
676 %endif
677 %ifarch %arm
678 EXCLUDE="$EXCLUDE test_float test_asyncio test_cmath"
679 %endif
680 # Local aarch64 tests succeeds, but fails on BS
681 %ifarch aarch64
682 EXCLUDE="$EXCLUDE test_posix test_asyncio"
683 %endif
684 # json test pass on local build but fail on BS
685 EXCLUDE="$EXCLUDE test_json"
686 # to investigate why it fails on local build
687 EXCLUDE="$EXCLUDE test_site"
688 # all tests must pass
689 # but we disable network on BS
690 WITHIN_PYTHON_RPM_BUILD= \
691 make test TESTOPTS="-j1 -wW -u none -x $EXCLUDE"
692 # consider use network on local build
693 #EXCLUDE=""
694 #WITHIN_PYTHON_RPM_BUILD= make test TESTOPTS="-u network -x $EXCLUDE"
695 %endif
696
697 %files
698 %{_bindir}/pydoc%{familyver}
699 %{_bindir}/pydoc%{pybasever}
700 %{_bindir}/python%{familyver}
701 %{_bindir}/python%{pybasever}
702 %{_bindir}/python%{LDVERSION_optimized}
703 %{_bindir}/pyvenv
704 %{_bindir}/pyvenv-%{pybasever}
705 %{_bindir}/2to3-%{pybasever}
706 %{_bindir}/python3-2to3
707 %{_mandir}/man*/*
708
709 %files -n %{lib_name}-stdlib
710 %license LICENSE
711 %doc README.rst
712 %{_includedir}/python%{LDVERSION_optimized}/pyconfig-%{__isa_bits}.h
713 %{pylibdir}/config-%{LDVERSION_optimized}-%{_arch}-linux%{_gnu}/Makefile
714 %if "%{_lib}" == "lib64"
715 %dir %{_prefix}/lib/python%{pybasever}
716 %dir %{_prefix}/lib/python%{pybasever}/site-packages
717 %dir %{_prefix}/lib/python%{pybasever}/site-packages/__pycache__/
718 %endif
719 %dir %{pylibdir}
720 %dir %{dynload_dir}
721 %dir %{site_packages}
722 %dir %{site_packages}/__pycache__/
723 %{site_packages}/README.txt
724 %{pylibdir}/*.py
725 %dir %{pylibdir}/__pycache__/
726 %{pylibdir}/__pycache__/*%{bytecode_suffixes}
727
728 %dir %{pylibdir}/unittest/
729 %dir %{pylibdir}/unittest/__pycache__/
730 %{pylibdir}/unittest/*.py
731 %{pylibdir}/unittest/__pycache__/*%{bytecode_suffixes}
732
733 %dir %{pylibdir}/asyncio/
734 %dir %{pylibdir}/asyncio/__pycache__/
735 %{pylibdir}/asyncio/*.py
736 %{pylibdir}/asyncio/__pycache__/*%{bytecode_suffixes}
737
738 %dir %{pylibdir}/venv/
739 %dir %{pylibdir}/venv/__pycache__/
740 %{pylibdir}/venv/*.py
741 %{pylibdir}/venv/__pycache__/*%{bytecode_suffixes}
742 %{pylibdir}/venv/scripts
743
744 %{pylibdir}/wsgiref
745 %{pylibdir}/xml
746 %{pylibdir}/xmlrpc
747
748 %dir %{pylibdir}/ensurepip/
749 %dir %{pylibdir}/ensurepip/__pycache__/
750 %{pylibdir}/ensurepip/*.py
751 %{pylibdir}/ensurepip/__pycache__/*%{bytecode_suffixes}
752
753 %if %{with rpmwheels}
754 %exclude %{pylibdir}/ensurepip/_bundled
755 %else
756 %dir %{pylibdir}/ensurepip/_bundled
757 %{pylibdir}/ensurepip/_bundled/*.whl
758 %endif
759
760 %dir %{pylibdir}/concurrent/
761 %dir %{pylibdir}/concurrent/__pycache__/
762 %{pylibdir}/concurrent/*.py
763 %{pylibdir}/concurrent/__pycache__/*%{bytecode_suffixes}
764
765 %dir %{pylibdir}/concurrent/futures/
766 %dir %{pylibdir}/concurrent/futures/__pycache__/
767 %{pylibdir}/concurrent/futures/*.py
768 %{pylibdir}/concurrent/futures/__pycache__/*%{bytecode_suffixes}
769
770 %{pylibdir}/pydoc_data
771
772 %dir %{pylibdir}/collections/
773 %dir %{pylibdir}/collections/__pycache__/
774 %{pylibdir}/collections/*.py
775 %{pylibdir}/collections/__pycache__/*%{bytecode_suffixes}
776
777 %dir %{pylibdir}/ctypes/
778 %dir %{pylibdir}/ctypes/__pycache__/
779 %{pylibdir}/ctypes/*.py
780 %{pylibdir}/ctypes/__pycache__/*%{bytecode_suffixes}
781 %{pylibdir}/ctypes/macholib
782
783 %{pylibdir}/curses
784
785 %dir %{pylibdir}/dbm/
786 %dir %{pylibdir}/dbm/__pycache__/
787 %{pylibdir}/dbm/*.py
788 %{pylibdir}/dbm/__pycache__/*%{bytecode_suffixes}
789
790 %dir %{pylibdir}/distutils/
791 %dir %{pylibdir}/distutils/__pycache__/
792 %{pylibdir}/distutils/*.py
793 %{pylibdir}/distutils/__pycache__/*%{bytecode_suffixes}
794 %{pylibdir}/distutils/README
795 %{pylibdir}/distutils/command
796
797 %dir %{pylibdir}/email/
798 %dir %{pylibdir}/email/__pycache__/
799 %{pylibdir}/email/*.py
800 %{pylibdir}/email/__pycache__/*%{bytecode_suffixes}
801 %{pylibdir}/email/mime
802 %doc %{pylibdir}/email/architecture.rst
803
804 %{pylibdir}/encodings
805
806 %{pylibdir}/html
807 %{pylibdir}/http
808
809 %dir %{pylibdir}/importlib/
810 %dir %{pylibdir}/importlib/__pycache__/
811 %{pylibdir}/importlib/*.py
812 %{pylibdir}/importlib/__pycache__/*%{bytecode_suffixes}
813
814 %dir %{pylibdir}/json/
815 %dir %{pylibdir}/json/__pycache__/
816 %{pylibdir}/json/*.py
817 %{pylibdir}/json/__pycache__/*%{bytecode_suffixes}
818
819 %{pylibdir}/lib2to3
820 %exclude %{pylibdir}/lib2to3/tests
821
822 %{pylibdir}/logging
823 %{pylibdir}/multiprocessing
824
825 %dir %{pylibdir}/sqlite3/
826 %dir %{pylibdir}/sqlite3/__pycache__/
827 %{pylibdir}/sqlite3/*.py
828 %{pylibdir}/sqlite3/__pycache__/*%{bytecode_suffixes}
829
830 %exclude %{pylibdir}/turtle.py
831 %exclude %{pylibdir}/__pycache__/turtle*%{bytecode_suffixes}
832
833 %{pylibdir}/urllib
834
835 %{dynload_dir}/_bisect.%{SOABI_optimized}.so
836 %{dynload_dir}/_bz2.%{SOABI_optimized}.so
837 %{dynload_dir}/_codecs_cn.%{SOABI_optimized}.so
838 %{dynload_dir}/_codecs_hk.%{SOABI_optimized}.so
839 %{dynload_dir}/_codecs_iso2022.%{SOABI_optimized}.so
840 %{dynload_dir}/_codecs_jp.%{SOABI_optimized}.so
841 %{dynload_dir}/_codecs_kr.%{SOABI_optimized}.so
842 %{dynload_dir}/_codecs_tw.%{SOABI_optimized}.so
843 %{dynload_dir}/_contextvars.%{SOABI_optimized}.so
844 %{dynload_dir}/_crypt.%{SOABI_optimized}.so
845 %{dynload_dir}/_csv.%{SOABI_optimized}.so
846 %{dynload_dir}/_ctypes.%{SOABI_optimized}.so
847 %{dynload_dir}/_curses.%{SOABI_optimized}.so
848 %{dynload_dir}/_curses_panel.%{SOABI_optimized}.so
849 %{dynload_dir}/_dbm.%{SOABI_optimized}.so
850 %{dynload_dir}/_decimal.%{SOABI_optimized}.so
851 %{dynload_dir}/_elementtree.%{SOABI_optimized}.so
852 %{dynload_dir}/_gdbm.%{SOABI_optimized}.so
853 %{dynload_dir}/_hashlib.%{SOABI_optimized}.so
854 %{dynload_dir}/_heapq.%{SOABI_optimized}.so
855 %{dynload_dir}/_json.%{SOABI_optimized}.so
856 %{dynload_dir}/_lsprof.%{SOABI_optimized}.so
857 %{dynload_dir}/_lzma.%{SOABI_optimized}.so
858 %{dynload_dir}/_multibytecodec.%{SOABI_optimized}.so
859 %{dynload_dir}/_multiprocessing.%{SOABI_optimized}.so
860 %{dynload_dir}/_opcode.%{SOABI_optimized}.so
861 %{dynload_dir}/_pickle.%{SOABI_optimized}.so
862 %{dynload_dir}/_posixsubprocess.%{SOABI_optimized}.so
863 %{dynload_dir}/_queue.%{SOABI_optimized}.so
864 %{dynload_dir}/_random.%{SOABI_optimized}.so
865 %{dynload_dir}/_socket.%{SOABI_optimized}.so
866 %{dynload_dir}/_sqlite3.%{SOABI_optimized}.so
867 %{dynload_dir}/_ssl.%{SOABI_optimized}.so
868 %{dynload_dir}/_struct.%{SOABI_optimized}.so
869 %{dynload_dir}/_md5.%{SOABI_optimized}.so
870 %{dynload_dir}/_sha1.%{SOABI_optimized}.so
871 %{dynload_dir}/_sha256.%{SOABI_optimized}.so
872 %{dynload_dir}/_sha512.%{SOABI_optimized}.so
873 %{dynload_dir}/array.%{SOABI_optimized}.so
874 %{dynload_dir}/audioop.%{SOABI_optimized}.so
875 %{dynload_dir}/binascii.%{SOABI_optimized}.so
876 %{dynload_dir}/cmath.%{SOABI_optimized}.so
877 %{dynload_dir}/_datetime.%{SOABI_optimized}.so
878 %{dynload_dir}/fcntl.%{SOABI_optimized}.so
879 %{dynload_dir}/grp.%{SOABI_optimized}.so
880 %{dynload_dir}/math.%{SOABI_optimized}.so
881 %{dynload_dir}/mmap.%{SOABI_optimized}.so
882 %{dynload_dir}/nis.%{SOABI_optimized}.so
883 %{dynload_dir}/ossaudiodev.%{SOABI_optimized}.so
884 %{dynload_dir}/parser.%{SOABI_optimized}.so
885 %{dynload_dir}/pyexpat.%{SOABI_optimized}.so
886 %{dynload_dir}/readline.%{SOABI_optimized}.so
887 %{dynload_dir}/resource.%{SOABI_optimized}.so
888 %{dynload_dir}/select.%{SOABI_optimized}.so
889 %{dynload_dir}/spwd.%{SOABI_optimized}.so
890 %{dynload_dir}/syslog.%{SOABI_optimized}.so
891 %{dynload_dir}/termios.%{SOABI_optimized}.so
892 %{dynload_dir}/_testmultiphase.%{SOABI_optimized}.so
893 %{dynload_dir}/unicodedata.%{SOABI_optimized}.so
894 %{dynload_dir}/_uuid.%{SOABI_optimized}.so
895 %{dynload_dir}/xxlimited.%{SOABI_optimized}.so
896 %{dynload_dir}/zlib.%{SOABI_optimized}.so
897 %{dynload_dir}/_asyncio.%{SOABI_optimized}.so
898 %{dynload_dir}/_blake2.%{SOABI_optimized}.so
899 %{dynload_dir}/_sha3.%{SOABI_optimized}.so
900
901 %files -n %{lib_name}-testsuite
902 %{pylibdir}/ctypes/test
903 %{pylibdir}/distutils/tests
904 %{pylibdir}/lib2to3/tests
905 %{pylibdir}/sqlite3/test
906 %{pylibdir}/test/*
907 %{pylibdir}/unittest/test
908 # These two are shipped in the main subpackage:
909 %exclude %{pylibdir}/test/test_support.py*
910 %exclude %{pylibdir}/test/__init__.py*
911 %{dynload_dir}/_ctypes_test.%{SOABI_optimized}.so
912 %{dynload_dir}/_testcapi.%{SOABI_optimized}.so
913 %{dynload_dir}/_testbuffer.%{SOABI_optimized}.so
914 %{dynload_dir}/_testimportmultiple.%{SOABI_optimized}.so
915 %{dynload_dir}/_xxtestfuzz.%{SOABI_optimized}.so
916
917 %files -n %{lib_name}
918 %{_libdir}/libpython%{LDVERSION_optimized}.so.1*
919
920 %files -n %{develname}
921 %{_bindir}/pathfix.py
922 %{_libdir}/libpython%{LDVERSION_optimized}.so
923 %{_libdir}/libpython%{pybasever}.so
924 %{_libdir}/libpython%{familyver}.so
925 %{_includedir}/python%{LDVERSION_optimized}
926 %exclude %{_includedir}/python%{LDVERSION_optimized}/pyconfig-%{__isa_bits}.h
927 %{pylibdir}/config-%{LDVERSION_optimized}-%{_arch}-linux%{_gnu}
928 %{_bindir}/python%{pybasever}-config
929 %{_bindir}/python%{LDVERSION_optimized}-config
930 %{_bindir}/python%{familyver}-config
931 %{_libdir}/pkgconfig/python-%{LDVERSION_optimized}.pc
932 %{_libdir}/pkgconfig/python-%{pybasever}.pc
933 %{_libdir}/pkgconfig/python%{familyver}.pc
934
935 %exclude %{pylibdir}/config-%{LDVERSION_optimized}-%{_arch}-linux%{_gnu}/Makefile
936 %if %{with valgrind}
937 %{_libdir}/valgrind/valgrind-python3.supp
938 %endif
939
940 %files docs
941 %doc html/*/*
942 %{_datadir}/applications/%{_real_vendor}-%{name}-docs.desktop
943
944 %files -n tkinter3
945 %{pylibdir}/tkinter/
946 %{dynload_dir}/_tkinter.%{SOABI_optimized}.so
947 %{pylibdir}/idlelib
948 %{site_packages}/pynche
949 %{pylibdir}/turtle.py
950 %{pylibdir}/__pycache__/turtle*%{bytecode_suffixes}
951 %dir %{pylibdir}/turtledemo
952 %{pylibdir}/turtledemo/*.py
953 %{pylibdir}/turtledemo/*.cfg
954 %dir %{pylibdir}/turtledemo/__pycache__/
955 %{pylibdir}/turtledemo/__pycache__/*%{bytecode_suffixes}
956
957 %files -n tkinter3-apps
958 %{_bindir}/idle%{familyver}
959 %{_bindir}/idle%{pybasever}
960 %{_bindir}/pynche%{familyver}
961 %{_datadir}/applications/%{_real_vendor}-tkinter3.desktop
962
963 # We put the debug-gdb.py file inside /usr/lib/debug to avoid noise from ldconfig
964 # See https://bugzilla.redhat.com/show_bug.cgi?id=562980
965 #
966 # The /usr/lib/rpm/redhat/macros defines %%__debug_package to use
967 # debugfiles.list, and it appears that everything below /usr/lib/debug and
968 # (/usr/src/debug) gets added to this file (via LISTFILES) in
969 # /usr/lib/rpm/find-debuginfo.sh
970 #
971 # Hence by installing it below /usr/lib/debug we ensure it is added to the
972 # -debuginfo subpackage
973 # (if it doesn't, then the rpmbuild ought to fail since the debug-gdb.py
974 # payload file would be unpackaged)
975
976 # Workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1476593
977 %undefine _debuginfo_subpackages

  ViewVC Help
Powered by ViewVC 1.1.30