forked from pool/python38
- Switch from %primary_interpreter to prjconf-defined %primary_python (gh#openSUSE/python-rpm-macros#127).
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:Factory/python38?expand=0&rev=89
This commit is contained in:
parent
5493df1c9c
commit
822856d8bd
@ -1,3 +1,8 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Jul 21 14:19:54 UTC 2022 - Matej Cepl <mcepl@suse.com>
|
||||||
|
|
||||||
|
- Switch from %primary_interpreter to prjconf-defined %primary_python (gh#openSUSE/python-rpm-macros#127).
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu May 5 14:34:56 UTC 2022 - Matej Cepl <mcepl@suse.com>
|
Thu May 5 14:34:56 UTC 2022 - Matej Cepl <mcepl@suse.com>
|
||||||
|
|
||||||
|
@ -35,6 +35,9 @@
|
|||||||
%bcond_with base
|
%bcond_with base
|
||||||
%bcond_without general
|
%bcond_without general
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
%define python_pkg_name python38
|
||||||
|
|
||||||
%define _version %(c=%{version}; echo ${c/[a-z]*/})
|
%define _version %(c=%{version}; echo ${c/[a-z]*/})
|
||||||
%define tar_suffix %(c=%{_version}; echo ${c#%{_version}})
|
%define tar_suffix %(c=%{_version}; echo ${c#%{_version}})
|
||||||
%define python_version %(c=%{_version}; echo ${c:0:3})
|
%define python_version %(c=%{_version}; echo ${c:0:3})
|
||||||
@ -48,10 +51,6 @@
|
|||||||
%else
|
%else
|
||||||
%define tarversion %{version}
|
%define tarversion %{version}
|
||||||
%endif
|
%endif
|
||||||
%define python_pkg_name python38
|
|
||||||
# Will provide the python3-* provides
|
|
||||||
# Will do the /usr/bin/python3 and all the core links
|
|
||||||
%define primary_interpreter 0
|
|
||||||
%define folderversion %{tarversion}
|
%define folderversion %{tarversion}
|
||||||
%define tarname Python-%{tarversion}
|
%define tarname Python-%{tarversion}
|
||||||
%define sitedir %{_libdir}/python%{python_version}
|
%define sitedir %{_libdir}/python%{python_version}
|
||||||
@ -208,7 +207,7 @@ Requires: %{python_pkg_name}-base = %{version}
|
|||||||
Recommends: %{python_pkg_name}-curses
|
Recommends: %{python_pkg_name}-curses
|
||||||
Recommends: %{python_pkg_name}-dbm
|
Recommends: %{python_pkg_name}-dbm
|
||||||
Recommends: %{python_pkg_name}-pip
|
Recommends: %{python_pkg_name}-pip
|
||||||
%if %{primary_interpreter}
|
%if "%{python_pkg_name}" == "%{primary_python}"
|
||||||
Provides: python3 = %{python_version}
|
Provides: python3 = %{python_version}
|
||||||
%endif
|
%endif
|
||||||
%endif
|
%endif
|
||||||
@ -230,7 +229,7 @@ development environment (python3-idle).
|
|||||||
%package -n %{python_pkg_name}-tk
|
%package -n %{python_pkg_name}-tk
|
||||||
Summary: TkInter, a Python Tk Interface
|
Summary: TkInter, a Python Tk Interface
|
||||||
Requires: %{python_pkg_name} = %{version}
|
Requires: %{python_pkg_name} = %{version}
|
||||||
%if %{primary_interpreter}
|
%if "%{python_pkg_name}" == "%{primary_python}"
|
||||||
Provides: python3-tk = %{version}
|
Provides: python3-tk = %{version}
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
@ -240,7 +239,7 @@ Python interface to Tk. Tk is the GUI toolkit that comes with Tcl.
|
|||||||
%package -n %{python_pkg_name}-curses
|
%package -n %{python_pkg_name}-curses
|
||||||
Summary: Python Interface to the (N)Curses Library
|
Summary: Python Interface to the (N)Curses Library
|
||||||
Requires: %{python_pkg_name} = %{version}
|
Requires: %{python_pkg_name} = %{version}
|
||||||
%if %{primary_interpreter}
|
%if "%{python_pkg_name}" == "%{primary_python}"
|
||||||
Provides: python3-curses
|
Provides: python3-curses
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
@ -251,7 +250,7 @@ Console User Interface.
|
|||||||
%package -n %{python_pkg_name}-dbm
|
%package -n %{python_pkg_name}-dbm
|
||||||
Summary: Python Interface to the GDBM Library
|
Summary: Python Interface to the GDBM Library
|
||||||
Requires: %{python_pkg_name} = %{version}
|
Requires: %{python_pkg_name} = %{version}
|
||||||
%if %{primary_interpreter}
|
%if "%{python_pkg_name}" == "%{primary_python}"
|
||||||
Provides: python3-dbm
|
Provides: python3-dbm
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
@ -263,7 +262,7 @@ the GNU implementation GDBM.
|
|||||||
Summary: An Integrated Development Environment for Python
|
Summary: An Integrated Development Environment for Python
|
||||||
Requires: %{python_pkg_name} = %{version}
|
Requires: %{python_pkg_name} = %{version}
|
||||||
Requires: %{python_pkg_name}-tk
|
Requires: %{python_pkg_name}-tk
|
||||||
%if %{primary_interpreter}
|
%if "%{python_pkg_name}" == "%{primary_python}"
|
||||||
Provides: python3-idle = %{version}
|
Provides: python3-idle = %{version}
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
@ -276,7 +275,7 @@ a debugger.
|
|||||||
%package -n %{python_pkg_name}-doc
|
%package -n %{python_pkg_name}-doc
|
||||||
Summary: Package Documentation for Python 3
|
Summary: Package Documentation for Python 3
|
||||||
Enhances: %{python_pkg_name} = %{python_version}
|
Enhances: %{python_pkg_name} = %{python_version}
|
||||||
%if %{primary_interpreter}
|
%if "%{python_pkg_name}" == "%{primary_python}"
|
||||||
Provides: python3-doc = %{version}
|
Provides: python3-doc = %{version}
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
@ -287,7 +286,7 @@ Python, and Macintosh Module Reference in HTML format.
|
|||||||
|
|
||||||
%package -n %{python_pkg_name}-doc-devhelp
|
%package -n %{python_pkg_name}-doc-devhelp
|
||||||
Summary: Additional Package Documentation for Python 3 in devhelp format
|
Summary: Additional Package Documentation for Python 3 in devhelp format
|
||||||
%if %{primary_interpreter}
|
%if "%{python_pkg_name}" == "%{primary_python}"
|
||||||
Provides: python3-doc-devhelp = %{version}
|
Provides: python3-doc-devhelp = %{version}
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
@ -311,7 +310,7 @@ Provides: %{python_pkg_name}-asyncio = %{version}
|
|||||||
Provides: %{python_pkg_name}-typing = %{version}
|
Provides: %{python_pkg_name}-typing = %{version}
|
||||||
# python3-xml was merged into python3, now moved into -base
|
# python3-xml was merged into python3, now moved into -base
|
||||||
Provides: %{python_pkg_name}-xml = %{version}
|
Provides: %{python_pkg_name}-xml = %{version}
|
||||||
%if %{primary_interpreter}
|
%if "%{python_pkg_name}" == "%{primary_python}"
|
||||||
Provides: python3-asyncio = %{version}
|
Provides: python3-asyncio = %{version}
|
||||||
Obsoletes: python3-asyncio < %{version}
|
Obsoletes: python3-asyncio < %{version}
|
||||||
Provides: python3-base = %{version}
|
Provides: python3-base = %{version}
|
||||||
@ -338,7 +337,7 @@ Summary: Python Utility and Demonstration Scripts
|
|||||||
Requires: %{python_pkg_name}-base = %{version}
|
Requires: %{python_pkg_name}-base = %{version}
|
||||||
Provides: %{python_pkg_name}-2to3 = %{version}
|
Provides: %{python_pkg_name}-2to3 = %{version}
|
||||||
Provides: %{python_pkg_name}-demo = %{version}
|
Provides: %{python_pkg_name}-demo = %{version}
|
||||||
%if %{primary_interpreter}
|
%if "%{python_pkg_name}" == "%{primary_python}"
|
||||||
Provides: python3-2to3 = %{version}
|
Provides: python3-2to3 = %{version}
|
||||||
Provides: python3-demo = %{version}
|
Provides: python3-demo = %{version}
|
||||||
Provides: python3-tools = %{version}
|
Provides: python3-tools = %{version}
|
||||||
@ -353,7 +352,7 @@ and a set of demonstration programs.
|
|||||||
%package -n %{python_pkg_name}-devel
|
%package -n %{python_pkg_name}-devel
|
||||||
Summary: Include Files and Libraries Mandatory for Building Python Modules
|
Summary: Include Files and Libraries Mandatory for Building Python Modules
|
||||||
Requires: %{python_pkg_name}-base = %{version}
|
Requires: %{python_pkg_name}-base = %{version}
|
||||||
%if %{primary_interpreter}
|
%if "%{python_pkg_name}" == "%{primary_python}"
|
||||||
Provides: python3-devel = %{version}
|
Provides: python3-devel = %{version}
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
@ -372,7 +371,7 @@ package up to version 2.2.2.
|
|||||||
Summary: Unit tests for Python and its standard library
|
Summary: Unit tests for Python and its standard library
|
||||||
Requires: %{python_pkg_name} = %{version}
|
Requires: %{python_pkg_name} = %{version}
|
||||||
Requires: %{python_pkg_name}-tk = %{version}
|
Requires: %{python_pkg_name}-tk = %{version}
|
||||||
%if %{primary_interpreter}
|
%if "%{python_pkg_name}" == "%{primary_python}"
|
||||||
Provides: python3-testsuite = %{version}
|
Provides: python3-testsuite = %{version}
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
@ -426,7 +425,7 @@ other applications.
|
|||||||
# drop Autoconf version requirement
|
# drop Autoconf version requirement
|
||||||
sed -i 's/^AC_PREREQ/dnl AC_PREREQ/' configure.ac
|
sed -i 's/^AC_PREREQ/dnl AC_PREREQ/' configure.ac
|
||||||
|
|
||||||
%if %{primary_interpreter}
|
%if "%{python_pkg_name}" == "%{primary_python}"
|
||||||
# fix shebangs - convert /usr/local/bin/python and /usr/bin/env/python to /usr/bin/python3
|
# fix shebangs - convert /usr/local/bin/python and /usr/bin/env/python to /usr/bin/python3
|
||||||
for dir in Lib Tools; do
|
for dir in Lib Tools; do
|
||||||
# find *.py, filter to files that contain bad shebangs
|
# find *.py, filter to files that contain bad shebangs
|
||||||
@ -669,7 +668,7 @@ rm -fv %{buildroot}%{dynlib nis}
|
|||||||
ln -sf python%{python_version} %{buildroot}%{_bindir}/python3
|
ln -sf python%{python_version} %{buildroot}%{_bindir}/python3
|
||||||
|
|
||||||
# decide to ship python3 or just python3.X
|
# decide to ship python3 or just python3.X
|
||||||
%if !%{primary_interpreter}
|
%if "%{python_pkg_name}" != "%{primary_python}"
|
||||||
# base
|
# base
|
||||||
rm %{buildroot}%{_bindir}/python3
|
rm %{buildroot}%{_bindir}/python3
|
||||||
rm %{buildroot}%{_bindir}/pydoc3
|
rm %{buildroot}%{_bindir}/pydoc3
|
||||||
@ -687,7 +686,7 @@ ln -s ../../libpython%{python_abi}.so %{buildroot}%{_libdir}/python%{python_vers
|
|||||||
rm %{buildroot}%{_bindir}/idle3*
|
rm %{buildroot}%{_bindir}/idle3*
|
||||||
|
|
||||||
# delete the generic 2to3 binary if we are not primary
|
# delete the generic 2to3 binary if we are not primary
|
||||||
%if !%{primary_interpreter}
|
%if "%{python_pkg_name}" != "%{primary_python}"
|
||||||
rm %{buildroot}%{_bindir}/2to3
|
rm %{buildroot}%{_bindir}/2to3
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
@ -719,7 +718,7 @@ install -m 755 -D Tools/gdb/libpython.py %{buildroot}%{_datadir}/gdb/auto-load/%
|
|||||||
# RPM macros
|
# RPM macros
|
||||||
mkdir -p %{buildroot}%{_rpmconfigdir}/macros.d/
|
mkdir -p %{buildroot}%{_rpmconfigdir}/macros.d/
|
||||||
# primary python3 macros
|
# primary python3 macros
|
||||||
%if %{primary_interpreter}
|
%if "%{python_pkg_name}" == "%{primary_python}"
|
||||||
install -m 644 %{SOURCE7} %{buildroot}%{_rpmconfigdir}/macros.d/ # macros.python3
|
install -m 644 %{SOURCE7} %{buildroot}%{_rpmconfigdir}/macros.d/ # macros.python3
|
||||||
%endif
|
%endif
|
||||||
# flavor specific macros, only to be supplied "if we are in the buildset", e.g. installed.
|
# flavor specific macros, only to be supplied "if we are in the buildset", e.g. installed.
|
||||||
@ -825,7 +824,7 @@ echo %{sitedir}/_import_failed > %{buildroot}/%{sitedir}/site-packages/zzzz-impo
|
|||||||
%files -n %{python_pkg_name}-tools
|
%files -n %{python_pkg_name}-tools
|
||||||
%defattr(644, root, root, 755)
|
%defattr(644, root, root, 755)
|
||||||
%{sitedir}/turtledemo
|
%{sitedir}/turtledemo
|
||||||
%if %{primary_interpreter}
|
%if "%{python_pkg_name}" == "%{primary_python}"
|
||||||
%{_bindir}/2to3
|
%{_bindir}/2to3
|
||||||
%endif
|
%endif
|
||||||
%attr(755, root, root)%{_bindir}/2to3-%{python_version}
|
%attr(755, root, root)%{_bindir}/2to3-%{python_version}
|
||||||
@ -834,7 +833,7 @@ echo %{sitedir}/_import_failed > %{buildroot}/%{sitedir}/site-packages/zzzz-impo
|
|||||||
%files -n %{python_pkg_name}-devel
|
%files -n %{python_pkg_name}-devel
|
||||||
%defattr(644, root, root, 755)
|
%defattr(644, root, root, 755)
|
||||||
%{_libdir}/libpython%{python_abi}.so
|
%{_libdir}/libpython%{python_abi}.so
|
||||||
%if %{primary_interpreter}
|
%if "%{python_pkg_name}" == "%{primary_python}"
|
||||||
%{_libdir}/libpython3.so
|
%{_libdir}/libpython3.so
|
||||||
%endif
|
%endif
|
||||||
%{_libdir}/pkgconfig/*
|
%{_libdir}/pkgconfig/*
|
||||||
@ -842,7 +841,7 @@ echo %{sitedir}/_import_failed > %{buildroot}/%{sitedir}/site-packages/zzzz-impo
|
|||||||
%{sitedir}/config-%{python_abi}-*
|
%{sitedir}/config-%{python_abi}-*
|
||||||
%defattr(755, root, root)
|
%defattr(755, root, root)
|
||||||
%{_bindir}/python%{python_abi}-config
|
%{_bindir}/python%{python_abi}-config
|
||||||
%if %{primary_interpreter}
|
%if "%{python_pkg_name}" == "%{primary_python}"
|
||||||
%{_bindir}/python3-config
|
%{_bindir}/python3-config
|
||||||
%endif
|
%endif
|
||||||
# Own these directories to not depend on gdb
|
# Own these directories to not depend on gdb
|
||||||
@ -875,14 +874,14 @@ echo %{sitedir}/_import_failed > %{buildroot}/%{sitedir}/site-packages/zzzz-impo
|
|||||||
%doc %{_docdir}/%{name}/README.rst
|
%doc %{_docdir}/%{name}/README.rst
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
%doc %{_docdir}/%{name}/README.SUSE
|
%doc %{_docdir}/%{name}/README.SUSE
|
||||||
%if %{primary_interpreter}
|
%if "%{python_pkg_name}" == "%{primary_python}"
|
||||||
%{_mandir}/man1/python3.1%{?ext_man}
|
%{_mandir}/man1/python3.1%{?ext_man}
|
||||||
%endif
|
%endif
|
||||||
%{_mandir}/man1/python%{python_version}.1%{?ext_man}
|
%{_mandir}/man1/python%{python_version}.1%{?ext_man}
|
||||||
# license text, not a doc because the code can use it at run-time
|
# license text, not a doc because the code can use it at run-time
|
||||||
%{sitedir}/LICENSE.txt
|
%{sitedir}/LICENSE.txt
|
||||||
# RPM macros
|
# RPM macros
|
||||||
%if %{primary_interpreter}
|
%if "%{python_pkg_name}" == "%{primary_python}"
|
||||||
%{_rpmconfigdir}/macros.d/macros.python3
|
%{_rpmconfigdir}/macros.d/macros.python3
|
||||||
%endif
|
%endif
|
||||||
%{_rpmconfigdir}/macros.d/macros.%{python_pkg_name}
|
%{_rpmconfigdir}/macros.d/macros.%{python_pkg_name}
|
||||||
@ -986,7 +985,7 @@ echo %{sitedir}/_import_failed > %{buildroot}/%{sitedir}/site-packages/zzzz-impo
|
|||||||
%{sitedir}/_import_failed
|
%{sitedir}/_import_failed
|
||||||
%{sitedir}/site-packages/zzzz-import-failed-hooks.pth
|
%{sitedir}/site-packages/zzzz-import-failed-hooks.pth
|
||||||
# symlinks
|
# symlinks
|
||||||
%if %{primary_interpreter}
|
%if "%{python_pkg_name}" == "%{primary_python}"
|
||||||
%{_bindir}/python3
|
%{_bindir}/python3
|
||||||
%{_bindir}/pydoc3
|
%{_bindir}/pydoc3
|
||||||
%endif
|
%endif
|
||||||
|
Loading…
Reference in New Issue
Block a user