-%global __ospython %{_bindir}/python3
+%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%{?fedora} >= 40 || 0%{?suse_version} >= 1500 || 0%{?rhel} >= 10
%{expand: %%global py3ver %(echo `%{__ospython} -c "import sys; sys.stdout.write(sys.version[:4])"`)}
-%else
-%{expand: %%global py3ver %(echo `%{__ospython} -c "import sys; sys.stdout.write(sys.version[:3])"`)}
-%endif
%global python3_sitelib %(%{__ospython} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
Name: ydiff
Version: 1.4.2
-Release: 43PGDG%{?dist}
+Release: 44PGDG%{?dist}
Summary: View colored, incremental diff
-URL: https://github.com/ymattw/ydiff
+URL: https://github.com/ymattw/%{name}
License: BSD
-Source0: https://github.com/ymattw/ydiff/archive/%{version}/%{name}-%{version}.tar.gz
-BuildRequires: python3-devel
+Source0: https://github.com/ymattw/%{name}/archive/%{version}/%{name}-%{version}.tar.gz
+BuildRequires: python%{python3_pkgversion}-devel
BuildArch: noarch
Requires: less
%prep
%autosetup -n %{name}-%{version}
-/usr/bin/sed -i '/#!\/usr\/bin\/env python/d' ydiff.py
+%{_bindir}/sed -i '/#!\/usr\/bin\/env python/d' ydiff.py
%build
%{__ospython} setup.py build
%files
%doc README.rst
%license LICENSE
-%{_bindir}/ydiff
+%{_bindir}/%{name}
%files -n python3-%{name}
%{python3_sitelib}/__pycache__/*
%{python3_sitelib}/%{name}-%{version}-py%{py3ver}.egg-info
%changelog
+* Sat Apr 19 2025 Devrim Gündüz <devrim@gunduz.org> - 1.4.2-44PGDG
+- Build the package with Python 3.12 on RHEL 9 & 8 and Python 3.11 on SLES
+ 15. For the other distros (Fedora and RHEL 10) use OS'd default Python
+ version.
+ https://github.com/pgdg-packaging/pgdg-rpms/issues/16
+
* Sat Apr 19 2025 Devrim Gündüz <devrim@gunduz.org> - 1.4.2-43PGDG
- Rebuild on RHEL 8 because of an issue on the build instance