Use distutils from setuptools

This commit is contained in:
Jiri Kucera 2022-12-02 00:28:11 +01:00
parent c8b2b50acd
commit 379b951e0a

View File

@ -156,17 +156,17 @@ export CXXFLAGS='%{optflags} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
# Explicit new lines in C(XX)FLAGS can break naive build scripts # Explicit new lines in C(XX)FLAGS can break naive build scripts
export CFLAGS="$(echo ${CFLAGS} | tr '\n\\' ' ')" export CFLAGS="$(echo ${CFLAGS} | tr '\n\\' ' ')"
export CXXFLAGS="$(echo ${CXXFLAGS} | tr '\n\\' ' ')" export CXXFLAGS="$(echo ${CXXFLAGS} | tr '\n\\' ' ')"
export SETUPTOOLS_USE_DISTUTILS=local
%configure --disable-static --disable-silent-rules --enable-languages=cpp,%{?with_qt:qt,}python %configure --disable-static --disable-silent-rules --enable-languages=cpp,%{?with_qt:qt,}python
%make_build %make_build
%install %install
%if 0%{?python3_version_nodots} >= 311 # When using distutils from setuptools 60+, ./setup.py install use
# When using distutils from setuptools on Python 3.11+, ./setup.py install # the .egg format. This forces setuptools to use .egg-info format.
# use .egg format. This forces setuptools to use .egg-info format.
# SETUP_PY_EXTRA_OPTS is introduced by the Patch1004 above. # SETUP_PY_EXTRA_OPTS is introduced by the Patch1004 above.
export SETUPTOOLS_USE_DISTUTILS=local
export SETUP_PY_EXTRA_OPTS="--single-version-externally-managed --root=/" export SETUP_PY_EXTRA_OPTS="--single-version-externally-managed --root=/"
%endif
%make_install %make_install
# unpackaged files # unpackaged files
@ -243,11 +243,7 @@ make check
%files -n python3-gpg %files -n python3-gpg
%doc lang/python/README %doc lang/python/README
%if 0%{?python3_version_nodots} < 311
%{python3_sitearch}/gpg-*.egg-info
%else
%{python3_sitearch}/gpg-*.egg-info/ %{python3_sitearch}/gpg-*.egg-info/
%endif
%{python3_sitearch}/gpg/ %{python3_sitearch}/gpg/
%changelog %changelog