Compare commits

...

7 Commits

Author SHA1 Message Date
Tomas Orsava c61ec4378a Obsolete platform-python and it's subpackages
Raise the release of platform-python obsoletes for better maintainability
2017-11-28 10:13:14 +01:00
Tomas Orsava 4704498937 Set the correct shebangs and fix post/un's 2017-11-22 17:27:59 +01:00
Tomas Orsava 851697dc0e Make the python36- files declarations cleaner 2017-11-22 17:27:59 +01:00
Tomas Orsava df43cbbde3 Temporarily turn off the tests, optimizations and debug build
For faster development of the Platform-Python stack
2017-10-24 11:05:18 +02:00
Tomas Orsava af5fb68888 Fix ruquires syntax 2017-10-10 18:10:34 +02:00
Tomas Orsava 270c6e750f Remove irrelevant Obsoletes 2017-10-10 18:09:33 +02:00
Tomas Orsava 9b45e76f34 Platform-Python: modify and add subpackages 2017-10-05 15:01:16 +02:00
1 changed files with 281 additions and 100 deletions

View File

@ -14,7 +14,7 @@ URL: https://www.python.org/
# WARNING When rebasing to a new Python version,
# remember to update the python3-docs package as well
Version: %{pybasever}.2
Release: 19%{?dist}
Release: 20%{?dist}
License: Python
@ -25,9 +25,12 @@ License: Python
# Note that the bcond macros are named for the CLI option they create.
# "%%bcond_without" means "ENABLE by default and create a --without option"
# Platform-Python build
%bcond_with platform_python
# Expensive optimizations (mainly, profile-guided optimizations)
%ifarch %{ix86} x86_64
%bcond_without optimizations
%bcond_with optimizations
%else
# On some architectures, the optimized build takes tens of hours, possibly
# longer than Koji's 24-hour timeout. Disable optimizations here.
@ -35,14 +38,14 @@ License: Python
%endif
# Run the test suite in %%check
%bcond_without tests
%bcond_with tests
# Ability to reuse RPM-installed pip using rewheel
%bcond_without rewheel
# Extra build for debugging the interpreter or C-API extensions
# (the -debug subpackages)
%bcond_without debug_build
%bcond_with debug_build
# Support for the GDB debugger
%bcond_without gdb_hooks
@ -215,6 +218,7 @@ BuildRequires: /usr/bin/dtrace
BuildRequires: /usr/sbin/ifconfig
%if %{with rewheel}
# For Platform-Python: We build require the python3- instead of the python36- versions so we don't have to bootstrap Platform-Python. The python3- versions are available in the module called `bootstrap`.
BuildRequires: python3-setuptools
BuildRequires: python3-pip
%endif
@ -409,6 +413,54 @@ Patch274: 00274-fix-arch-names.patch
# Descriptions, and metadata for subpackages
# ==========================================
# The description used both for the SRPM and the main `python3`
# (and also `python36` in case of platform-python) subpackage(s):
%global _description_main \
Python is an accessible, high-level, dynamically typed, interpreted programming\
language, designed with an emphasis on code readibility.\
It includes an extensive standard library, and has a vast ecosystem of\
third-party libraries.\
\
The ${name} package provides the "python3" executable: the reference\
interpreter for the Python language, version 3.\
The majority of its standard library is provided in the %{name}-libs package,\
which should be installed automatically along with %{name}.\
The remaining parts of the Python standard library are broken out into the\
%{name}-tkinter and %{name}-test packages, which may need to be installed\
separately.\
\
Documentation for Python is provided in the %{name}-docs package.\
\
Packages containing additional libraries for Python are generally named with\
the "%{name}-" prefix.
%if %{with platform_python}
# Main shim package: python3 requiring python36
Requires: python%{python3_pkgversion} = %{version}
%if %{with rewheel}
Requires: python3-setuptools
Requires: python3-pip
%endif
%endif # with platform_python
%description %{_description_main}
# Main package, named python3, or python36 for platform-python
%if %{with platform_python}
%package -n python%{python3_pkgversion}
Summary: %{summary}
%endif
# Shall be removed in Fedora 31
# The release is bumped to 20, so we can do f27 platform-python updates
# If the release in f27 ever goes >= 20, raise it here
# If platform-python is ever reintroduced, make it higher version than this:
%global platpyver 3.6.2-20
Obsoletes: platform-python < %{platpyver}
# Packages with Python modules in standard locations automatically
# depend on python(abi). Provide that here.
Provides: python(abi) = %{pybasever}
@ -421,45 +473,12 @@ Obsoletes: system-python < %{version}-%{release}
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
# In order to support multiple Python interpreters for development purposes,
# packages with with the naming scheme pythonXY (e.g. python35) exist for
# non-default versions of Python 3.
# For consistency, and to keep the upgrade path clean, we Provide/Obsolete
# these names here.
Provides: python%{pyshortver} = %{version}-%{release}
# Note that using Obsoletes without package version is not standard practice.
# Here we assert that *any* version of the system's default interpreter is
# preferable to an "extra" interpreter. For example, python3-3.6.1 will
# replace python36-3.6.2.
Obsoletes: python%{pyshortver}
%if %{with rewheel}
Requires: python3-setuptools
Requires: python3-pip
%if %{with platform_python}
%description -n python%{python3_pkgversion} %{_description_main}
%endif
# The description used both for the SRPM and the main `python3` subpackage:
%description
Python is an accessible, high-level, dynamically typed, interpreted programming
language, designed with an emphasis on code readibility.
It includes an extensive standard library, and has a vast ecosystem of
third-party libraries.
The ${name} package provides the "python3" executable: the reference
interpreter for the Python language, version 3.
The majority of its standard library is provided in the %{name}-libs package,
which should be installed automatically along with %{name}.
The remaining parts of the Python standard library are broken out into the
%{name}-tkinter and %{name}-test packages, which may need to be installed
separately.
Documentation for Python is provided in the %{name}-docs package.
Packages containing additional libraries for Python are generally named with
the "%{name}-" prefix.
%package libs
%package -n python%{python3_pkgversion}-libs
Summary: Python runtime libraries
# The "enum" module is included in the standard library.
@ -476,14 +495,29 @@ Provides: system-python-libs = %{version}-%{release}
Provides: system-python-libs%{?_isa} = %{version}-%{release}
Obsoletes: system-python-libs < %{version}-%{release}
%description libs
This package contains runtime libraries for use by Python:
- the majority of the Python standard library
- a dynamically linked library for use by applications that embed Python as
# Shall be removed in Fedora 31
Obsoletes: platform-python-libs < %{platpyver}
Obsoletes: platform-python-libs-devel < %{platpyver}
%global _description_libs \
This package contains runtime libraries for use by Python:\
- the majority of the Python standard library\
- a dynamically linked library for use by applications that embed Python as\
a scripting language, and by the main "python3" executable
%description -n python%{python3_pkgversion}-libs %{_description_libs}
%package devel
%if %{with platform_python}
%package -n python3-libs
Summary: Python runtime libraries
Requires: python%{python3_pkgversion}-libs = %{version}
%description -n python3-libs %{_description_libs}
%endif
%package -n python%{python3_pkgversion}-devel
Summary: Libraries and header files needed for Python development
Requires: %{name} = %{version}-%{release}
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
@ -500,15 +534,29 @@ Requires: redhat-rpm-config
Conflicts: %{name} < %{version}-%{release}
%description devel
This package contains the header files and configuration needed to compile
Python extension modules (typically written in C or C++), to embed Python
into other programs, and to make binary distributions for Python libraries.
# Shall be removed in Fedora 31
Obsoletes: platform-python-devel < %{platpyver}
%global _description_devel \
This package contains the header files and configuration needed to compile\
Python extension modules (typically written in C or C++), to embed Python\
into other programs, and to make binary distributions for Python libraries.\
\
It also contains the necessary macros to build RPM packages with Python modules.
%description -n python%{python3_pkgversion}-devel %{_description_devel}
%package tools
%if %{with platform_python}
%package -n python3-devel
Summary: Libraries and header files needed for Python development
Requires: python%{python3_pkgversion}-devel = %{version}
%description -n python3-devel %{_description_devel}
%endif
%package -n python%{python3_pkgversion}-tools
Summary: A collection of tools included with Python including 2to3 and idle
Requires: %{name} = %{version}-%{release}
Requires: %{name}-tkinter = %{version}-%{release}
@ -524,37 +572,78 @@ Provides: idle3 = %{version}-%{release}
Conflicts: python2-tools < 2.7.13-17
Conflicts: python-tools < 2.7.13-17
%description tools
This package contains several tools included with Python, including:
- 2to3, an automatic source converter from Python 2.X
# Shall be removed in Fedora 31
Obsoletes: platform-python-tools < %{platpyver}
%global _description_tools \
This package contains several tools included with Python, including:\
- 2to3, an automatic source converter from Python 2.X\
- idle, a basic graphical development environment
%description -n python%{python3_pkgversion}-tools %{_description_tools}
%package tkinter
%if %{with platform_python}
%package -n python3-tools
Summary: A collection of tools included with Python including 2to3 and idle
Requires: python%{python3_pkgversion}-tools = %{version}
%description -n python3-tools %{_description_tools}
%endif
%package -n python%{python3_pkgversion}-tkinter
Summary: A GUI toolkit for Python
Requires: %{name} = %{version}-%{release}
%description tkinter
The Tkinter (Tk interface) library is a graphical user interface toolkit for
# Shall be removed in Fedora 31
Obsoletes: platform-python-tkinter < %{platpyver}
%global _description_tkinter \
The Tkinter (Tk interface) library is a graphical user interface toolkit for\
the Python programming language.
%description -n python%{python3_pkgversion}-tkinter %{_description_tkinter}
%package test
%if %{with platform_python}
%package -n python3-tkinter
Summary: A GUI toolkit for Python
Requires: python%{python3_pkgversion}-tkinter = %{version}
%description -n python3-tkinter %{_description_tkinter}
%endif
%package -n python%{python3_pkgversion}-test
Summary: The self-test suite for the main python3 package
Requires: %{name} = %{version}-%{release}
Requires: %{name}-tools = %{version}-%{release}
# Shall be removed in Fedora 31
Obsoletes: platform-python-test < %{platpyver}
%description test
The self-test suite for the Python interpreter.
This is only useful to test Python itself. For testing general Python code,
you should use the unittest module from %{name}-libs, or a library such as
%global _description_test \
The self-test suite for the Python interpreter.\
\
This is only useful to test Python itself. For testing general Python code,\
you should use the unittest module from %{name}-libs, or a library such as\
${name}-pytest or ${name}-nose.
%description -n python%{python3_pkgversion}-test %{_description_test}
%if %{with platform_python}
%package -n python3-test
Summary: The self-test suite for the main python3 package
Requires: python%{python3_pkgversion}-test = %{version}
%description -n python3-test %{_description_test}
%endif
%if %{with debug_build}
%package debug
%package -n python%{python3_pkgversion}-debug
Summary: Debug version of the Python runtime
# The debug build is an all-in-one package version of the regular build, and
@ -567,23 +656,34 @@ Requires: %{name}-test%{?_isa} = %{version}-%{release}
Requires: %{name}-tkinter%{?_isa} = %{version}-%{release}
Requires: %{name}-tools%{?_isa} = %{version}-%{release}
%description debug
python3-debug provides a version of the Python runtime with numerous debugging
features enabled, aimed at advanced Python users such as developers of Python
extension modules.
This version uses more memory and will be slower than the regular Python build,
but is useful for tracking down reference-counting issues and other bugs.
The bytecode format is unchanged, so that .pyc files are compatible between
this and the standard version of Python, but the debugging features mean that
C/C++ extension modules are ABI-incompatible and must be built for each version
separately.
The debug build shares installation directories with the standard Python
runtime, so that .py and .pyc files can be shared.
Compiled extension modules use a special ABI flag ("d") in the filename,
%global _description_debug \
python3-debug provides a version of the Python runtime with numerous debugging\
features enabled, aimed at advanced Python users such as developers of Python\
extension modules.\
\
This version uses more memory and will be slower than the regular Python build,\
but is useful for tracking down reference-counting issues and other bugs.\
\
The bytecode format is unchanged, so that .pyc files are compatible between\
this and the standard version of Python, but the debugging features mean that\
C/C++ extension modules are ABI-incompatible and must be built for each version\
separately.\
\
The debug build shares installation directories with the standard Python\
runtime, so that .py and .pyc files can be shared.\
Compiled extension modules use a special ABI flag ("d") in the filename,\
so extensions for both verisons can co-exist in the same directory.
%description -n python%{python3_pkgversion}-debug %{_description_debug}
%if %{with platform_python}
%package -n python3-debug
Summary: Debug version of the Python runtime
Requires: python%{python3_pkgversion}-debug = %{version}
%description -n python3-debug %{_description_debug}
%endif # with platform_python
%endif # with debug_build
@ -925,7 +1025,11 @@ sed -i -e "s/'pyconfig.h'/'%{_pyconfig_h}'/" \
# so handle files named using other naming scheme separately.
LD_LIBRARY_PATH=./build/optimized ./build/optimized/python \
Tools/scripts/pathfix.py \
%if %{with platform_python}
-i "%{_libexecdir}/platform-python" \
%else
-i "%{_bindir}/python%{pybasever}" \
%endif # with platform_python
%{buildroot} %{buildroot}%{pylibdir}/Tools/scripts/*-*.py \
%{buildroot}%{pylibdir}/Tools/pynche/{pynche,pynche.pyw}
# not covered, also redundant and useless:
@ -962,6 +1066,9 @@ rm %{buildroot}%{pylibdir}/LICENSE.txt
# Do bytecompilation with the newly installed interpreter.
# This is similar to the script in macros.pybytecompile
# compile *.pyc
# Platform-Python note:
# We're compiling with the /usr/bin/python3.X executable as
# the /usr/libexec/platform-python executable is created later in the spec
find %{buildroot} -type f -a -name "*.py" -print0 | \
LD_LIBRARY_PATH="%{buildroot}%{dynload_dir}/:%{buildroot}%{_libdir}" \
PYTHONPATH="%{buildroot}%{_libdir}/python%{pybasever} %{buildroot}%{_libdir}/python%{pybasever}/site-packages" \
@ -992,6 +1099,21 @@ ln -s \
mkdir -p %{buildroot}%{_libexecdir}
ln -s %{_bindir}/python%{pybasever} %{buildroot}%{_libexecdir}/system-python
%if %{with platform_python}
# Platform Python: Copy the executable to libexec
mkdir -p %{buildroot}%{_libexecdir}
cp %{buildroot}%{_bindir}/python%{pybasever} %{buildroot}%{_libexecdir}/platform-python
# Remove the python3 and python3.X executables in bindir so they can be
# replaced with symlinks
rm %{buildroot}%{_bindir}/python3
rm %{buildroot}%{_bindir}/python%{pybasever}
# Create a symlink to platform-python from bindir
ln -s %{_libexecdir}/platform-python %{buildroot}%{_bindir}/python%{pybasever}
ln -s python%{pybasever} %{buildroot}%{_bindir}/python3
%endif
# ======================================================
# Checks for packaging issues
@ -1003,7 +1125,11 @@ ln -s %{_bindir}/python%{pybasever} %{buildroot}%{_libexecdir}/system-python
find %{buildroot} -type f -a -name "*.py" -print0 | \
LD_LIBRARY_PATH="%{buildroot}%{dynload_dir}/:%{buildroot}%{_libdir}" \
PYTHONPATH="%{buildroot}%{_libdir}/python%{pybasever} %{buildroot}%{_libdir}/python%{pybasever}/site-packages" \
%if %{with platform_python}
xargs -0 %{buildroot}%{_libexecdir}/platform-python %{SOURCE8}
%else
xargs -0 %{buildroot}%{_bindir}/python%{pybasever} %{SOURCE8}
%endif
# Ensure that the curses module was linked against libncursesw.so, rather than
# libncurses.so
@ -1090,9 +1216,9 @@ CheckPython optimized
# Scriptlets
# ======================================================
%post libs -p /sbin/ldconfig
%post -n python%{python3_pkgversion}-libs -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig
%postun -n python%{python3_pkgversion}-libs -p /sbin/ldconfig
%post
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
@ -1106,10 +1232,21 @@ fi
%posttrans
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%files
%files -n python%{python3_pkgversion}
%defattr(-, root, root)
%license LICENSE
%doc README.rst
%if %{with platform_python}
%{_libexecdir}/platform-python
%endif
%if %{with platform_python}
%files -n python3
%license LICENSE
%doc README.rst
%endif
%{_bindir}/pydoc*
%{_bindir}/python3
%{_bindir}/python%{pybasever}
@ -1120,7 +1257,14 @@ fi
# Remove in Fedora 29:
%{_libexecdir}/system-python
%files libs
%if %{with platform_python}
%files -n python3-libs
%license LICENSE
%doc README.rst
%endif
%files -n python%{python3_pkgversion}-libs
%defattr(-,root,root,-)
%license LICENSE
%doc README.rst
@ -1345,7 +1489,8 @@ fi
%doc systemtap-example.stp pyfuntop.stp
%endif
%files devel
%files -n python%{python3_pkgversion}-devel
%defattr(-,root,root)
%{pylibdir}/config-%{LDVERSION_optimized}-%{_arch}-linux%{_gnu}/*
%exclude %{pylibdir}/config-%{LDVERSION_optimized}-%{_arch}-linux%{_gnu}/Makefile
@ -1353,11 +1498,6 @@ fi
%{_includedir}/python%{LDVERSION_optimized}/*.h
%exclude %{_includedir}/python%{LDVERSION_optimized}/%{_pyconfig_h}
%doc Misc/README.valgrind Misc/valgrind-python.supp Misc/gdbinit
%{_bindir}/python3-config
%{_bindir}/python%{pybasever}-config
%{_bindir}/python%{LDVERSION_optimized}-config
%{_bindir}/python%{LDVERSION_optimized}-*-config
%{_bindir}/pathfix.py
%{_libdir}/libpython%{LDVERSION_optimized}.so
%{_libdir}/pkgconfig/python-%{LDVERSION_optimized}.pc
%{_libdir}/pkgconfig/python-%{pybasever}.pc
@ -1365,19 +1505,41 @@ fi
%{_rpmconfigdir}/macros.d/macros.pybytecompile%{pybasever}
%{_rpmconfigdir}/macros.d/macros.systempython
%files tools
%if %{with platform_python}
%files -n python3-devel
%doc Misc/README.valgrind Misc/valgrind-python.supp Misc/gdbinit
%endif
%{_bindir}/python3-config
%{_bindir}/python%{pybasever}-config
%{_bindir}/python%{LDVERSION_optimized}-config
%{_bindir}/python%{LDVERSION_optimized}-*-config
%{_bindir}/pathfix.py
%files -n python%{python3_pkgversion}-tools
%defattr(-,root,root,755)
%{pylibdir}/Tools
%if %{with platform_python}
%files -n python3-tools
%endif
%{_bindir}/2to3
# TODO: Remove 2to3-3.7 once rebased to 3.7
%{_bindir}/2to3-%{pybasever}
%{_bindir}/idle*
%{pylibdir}/Tools
%doc %{pylibdir}/Doc
%{_datadir}/appdata/idle3.appdata.xml
%{_datadir}/applications/idle3.desktop
%{_datadir}/icons/hicolor/*/apps/idle3.*
%files tkinter
%if %{with platform_python}
%files -n python3-tkinter
%endif
%files -n python%{python3_pkgversion}-tkinter
%defattr(-,root,root,755)
%{pylibdir}/tkinter
%exclude %{pylibdir}/tkinter/test
@ -1390,7 +1552,12 @@ fi
%dir %{pylibdir}/turtledemo/__pycache__/
%{pylibdir}/turtledemo/__pycache__/*%{bytecode_suffixes}
%files test
%if %{with platform_python}
%files -n python3-test
%endif
%files -n python%{python3_pkgversion}-test
%defattr(-, root, root)
%{pylibdir}/ctypes/test
%{pylibdir}/distutils/tests
@ -1412,13 +1579,9 @@ fi
# all of the other subpackages
%if %{with debug_build}
%files debug
%files -n python%{python3_pkgversion}-debug
%defattr(-,root,root,-)
# Analog of the core subpackage's files:
%{_bindir}/python%{LDVERSION_debug}
%{_bindir}/python3-debug
# Analog of the -libs subpackage's files:
# ...with debug builds of the built-in "extension" modules:
@ -1502,8 +1665,6 @@ fi
# Analog of the -devel subpackage's files:
%{pylibdir}/config-%{LDVERSION_debug}-%{_arch}-linux%{_gnu}
%{_includedir}/python%{LDVERSION_debug}
%{_bindir}/python%{LDVERSION_debug}-config
%{_bindir}/python%{LDVERSION_debug}-*-config
%{_libdir}/libpython%{LDVERSION_debug}.so
%{_libdir}/libpython%{LDVERSION_debug}.so.1.0
%{_libdir}/pkgconfig/python-%{LDVERSION_debug}.pc
@ -1521,8 +1682,21 @@ fi
%{dynload_dir}/_testcapi.%{SOABI_debug}.so
%{dynload_dir}/_testimportmultiple.%{SOABI_debug}.so
%if %{with platform_python}
%files -n python3-debug
%endif
# Analog of the core subpackage's files:
%{_bindir}/python%{LDVERSION_debug}
%{_bindir}/python3-debug
%{_bindir}/python%{LDVERSION_debug}-config
%{_bindir}/python%{LDVERSION_debug}-*-config
%endif # with debug_build
# We put the debug-gdb.py file inside /usr/lib/debug to avoid noise from ldconfig
# See https://bugzilla.redhat.com/show_bug.cgi?id=562980
#
@ -1544,6 +1718,13 @@ fi
# ======================================================
%changelog
* Tue Nov 28 2017 Tomas Orsava <torsava@redhat.com> - 3.6.2-21
- Obsolete platform-python and it's subpackages
- Raise the release of platform-python obsoletes for better maintainability
* Thu Oct 05 2017 Tomas Orsava <torsava@redhat.com> - 3.6.2-20
- Modified the spec file to build Platform-Python
* Fri Sep 29 2017 Miro Hrončok <mhroncok@redhat.com> - 3.6.2-19
- Move pathfix.py to bindir, https://github.com/fedora-python/python-rpm-porting/issues/24
- Make the -devel package require redhat-rpm-config