From 35b3a1b5c902f39d488542ed137450fb1b7be2d3 Mon Sep 17 00:00:00 2001 From: Amit Shah Date: Mon, 1 Aug 2022 12:35:18 +0530 Subject: [PATCH] Use distro-configured debuginfod server Fedora and CentOS configure a debuginfod server by default, whereas RHEL and Amazon Linux do not. The new `dist_debuginfod_url` macro sets the server URL in a central place. Use that value, if defined, to configure with a default server. If unset, do not configure one. This ensures we have a unified spec file for all distro variants, and distro-specific config resides in the macros.dist file. With this change, we do not need the recently-added bcond for with_debuginfo_url, so drop it. Signed-off-by: Amit Shah --- elfutils.spec | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/elfutils.spec b/elfutils.spec index 11e7613..64b964a 100644 --- a/elfutils.spec +++ b/elfutils.spec @@ -1,6 +1,6 @@ Name: elfutils Version: 0.187 -%global baserelease 7 +%global baserelease 8 Release: %{baserelease}%{?dist} URL: http://elfutils.org/ %global source_url ftp://sourceware.org/pub/elfutils/%{version}/ @@ -68,8 +68,6 @@ BuildRequires: gettext-devel %global with_sysusers 1 %endif -%bcond with_debuginfod_url 1 - # Patches # For s390x... FDO package notes are bogus. @@ -273,8 +271,11 @@ RPM_OPT_FLAGS="${RPM_OPT_FLAGS} -Wformat" trap 'cat config.log' EXIT -%if %{with with_debuginfod_url} -%configure CFLAGS="$RPM_OPT_FLAGS" --enable-debuginfod-urls=https://debuginfod.fedoraproject.org/ +# dist_debuginfod_url is defined in macros.dist. Fedora and CentOS have +# URLs pointing to their respective servers. RHEL and Amazon Linux do +# not configure a default server. +%if "%{?dist_debuginfod_url}" +%configure CFLAGS="$RPM_OPT_FLAGS" --enable-debuginfod-urls=%{dist_debuginfod_url} %else %configure CFLAGS="$RPM_OPT_FLAGS" %endif @@ -401,7 +402,7 @@ fi %{_mandir}/man1/debuginfod-find.1* %{_mandir}/man7/debuginfod*.7* %config(noreplace) %{_sysconfdir}/profile.d/* -%if %{with with_debuginfod_url} +%if "%{?dist_debuginfod_url}" %config(noreplace) %{_sysconfdir}/debuginfod/* %endif @@ -442,6 +443,9 @@ exit 0 %systemd_postun_with_restart debuginfod.service %changelog +* Mon Aug 1 2022 Amit Shah - 0.187-8 +- Auto-configure debuginfod_url based on macros.dist + * Wed Jul 27 2022 Amit Shah - 0.187-7 - Allow building without default debuginfod URL