public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Nils Philippsen <nils@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/python-rpmautospec] rawhide: Cope with versioned libgit2 from F45 on
Date: Tue, 23 Jun 2026 08:36:09 GMT	[thread overview]
Message-ID: <178220376904.1.16516011976007486845.rpms-python-rpmautospec-896634be28b3@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/python-rpmautospec
            Branch : rawhide
            Commit : 896634be28b3a023b24ee218f418c028192460a5
            Author : Nils Philippsen <nils@redhat.com>
            Date   : 2026-06-09T13:01:38+02:00
            Stats  : +28/-8 in 1 file(s)
            URL    : https://src.fedoraproject.org/rpms/python-rpmautospec/c/896634be28b3a023b24ee218f418c028192460a5?branch=rawhide

            Log:
            Cope with versioned libgit2 from F45 on

[skip changelog]

Signed-off-by: Nils Philippsen <nils@redhat.com>

---
diff --git a/python-rpmautospec.spec b/python-rpmautospec.spec
index 880907e..71e9f7d 100644
--- a/python-rpmautospec.spec
+++ b/python-rpmautospec.spec
@@ -40,13 +40,29 @@
 %bcond old_hatchling 1
 %endif
 
-# Although this supports a range of libgit2 and librpm versions upstream,
-# we want to ensure newer versions don’t accidentally break all packages using this.
-# Hence we artificially restrict the Required version to what was tested during the build.
-# When libgit2/librpm soname is bumped, this package needs to be rebuilt (and tested).
-%define libgit2_lower_bound 1.7
-%define libgit2_upper_bound 1.10
-%define libgit2_requires %(rpm -q --provides libgit2 | grep '^libgit2\.so\.' | sed 's/()(64bit)$//' | head -n 1)
+# From Fedora 45 on libgit2 packages are versioned, i.e. named "libgit2_X.Y". In this case, pin the
+# package name. On older releases (and EPEL for the time being), depend on plain "libgit2" for
+# building. In all cases, pin the SONAME for runtime.
+
+%if ! 0%{?fedora}%{?rhel} || 0%{?fedora} >= 45
+%bcond versioned_libgit2 1
+%else
+%bcond versioned_libgit2 0
+%endif
+
+%if %{with versioned_libgit2}
+%global libgit2_pkg libgit2_1.9
+%else
+%global libgit2_lower_bound 1.7
+%global libgit2_upper_bound 1.10
+%global libgit2_pkg libgit2
+%endif
+
+# Although this supports a range of libgit2 versions upstream, we want to ensure newer versions
+# don’t accidentally break all packages using this. Hence we artificially restrict the Required
+# version to what was tested during the build. When the libgit2 soname is bumped, this package needs
+# to be rebuilt (and tested).
+%define libgit2_requires %(rpm -q --provides %{libgit2_pkg} | grep '^libgit2\.so\.' | sed 's/()(64bit)$//' | head -n 1)
 
 %global srcname rpmautospec
 
@@ -92,7 +108,11 @@ BuildRequires: python3dist(pytest-xdist)
 
 BuildRequires: sed
 
-BuildRequires: (libgit2 >= %libgit2_lower_bound with libgit2 < %libgit2_upper_bound)
+%if %{with versioned_libgit2}
+BuildRequires: %{libgit2_pkg}
+%else
+BuildRequires: (%{libgit2_pkg} >= %libgit2_lower_bound with %{libgit2_pkg} < %libgit2_upper_bound)
+%endif
 BuildRequires: rpm-libs
 BuildRequires: rpm-build-libs
 

                 reply	other threads:[~2026-06-23  8:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178220376904.1.16516011976007486845.rpms-python-rpmautospec-896634be28b3@fedoraproject.org \
    --to=nils@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox