%global debug_package %{nil} %global pybasever 3.10 %global pyshortver 310 %global __mangle_shebangs_exclude_from / Name: python%{pybasever} Summary: Version %{pybasever} of the Python interpreter URL: https://www.python.org/ %global upstream_version %{general_version}%{?prerel} Version: 3.10.13 Release: 2%{?dist} License: Python-2.0.1 %bcond_with bootstrap %bcond_without rpmwheels %global pip_version 23.0.1 %global setuptools_version 65.5.0 %bcond_without optimizations %bcond_without tests %bcond_without debug_build %bcond_without gdb_hooks %bcond_without gdbm %bcond_without computed_gotos %ifarch %{valgrind_arches} %bcond_without valgrind %else %bcond_with valgrind %endif %if %{with main_python} %global pkgname python3 %global exename python3 %else %global pkgname python%{pybasever} %global exename python%{pybasever} %endif %global pylibdir %{_libdir}/python%{pybasever} %global dynload_dir %{pylibdir}/lib-dynload %global ABIFLAGS_optimized %{nil} %global ABIFLAGS_debug d %global LDVERSION_optimized %{pybasever}%{ABIFLAGS_optimized} %global LDVERSION_debug %{pybasever}%{ABIFLAGS_debug} %global platform_triplet %{expand:%(echo %{_arch}-linux%{_gnu} | sed -E \\ -e 's/^arm(eb)?-linux-gnueabi$/arm\\1-linux-gnueabihf/' \\ -e 's/^mips64(el)?-linux-gnu$/mips64\\1-linux-gnuabi64/' \\ -e 's/^ppc(64)?(le)?-linux-gnu$/powerpc\\1\\2-linux-gnu/')} %global SOABI_optimized cpython-%{pyshortver}%{ABIFLAGS_optimized}-%{platform_triplet} %global SOABI_debug cpython-%{pyshortver}%{ABIFLAGS_debug}-%{platform_triplet} %global bytecode_suffixes .cpython-%{pyshortver}*.pyc %global py_SOVERSION 1.0 %global py_INSTSONAME_optimized libpython%{LDVERSION_optimized}.so.%{py_SOVERSION} %global py_INSTSONAME_debug libpython%{LDVERSION_debug}.so.%{py_SOVERSION} %undefine py_auto_byte_compile %if %{with main_python} %define unversioned_obsoletes_of_python3_X_if_main() %{expand:\ Obsoletes: python%{pybasever}%{?1:-%{1}}\ } %else %define unversioned_obsoletes_of_python3_X_if_main() %{nil} %endif %undefine _include_frame_pointers # ======================= # Build-time requirements # ======================= # (keep this list alphabetized) BuildRequires: autoconf BuildRequires: bluez-libs-devel BuildRequires: bzip2 BuildRequires: bzip2-devel BuildRequires: desktop-file-utils BuildRequires: expat-devel BuildRequires: findutils BuildRequires: gcc-c++ BuildRequires: gdbm-devel BuildRequires: git-core BuildRequires: glibc-all-langpacks BuildRequires: glibc-devel BuildRequires: gmp-devel BuildRequires: gnupg2 BuildRequires: libappstream-glib BuildRequires: libffi-devel BuildRequires: libnsl2-devel BuildRequires: libtirpc-devel BuildRequires: libGL-devel BuildRequires: libuuid-devel BuildRequires: libX11-devel BuildRequires: make BuildRequires: mpdecimal-devel BuildRequires: ncurses-devel BuildRequires: openssl-devel BuildRequires: pkgconfig BuildRequires: readline-devel BuildRequires: redhat-rpm-config >= 127 BuildRequires: sqlite-devel BuildRequires: gdb BuildRequires: tar BuildRequires: tcl-devel BuildRequires: tix-devel BuildRequires: tk-devel BuildRequires: tzdata BuildRequires: valgrind-devel BuildRequires: xz-devel BuildRequires: zlib-devel BuildRequires: /usr/bin/dtrace BuildRequires: /usr/sbin/ifconfig #%if %{without bootstrap} # for make regen-all and distutils.tests.test_bdist_rpm # Note that we're not using the %%{pkgname} macro here on purpose, because when # upgrading the main python3 to a new Python version, this would pull in the # old version instead. #BuildRequires: python%{pybasever} # for proper automatic provides #BuildRequires: python3-rpm-generators #%endif # ======================= # Source code and patches # ======================= Source0: %{url}ftp/python/%{general_version}/Python-3.10.13.tar.xz Source1: %{url}ftp/python/%{general_version}/Python-3.10.13.tar.xz.asc Source2: https://keybase.io/pablogsal/pgp_keys.asc Source8: check-pyc-timestamps.py Source10: idle3.desktop Source11: idle3.appdata.xml Patch1: 00001-rpath.patch Patch251: 00251-change-user-install-location.patch Patch371: 00371-revert-bpo-1596321-fix-threading-_shutdown-for-the-main-thread-gh-28549-gh-28589.patch # Description for the python3X SRPM only: %description Python %{pybasever} is an accessible, high-level, dynamically typed, interpreted programming language, designed with an emphasis on code readability. It includes an extensive standard library, and has a vast ecosystem of third-party libraries. %global __requires_exclude ^/usr/local/bin/python$ ##%define __requires_exclude_from /usr/local/bin/*$ AutoReq: no AutoReqProv : no Requires: tzdata Obsoletes: python3.10-libs, python3.10-tkinter Provides: python3.10-libs, python3.10-tkinter # ====================================================== # The prep phase of the build: # ====================================================== %prep %gpgverify -k2 -s1 -d0 %autosetup -S git_am -n Python-3.10.13 # ====================================================== # Configuring and building the code: # ====================================================== %build export CFLAGS="%{extension_cflags}" export CFLAGS_NODIST="%{build_cflags} -D_GNU_SOURCE -fPIC -fwrapv" export CXXFLAGS="%{extension_cxxflags}" export CPPFLAGS="$(pkg-config --cflags-only-I libffi)" export OPT="%{extension_cflags}" export LINKCC="gcc" export CFLAGS="$CFLAGS $(pkg-config --cflags openssl)" export LDFLAGS="%{extension_ldflags} $(pkg-config --libs-only-L openssl)" export LDFLAGS_NODIST="%{build_ldflags} -g $(pkg-config --libs-only-L openssl)" # We can build several different configurations of Python: regular and debug. # Define a common function that does one build: %configure \ --with-platlibdir=%{_lib} \ --enable-ipv6 \ --enable-shared \ --with-computed-gotos=%{computed_gotos_flag} \ --with-dbmliborder=gdbm:ndbm:bdb \ --with-system-expat \ --with-system-ffi \ --with-system-libmpdec \ --enable-loadable-sqlite-extensions \ --with-dtrace \ --with-lto \ --with-ssl-default-suites=openssl \ --without-static-libpython \ --with-valgrind %install mkdir -p $RPM_BUILD_ROOT make altinstall DESTDIR=$RPM_BUILD_ROOT #sed -i 's|/usr/bin/sh|/bin/sh|' "$RPM_BUILD_ROOT/usr/bin/python3.10-config" sed -i 's|/usr/bin/sh|/bin/sh|' "$RPM_BUILD_ROOT/usr/lib64/python3.10/ctypes/macholib/fetch_macholib" sed -i 's|/usr/bin/sh|/bin/sh|' "$RPM_BUILD_ROOT/usr/lib64/python3.10/config-3.10-x86_64-linux-gnu/makesetup" sed -i 's|/usr/bin/sh|/bin/sh|' "$RPM_BUILD_ROOT/usr/lib64/python3.10/config-3.10-x86_64-linux-gnu/install-sh" sed -i 's|/usr/bin/bash|/bin/bash|' "$RPM_BUILD_ROOT/usr/lib64/python3.10/test/ziptestdata/exe_with_z64" sed -i 's|/usr/bin/bash|/bin/bash|' "$RPM_BUILD_ROOT/usr/lib64/python3.10/test/ziptestdata/exe_with_zip" sed -i 's|/usr/bin/bash|/bin/bash|' "$RPM_BUILD_ROOT/usr/lib64/python3.10/test/ziptestdata/header.sh" sed -i 's|/usr/bin/python|/usr/bin/python3.10|' "$RPM_BUILD_ROOT/usr/bin/pip3.10" rm -f "$RPM_BUILD_ROOT/usr/bin/pip3.11" sed -i 's|/usr/bin/env python|/usr/bin/env python3.10|' "$RPM_BUILD_ROOT/usr/lib/python3.10/site-packages/pip/_vendor/distro/distro.py" sed -i 's|/usr/bin/env python|/usr/bin/env python3.10|' "$RPM_BUILD_ROOT/usr/lib64/python3.10/encodings/rot_13.py" sed -i 's|/usr/bin/env python|/usr/bin/env python3.10|' "$RPM_BUILD_ROOT/usr/lib64/python3.10/lib2to3/tests/data/different_encoding.py" sed -i 's|/usr/bin/env python|/usr/bin/env python3.10|' "$RPM_BUILD_ROOT/usr/lib64/python3.10/lib2to3/tests/data/false_encoding.py" rm -f $RPM_BUILD_ROOT/usr/lib64/libpython3.so %files -n %{pkgname} /usr/bin/2to3-3.10 /usr/bin/idle3.10 /usr/bin/pip3.10 /usr/bin/pydoc3.10 /usr/bin/python3.10 /usr/bin/python3.10-config /usr/lib64/python3.10/* /usr/lib/python3.10/* /usr/include/python3.10/* /usr/lib64/libpython3.10.so /usr/lib64/libpython3.10.so.1.0 /usr/lib64/pkgconfig/python-3.10-embed.pc /usr/lib64/pkgconfig/python-3.10.pc /usr/share/man/man1/python3.10.1.gz %changelog