Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Rotkraut:Opt-Python
opt-python313
opt-python313.spec
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File opt-python313.spec of Package opt-python313
%define pyversion 3.13.0b2 %define pipversion 24.0 %define vmajor %(echo %{pyversion} | head -c 1) %define vminor %(echo %{pyversion} | head -c 4 | tail -c 2) %define vmicro %(echo %{pyversion} | head -c 6 | tail -c 1) %define pyver %{vmajor}.%{vminor} %define nver %{vmajor}%{vminor} %define _prefix /opt/python %define _libdir %{_prefix}/lib %define python_sitelib %{_libdir}/python%{pyver}/site-packages %global with_pip 1 Name: opt-python%{nver} Version: %{pyversion} Release: 1 Summary: Python Interpreter License: Python-2.0 Group: Development/Languages/Python Url: https://www.python.org/ Source0: https://www.python.org/ftp/python/%{pyversion}/Python-%{pyversion}.tar.xz # Deliberately abstain from applying any patches. These are test # versions. Do not need production quality. Opt for simplicity # rather then for fine tuning. BuildRequires: db-devel BuildRequires: fdupes BuildRequires: gcc-c++ BuildRequires: gdbm-devel BuildRequires: gmp-devel BuildRequires: libbz2-devel BuildRequires: libffi-devel BuildRequires: libopenssl-devel >= 1.1.1 BuildRequires: libuuid-devel BuildRequires: ncurses-devel BuildRequires: readline-devel BuildRequires: sqlite-devel BuildRequires: tk-devel BuildRequires: xorg-x11-devel BuildRequires: xz BuildRequires: xz-devel BuildRequires: opt-python311 BuildRequires: opt-python-libpython3 < 3.12 Provides: %{name} = %{pyver} Requires: opt-python-libpython3 BuildRoot: %{_tmppath}/%{name}-%{pyversion}-build %description Python is an interpreted, object-oriented programming language, and is often compared to Tcl, Perl, Scheme, or Java. This package is installed in /opt/python in such a way that multiple Python version may live there next to each other. %if %{with_pip} %package pip Version: %{pipversion} Summary: The PyPA recommended tool for installing Python packages License: MIT Url: https://pip.pypa.io/ Requires: %{name} = %{pyver} BuildArch: noarch %description pip The PyPA recommended tool for installing Python packages. %endif %package -n opt-python-libpython3 Summary: Python Interpreter Requires: %{name} = %{pyver} %description -n opt-python-libpython3 Python is an interpreted, object-oriented programming language, and is often compared to Tcl, Perl, Scheme, or Java. This package contains a single symbol link to resolve a conflict between libpython3 versions. (See http://bugs.python.org/issue17975) %prep %setup -q -n Python-%{pyversion} %build # Tell the linker to set the rpath in the python executable. export LD_RUN_PATH=%{_libdir} # Need Python >= 3.8 (installed from opt-python312) to bootstrap export PATH=/opt/python/bin:$PATH ./configure \ --prefix=%{_prefix} \ --libdir=%{_libdir} \ --enable-ipv6 \ --enable-shared make # replace rest of /usr/local/bin/python or /usr/bin/env python* with # /opt/python/bin/python%{pyver}. find . -path "./Parser" -prune -o -path "./Python/makeopcodetargets.py" -prune -o -name '*.py' -type f -print0 | xargs -0 grep -lE '^#! *(/usr/.*bin/(env +)?)?python' | xargs sed -r -i -e '1s@^#![[:space:]]*(/usr/(local/)?bin/(env +)?)?python([0-9]+(\.[0-9]+)?)?@#! %{_prefix}/bin/python%{pyver}@' %install # Tell the linker to set the rpath in the python executable. export LD_RUN_PATH=%{_libdir} # Need Python >= 3.8 (installed from opt-python312) to bootstrap export PATH=/opt/python/bin:$PATH # Fix: "make altinstall" fails to create this directory and as a # result silently skips installing all its content. install -d -m 755 %{buildroot}%{_libdir}/python%{pyver}/lib-dynload make altinstall DESTDIR=%{buildroot} # Fight a bug (presumably in pip 22.*) that causes the interpreter # line in installed scripts to get crippled. sed -i -e 's|%{_bindir}/python$|%{_bindir}/python%{pyver}|' \ %{buildroot}%{_bindir}/pip%{pyver} # See http://bugs.python.org/issue17975 # All Python versions starting with 3.2 install libpython3.so which # conflicts between versions. We resort in renaming libpython3.so, # adding a symlink, and packaging the symlink in a separate package. # This way one can install all Python packages along with one of the # symlink packages pointing to the library verions of choice. mv -f %{buildroot}%{_libdir}/libpython3.so \ %{buildroot}%{_libdir}/libpython%{pyver}.so ln -s libpython%{pyver}.so %{buildroot}%{_libdir}/libpython3.so %fdupes %{buildroot}%{_libdir}/python%{pyver} # Deliberately do not include %post scripts to add /opt/python/lib to # the ld.so.conf and run ldconfig in order to avoid interfering with # the system Python installation. Set the rpath in the binaries # instead, see setting of LD_RUN_PATH above. %files %defattr(-, root, root) %{_prefix} %exclude %{_bindir}/pip* %exclude %{_libdir}/libpython3.so %exclude %{_libdir}/python%{pyver}/test %exclude %{python_sitelib}/pip* %if %{with_pip} %files pip %defattr(-, root, root) %{_bindir}/pip%{pyver} %{python_sitelib}/pip* %endif %files -n opt-python-libpython3 %defattr(-, root, root) %{_libdir}/libpython3.so %changelog
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor