python3-consul: Add SLES 16 support. Also switch to pyproject build
authorDevrim Gunduz <devrim@gunduz.org>
Sat, 8 Nov 2025 13:31:55 +0000 (16:31 +0300)
committerDevrim Gunduz <devrim@gunduz.org>
Sat, 8 Nov 2025 13:31:55 +0000 (16:31 +0300)
rpm/redhat/main/common/python3-consul/main/python3-consul.spec

index 041a4d5682c8090ce13b0b9f82ffa5eef0b8de8c..1c0952c16b9a7467a14afafdeadd46998d4672c0 100644 (file)
@@ -1,17 +1,31 @@
 %global sname consul
 
-%global __ospython %{_bindir}/python3
-%if 0%{?fedora} >= 40 || 0%{?rhel} >= 10
-%{expand: %%global pyver %(echo `%{__python3} -c "import sys; sys.stdout.write(sys.version[:4])"`)}
-%else
-%{expand: %%global pyver %(echo `%{__python3} -c "import sys; sys.stdout.write(sys.version[:3])"`)}
+%if 0%{?fedora} && 0%{?fedora} == 43
+%global __ospython %{_bindir}/python3.14
+%global python3_pkgversion 3.14
+%endif
+%if 0%{?fedora} && 0%{?fedora} <= 42
+%global        __ospython %{_bindir}/python3.13
+%global        python3_pkgversion 3.13
+%endif
+%if 0%{?rhel} && 0%{?rhel} <= 10
+%global        __ospython %{_bindir}/python3.12
+%global        python3_pkgversion 3.12
+%endif
+%if 0%{?suse_version} == 1500
+%global        __ospython %{_bindir}/python3.11
+%global        python3_pkgversion 311
+%endif
+%if 0%{?suse_version} == 1600
+%global        __ospython %{_bindir}/python3.13
+%global        python3_pkgversion 313
 %endif
-%global python3_sitelib %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
 
+%{expand: %%global pyver %(echo `%{__python3} -c "import sys; sys.stdout.write(sys.version[:4])"`)}
 
 Name:          python3-%{sname}
 Version:       1.1.0
-Release:       3PGDG%{?dist}
+Release:       4PGDG%{?dist}
 Summary:       Python client for Consul
 
 License:       MIT
@@ -22,7 +36,12 @@ BuildArch:   noarch
 
 Requires:      less python3
 BuildRequires: python3-six >= 1.4 python3-requests >= 2.0
-BuildRequires: python3-devel python3-setuptools
+BuildRequires: python3-devel
+%if 0%{?suse_version} >= 1500
+BuildRequires: python-rpm-macros
+%else
+BuildRequires: pyproject-rpm-macros
+%endif
 
 %description
 Python client for Consul (http://www.consul.io/)
@@ -31,19 +50,23 @@ Python client for Consul (http://www.consul.io/)
 %setup -q -n python-%{sname}-%{version}
 
 %build
-%{__ospython} setup.py build
+%pyproject_wheel
 
 %install
-%{__ospython} setup.py install -O1 --skip-build --root %{buildroot}
+%pyproject_install
 
 %files
 %license LICENSE
 %doc README.rst
 %{python3_sitelib}/consul/__pycache__/*
 %{python3_sitelib}/consul/*.py
- %{python3_sitelib}/python_%{sname}-%{version}-py%{pyver}.egg-info/*
+%{python3_sitelib}/python_%{sname}-%{version}.dist-info/*
 
 %changelog
+* Sat Nov 8 2025 Devrim Gündüz <devrim@gunduz.org> - 1.1.0-4PGDG
+- Add SLES 16 support
+- Switch to pyproject build
+
 * Tue Dec 17 2024 Devrim Gündüz <devrim@gunduz.org> - 1.1.0-3PGDG
 - Add RHEL 10 support
 - Add PGDG branding