File elfutils-debuginfod.spec of Package elfutils-debuginfod
212
1
#
2
# spec file for package elfutils-debuginfod
3
#
4
# Copyright (c) 2021 SUSE LLC
5
#
6
# All modifications and additions to the file contributed by third parties
7
# remain the property of their copyright owners, unless otherwise agreed
8
# upon. The license for this file, and modifications and additions to the
9
# file, is the same license as for the pristine package itself (unless the
10
# license for the pristine package is not an Open Source License, in which
11
# case the license is the MIT License). An "Open Source License" is a
12
# license that conforms to the Open Source Definition (Version 1.9)
13
# published by the Open Source Initiative.
14
15
# Please submit bugfixes or comments via https://bugs.opensuse.org/
16
#
17
18
19
Name: elfutils-debuginfod
20
Version: 0.185
21
Release: 0
22
Summary: Debuginfod server provided by elfutils
23
License: GPL-3.0-or-later
24
Group: Development/Tools/Building
25
URL: https://sourceware.org/elfutils/
26
#Git-Clone: git://sourceware.org/git/elfutils
27
Source: https://fedorahosted.org/releases/e/l/elfutils/%{version}/elfutils-%{version}.tar.bz2
28
Source1: https://fedorahosted.org/releases/e/l/elfutils/%{version}/elfutils-%{version}.tar.bz2.sig
29
Source2: elfutils.changes
30
Source3: elfutils.keyring
31
Patch0: disable-run-readelf-self-test.patch
32
Patch1: disable-run-deleted-test.patch
33
BuildRequires: autoconf
34
BuildRequires: automake
35
BuildRequires: bison
36
BuildRequires: bsdtar
37
BuildRequires: procps
38
# For the run-debuginfod-find.sh test case in %%check for /usr/sbin/ss
39
BuildRequires: curl
40
BuildRequires: flex
41
BuildRequires: gcc-c++
42
BuildRequires: iproute
43
BuildRequires: libbz2-devel
44
BuildRequires: libzstd-devel
45
BuildRequires: pkgconfig
46
BuildRequires: xz-devel
47
BuildRequires: zlib-devel
48
# For debuginfod
49
BuildRequires: pkgconfig(libarchive) >= 3.1.2
50
BuildRequires: pkgconfig(libcurl) >= 7.29.0
51
BuildRequires: pkgconfig(libmicrohttpd) >= 0.9.33
52
BuildRequires: pkgconfig(sqlite3) >= 3.7.17
53
BuildRequires: pkgconfig(systemd)
54
Requires: debuginfod-client = %{version}
55
Requires: elfutils = %{version}
56
Requires: sysconfig
57
Requires(post): %fillup_prereq
58
%{?systemd_requires}
59
60
%description
61
The elfutils-debuginfod package contains the debuginfod binary
62
and control files for a service that can provide ELF/DWARF
63
files to remote clients, based on build-id identification.
64
The ELF/DWARF file searching functions in libdwfl can query
65
such servers to download those files on demand.
66
67
%package -n libdebuginfod1
68
Summary: Library for build-id HTTP ELF/DWARF server
69
Group: System/Libraries
70
Conflicts: libdebuginfod1-dummy = %{version}
71
License: GPL-2.0-or-later OR LGPL-3.0-or-later
72
73
%description -n libdebuginfod1
74
The libdebuginfod1 package contains shared libraries
75
dynamically loaded from -ldw, which use a debuginfod service
76
to look up debuginfo and associated data. Also includes a
77
command-line frontend.
78
79
%package -n libdebuginfod-devel
80
Summary: Libraries and headers to build debuginfod client applications
81
Group: Development/Libraries/C and C++
82
Conflicts: libdebuginfod-dummy-devel = %{version}
83
License: GPL-2.0-or-later OR LGPL-3.0-or-later
84
85
%description -n libdebuginfod-devel
86
The libdebuginfod-devel package contains the libraries
87
to create applications to use the debuginfod service.
88
89
%package -n debuginfod-client
90
Summary: Command line client for build-id HTTP ELF/DWARF server
91
Group: Development/Tools/Building
92
Conflicts: debuginfod-dummy-client = %{version}
93
94
%description -n debuginfod-client
95
The elfutils-debuginfod-client package contains a command-line frontend.
96
97
%lang_package
98
99
%prep
100
%autosetup -n elfutils-%version -p1
101
102
%build
103
%global _lto_cflags %{_lto_cflags} -flto-partition=none -Wno-error=stack-usage=
104
# Change DATE/TIME macros to use last change time of elfutils.changes
105
# See http://lists.opensuse.org/opensuse-factory/2011-05/msg00304.html
106
modified="$(sed -n '/^----/n;s/ - .*$//;p;q' "%{_sourcedir}/%{name}.changes")"
107
DATE="\"$(date -d "${modified}" "+%%b %%e %%Y")\""
108
TIME="\"$(date -d "${modified}" "+%%R")\""
109
find . -type f -regex ".*\.c\|.*\.cpp\|.*\.h" -exec sed -i "s/__DATE__/${DATE}/g;s/__TIME__/${TIME}/g" {} +
110
# Set modversion used to verify dynamically loaded ebl backend matches to
111
# similarly predictable value [upstream default is hostname + date]
112
MODVERSION="suse-build `eval echo ${DATE} ${TIME}`"
113
sed --in-place "s/^MODVERSION=.*\$/MODVERSION=\"${MODVERSION}\"/" configure.ac
114
export CFLAGS="%optflags"
115
CFLAGS+=" -g" # make tests pass when user does not want debuginfo (boo#1031556)
116
%ifarch %sparc
117
# Small PIC model not sufficient
118
CFLAGS+=" -fPIC"
119
%endif
120
autoreconf -fi
121
# some patches create new test scripts, which are created 644 by default
122
chmod a+x tests/run*.sh
123
%configure --enable-debuginfod-urls=https://debuginfod.opensuse.org/ \
124
--program-prefix=eu-
125
%make_build
126
127
%install
128
%make_install
129
# remove unneeded files
130
rm -f %{buildroot}/%{_libdir}/*.la
131
ls -lR %{buildroot}/%{_libdir}/libelf*
132
133
rm -f %{buildroot}/%{_bindir}/eu*
134
rm -f %{buildroot}/%{_libdir}/libasm*
135
rm -f %{buildroot}/%{_includedir}/elfutils/lib*.h
136
rm -f %{buildroot}/%{_includedir}/elfutils/elf-knowledge.h
137
rm -f %{buildroot}/%{_includedir}/elfutils/known-dwarf.h
138
rm -f %{buildroot}/%{_includedir}/elfutils/version.h
139
rm -f %{buildroot}/%{_libdir}/libelf*
140
rm -f %{buildroot}/%{_includedir}/libelf.h
141
rm -f %{buildroot}/%{_includedir}/gelf.h
142
rm -f %{buildroot}/%{_includedir}/nlist.h
143
rm -f %{buildroot}/%{_includedir}/dwarf.h
144
rm -f %{buildroot}/%{_libdir}/libdw*
145
rm -f %{buildroot}/%{_mandir}/man3/elf_*.3*
146
rm -f %{buildroot}/%{_mandir}/man1/eu-*.1*
147
rm -rf %{buildroot}%{_datadir}/locale/
148
rm -f %{buildroot}/%{_libdir}/pkgconfig/libdw.pc
149
rm -f %{buildroot}/%{_libdir}/pkgconfig/libelf.pc
150
151
install -Dm0644 config/debuginfod.service %{buildroot}%{_unitdir}/debuginfod.service
152
install -d -m 755 %{buildroot}%{_fillupdir}
153
cp config/debuginfod.sysconfig %{buildroot}%{_fillupdir}/sysconfig.debuginfod
154
155
mkdir -p %{buildroot}%{_localstatedir}/cache/debuginfod
156
touch %{buildroot}%{_localstatedir}/cache/debuginfod/debuginfod.sqlite
157
158
%post -n libdebuginfod1 -p /sbin/ldconfig
159
%postun -n libdebuginfod1 -p /sbin/ldconfig
160
161
%check
162
%if 0%{?qemu_user_space_build}
163
# qemu-linux-user does not support ptrace and a few other process details
164
export XFAIL_TESTS="dwfl-proc-attach run-backtrace-dwarf.sh run-backtrace-native.sh run-deleted.sh"
165
%endif
166
%make_build check
167
168
%files
169
%license COPYING
170
%doc AUTHORS ChangeLog NEWS NOTES README THANKS TODO
171
%{_bindir}/debuginfod
172
%{_unitdir}/debuginfod.service
173
%{_mandir}/man8/debuginfod.8*
174
%{_fillupdir}/sysconfig.debuginfod
175
176
%dir %attr(0700,debuginfod,debuginfod) %{_localstatedir}/cache/debuginfod
177
%verify(not md5 size mtime) %attr(0600,debuginfod,debuginfod) %{_localstatedir}/cache/debuginfod/debuginfod.sqlite
178
179
%files -n libdebuginfod1
180
%{_libdir}/libdebuginfod.so.*
181
%{_libdir}/libdebuginfod-%{version}.so
182
%config %{_sysconfdir}/profile.d/debuginfod.sh
183
%config %{_sysconfdir}/profile.d/debuginfod.csh
184
185
%files -n libdebuginfod-devel
186
%{_libdir}/pkgconfig/libdebuginfod.pc
187
%{_mandir}/man3/debuginfod_*.3*
188
%dir %{_includedir}/elfutils
189
%{_includedir}/elfutils/debuginfod.h
190
%{_libdir}/libdebuginfod.so
191
192
%files -n debuginfod-client
193
%{_bindir}/debuginfod-find
194
%{_mandir}/man1/debuginfod-find.1*
195
196
%pre
197
getent group debuginfod >/dev/null || %{_sbindir}/groupadd -r debuginfod
198
getent passwd debuginfod >/dev/null || %{_sbindir}/useradd -r -g debuginfod -d %{_localstatedir}/cache/debuginfod -s /bin/false -c "elfutils debuginfo server" debuginfod
199
%service_add_pre debuginfod.service
200
201
%post
202
%service_add_post debuginfod.service
203
%{fillup_only -n debuginfod}
204
205
%preun
206
%service_del_preun debuginfod.service
207
208
%postun
209
%service_del_postun debuginfod.service
210
211
%changelog
212