From 626168789c73d62eb211ec72fe260a128e66df45 Mon Sep 17 00:00:00 2001 From: Miro Hrončok Date: Feb 08 2021 11:11:39 +0000 Subject: Remove python2-rpm-macros https://fedoraproject.org/wiki/Changes/Disable_Python_2_Dist_RPM_Generators_and_Freeze_Python_2_Macros This is to be shipped together with an upgrade of python2.7: The python2.7 RPM package will contain the removed macros instead. The release is intentionally over-bumped to allow some changes of python-rpm-macros in lower versions of Fedora without the need to bump the version-release of python2-rpm-macros obsoleted by python2.7. --- diff --git a/macros.python2 b/macros.python2 deleted file mode 100644 index d4d4eda..0000000 --- a/macros.python2 +++ /dev/null @@ -1,64 +0,0 @@ -%python2_sitelib %(%{__python2} -Esc "from distutils.sysconfig import get_python_lib; print(get_python_lib())") -%python2_sitearch %(%{__python2} -Esc "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))") -%python2_version %(%{__python2} -Esc "import sys; sys.stdout.write('{0.major}.{0.minor}'.format(sys.version_info))") -%python2_version_nodots %(%{__python2} -Esc "import sys; sys.stdout.write('{0.major}{0.minor}'.format(sys.version_info))") -%python2_platform %(%{__python2} -Esc "import sysconfig; print(sysconfig.get_platform())") - -%py2_shbang_opts -s -%py2_shbang_opts_nodash %(opts=%{py2_shbang_opts}; echo ${opts#-}) -%py2_shebang_flags %(opts=%{py2_shbang_opts}; echo ${opts#-}) -%py2_shebang_fix %{expand:\\\ - if [ -z "%{?py_shebang_flags}" ]; then - shebang_flags="-k" - else - shebang_flags="-ka%{py2_shebang_flags}" - fi - /usr/bin/pathfix.py -pni %{__python2} $shebang_flags} - -# Use the slashes after expand so that the command starts on the same line as -# the macro -# The `sleep 1` commands work around a race in install; see: -# https://bugzilla.redhat.com/show_bug.cgi?id=1644923 -%py2_build() %{expand:\\\ - sleep 1 - CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\ - %{__python2} %{py_setup} %{?py_setup_args} build --executable="%{__python2} %{py2_shbang_opts}" %{?*} - sleep 1 -} - -%py2_build_egg() %{expand:\\\ - sleep 1 - CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\ - %{__python2} %{py_setup} %{?py_setup_args} bdist_egg %{?*} - sleep 1 -} - -%py2_build_wheel() %{expand:\\\ - sleep 1 - CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\ - %{__python2} %{py_setup} %{?py_setup_args} bdist_wheel %{?*} - sleep 1 -} - -%py2_install() %{expand:\\\ - CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\ - %{__python2} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?*} - rm -rfv %{buildroot}%{_bindir}/__pycache__ -} - -%py2_install_egg() %{expand:\\\ - mkdir -p %{buildroot}%{python2_sitelib} - %{__python2} -m easy_install -m --prefix %{buildroot}%{_prefix} -Z dist/*-py%{python2_version}.egg %{?*} - rm -rfv %{buildroot}%{_bindir}/__pycache__ -} - -%py2_install_wheel() %{expand:\\\ - %{__python2} -m pip install -I dist/%{1} --root %{buildroot} --no-deps --no-index --no-warn-script-location - rm -rfv %{buildroot}%{_bindir}/__pycache__ - for distinfo in %{buildroot}%{python2_sitelib}/*.dist-info %{buildroot}%{python2_sitearch}/*.dist-info; do - if [ -f ${distinfo}/direct_url.json ]; then - rm -fv ${distinfo}/direct_url.json - sed -i '/direct_url.json/d' ${distinfo}/RECORD - fi - done -} diff --git a/python-rpm-macros.spec b/python-rpm-macros.spec index 4e79fd2..0c4eb81 100644 --- a/python-rpm-macros.spec +++ b/python-rpm-macros.spec @@ -1,6 +1,6 @@ Name: python-rpm-macros Version: 3.9 -Release: 13%{?dist} +Release: 34%{?dist} Summary: The common Python RPM macros # macros and lua: MIT, compileall2.py: PSFv2 @@ -9,7 +9,6 @@ License: MIT and Python # Macros: Source101: macros.python Source102: macros.python-srpm -Source103: macros.python2 Source104: macros.python3 Source105: macros.pybytecompile @@ -48,19 +47,6 @@ Provides: bundled(python3dist(compileall2)) = %{compileall2_version} RPM macros for building Python source packages. -%package -n python2-rpm-macros -Summary: RPM macros for building Python 2 packages - -# For %%__python2 and %%python2 -Requires: python-srpm-macros = %{version}-%{release} - -# For %%py_setup -Requires: python-rpm-macros = %{version}-%{release} - -%description -n python2-rpm-macros -RPM macros for building Python 2 packages. - - %package -n python3-rpm-macros Summary: RPM macros for building Python 3 packages @@ -99,14 +85,15 @@ install -m 644 compileall2.py %{buildroot}%{_rpmconfigdir}/redhat/ %{_rpmconfigdir}/redhat/compileall2.py %{_rpmluadir}/fedora/srpm/python.lua -%files -n python2-rpm-macros -%{rpmmacrodir}/macros.python2 - %files -n python3-rpm-macros %{rpmmacrodir}/macros.python3 %changelog +* Mon Feb 08 2021 Miro Hrončok - 3.9-34 +- Remove python2-rpm-macros +- https://fedoraproject.org/wiki/Changes/Disable_Python_2_Dist_RPM_Generators_and_Freeze_Python_2_Macros + * Fri Feb 05 2021 Miro Hrončok - 3.9-13 - Automatically word-wrap the description of extras subpackages - Fixes: rhbz#1922442