]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
config: Enable Debuginfod RPM sig checking and eu-stacktrace in spec
authorMark Wielaard <mark@klomp.org>
Thu, 24 Oct 2024 09:34:11 +0000 (11:34 +0200)
committerMark Wielaard <mark@klomp.org>
Thu, 24 Oct 2024 16:39:22 +0000 (18:39 +0200)
For testing that the eu-stacktrace and debuginfod ima verification
code builds correctly explicitly add --enable-stacktrace and
--enable-debuginfod-ima-verification to configure.

 * config/elfutils.spec.in (enable_stacktrace): New global,
         depends on arch.
 (BuildRequires): Add sysprof-capture-devel.
 (configure): Add --enable-stacktrace and
 --enable-debuginfod-ima-verification.
 (files): Add eu-stacktrace.

Signed-off-by: Mark Wielaard <mark@klomp.org>
config/elfutils.spec.in

index e63a3c1083ef368fbc1fdb7d314067f33d4f4439..96934514818dc239b84a388ab182bf9044a3eafc 100644 (file)
@@ -7,6 +7,13 @@ License: GPLv3+ and (GPLv2+ or LGPLv3+) and GFDL
 Source: ftp://sourceware.org/pub/elfutils/%{version}/elfutils-%{version}.tar.bz2
 Summary: A collection of utilities and DSOs to handle ELF files and DWARF data
 
+# eu-stacktrace currently only supports x86_64
+%ifarch x86_64
+%global enable_stacktrace 1
+%else
+%global enable_stacktrace 0
+%endif
+
 Requires: elfutils-libelf = %{version}-%{release}
 Requires: elfutils-libs = %{version}-%{release}
 # Can be a Recommends if rpm supports that
@@ -53,6 +60,11 @@ BuildRequires: ima-evm-utils-devel
 BuildRequires: openssl-devel
 BuildRequires: rpm-sign
 
+# For eu-stacktrace
+%if %{enable_stacktrace}
+BuildRequires: sysprof-capture-devel
+%endif
+
 %define _gnu %{nil}
 %define _programprefix eu-
 
@@ -197,7 +209,13 @@ such servers to download those files on demand.
 %setup -q
 
 %build
-%configure --program-prefix=%{_programprefix} --enable-debuginfod --enable-debuginfod-urls
+%configure --program-prefix=%{_programprefix} \
+           --enable-debuginfod \
+           --enable-debuginfod-urls=https://debuginfod.elfutils.org/ \
+%if %{enable_stacktrace}
+           --enable-stacktrace \
+%endif
+           --enable-debuginfod-ima-verification
 make -s %{?_smp_mflags}
 
 %install
@@ -259,6 +277,9 @@ fi
 %{_bindir}/eu-size
 %{_bindir}/eu-srcfiles
 %{_bindir}/eu-stack
+%if %{enable_stacktrace}
+%{_bindir}/eu-stacktrace
+%endif
 %{_bindir}/eu-strings
 %{_bindir}/eu-strip
 %{_bindir}/eu-unstrip