-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathelfutils.spec
More file actions
354 lines (303 loc) · 11.1 KB
/
Copy pathelfutils.spec
File metadata and controls
354 lines (303 loc) · 11.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
# TODO:
# - package debuginfod.service
#
# Conditional build:
%bcond_without debuginfod # debuginfod server and client
%bcond_without tests # do not perform tests
#
Summary: A collection of utilities and DSOs to handle compiled objects
Summary(pl.UTF-8): Zestaw narzędzi i bibliotek do obsługi skompilowanych obiektów
Name: elfutils
Version: 0.196
Release: 1
License: GPL v2+ or LGPL v3+ (libraries), GPL v3+ (programs)
Group: Development/Tools
Source0: https://sourceware.org/elfutils/ftp/%{version}/%{name}-%{version}.tar.bz2
# Source0-md5: 8d3f6cf81a8d27d6fa917ac1b566d8ff
Patch0: %{name}-pl.po.patch
Patch1: %{name}-debian-manpages.patch
Patch3: %{name}-align.patch
Patch4: %{name}-paxflags.patch
Patch5: %{name}-sparc.patch
Patch6: disable-tests.patch
URL: https://sourceware.org/elfutils/
BuildRequires: autoconf >= 2.69
BuildRequires: automake >= 1:1.11
%{?with_tests:BuildRequires: bsdtar}
BuildRequires: bzip2-devel
BuildRequires: gawk
BuildRequires: gcc >= 6:4.3
BuildRequires: gettext-tools >= 0.19.6
BuildRequires: glibc-devel >= 6:2.7
BuildRequires: libstdc++-devel >= 6:4.7
BuildRequires: perl-tools-pod
BuildRequires: pkgconfig
BuildRequires: rpmbuild(macros) >= 1.527
BuildRequires: sharutils
BuildRequires: xz-devel
BuildRequires: zlib-devel
BuildRequires: zstd-devel >= 1.4.0
%if %{with tests} && %(test -d /proc/self ; echo $?)
# native test needs proc (for libdwfl -p PID to work)
BuildRequires: MOUNTED_PROC
%endif
%if %{with debuginfod}
BuildRequires: curl-devel >= 7.29.0
BuildRequires: json-c-devel >= 0.11
BuildRequires: libarchive-devel >= 3.1.2
BuildRequires: libmicrohttpd-devel >= 0.9.33
BuildRequires: sqlite3-devel >= 3.7.17
%endif
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
# fails to build with -Wl,-s
%define filterout_ld (-Wl,)?-[sS] (-Wl,)?--strip.*
%if %{with tests} && 0%(echo %{rpmcflags} | grep -q '\<-g' ; echo $?)
# tests require debug symbols
%define specflags -g
%endif
%define filterout_cpp -DNDEBUG
%define programprefix eu-
%description
Elfutils is a collection of utilities, including ld (a linker), nm
(for listing symbols from object files), size (for listing the section
sizes of an object or archive file), strip (for discarding symbols),
readline (the see the raw ELF file structures), and elflint (to check
for well-formed ELF files).
%description -l pl.UTF-8
Elfutils to zestaw narzędzi, składający się z ld (linkera), nm (do
listowania symboli z plików obiektów), size (do listowania rozmiarów
sekcji plików obiektów lub archiwów), strip (do usuwania symboli),
readline (do oglądania surowych struktur plików ELF) oraz elflint (do
sprawdzania poprawności plików ELF).
%package libs
Summary: Libraries to handle compiled objects
Summary(pl.UTF-8): Biblioteki do obsługi skompilowanych obiektów
Group: Libraries
Requires: %{name}-libelf%{?_isa} = %{version}-%{release}
Requires: zstd%{?_isa} >= 1.4.0
%description libs
Libraries which implement DWARF, ELF, and machine-specific ELF
handling.
%description libs -l pl.UTF-8
Biblioteki z zaimplementowaną obsługą DWARF, ELF i ELF specyficznych
dla architektury.
%package devel
Summary: Development part of libraries to handle compiled objects
Summary(pl.UTF-8): Część programistyczna bibliotek do obsługi skompilowanych obiektów
Group: Development/Libraries
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
Requires: bzip2-devel%{?_isa}
Requires: xz-devel%{?_isa}
Requires: zlib-devel%{?_isa}
Requires: zstd-devel%{?_isa} >= 1.4.0
Obsoletes: libelf-devel < 0.8.14
Obsoletes: libelf0-devel < 0.8.14
%description devel
The elfutils-devel package contains the development part of libraries
to create applications for handling compiled objects. libelf allows
you to access the internals of the ELF object file format, so you can
see the different sections of an ELF file. libdw provides access to
the DWARF debugging information. libasm provides a programmable
assembler interface.
%description devel -l pl.UTF-8
Pakiet elfutils-devel zawiera część programistyczną bibliotek do
tworzenia aplikacji obsługujących skompilowane obiekty. libelf pozwala
na dostęp do wnętrzności formatu pliku obiektowego ELF, co pozwala na
oglądanie różnych sekcji pliku ELF. libdw pozwala na dostęp do
informacji DWARF służących do odpluskwiania. libasm udostępnia
programowalny interfejs asemblera.
%package libelf
Summary: Library to read and write ELF files
Summary(pl.UTF-8): Biblioteki do odczytu i zapisu plików ELF
Group: Libraries
#Obsoletes: libelf
%description libelf
The elfutils-libelf package provides a DSO which allows reading and
writing ELF files on a high level. Third party programs depend on this
package to read internals of ELF files. The programs of the elfutils
package use it also to generate new ELF files.
%description libelf -l pl.UTF-8
Pakiet elfutils-libelf udostępnia bibliotekę dzieloną, która pozwala
na wysokopoziomowe czytanie i zapisywanie plików ELF. Inne programy
wymagają tego pakietu, aby odczytywać zawartość plików ELF. Programy z
pakietu elfutils używają jej także do generowania nowych plików ELF.
%package static
Summary: Static libraries to handle compiled objects
Summary(pl.UTF-8): Statyczne biblioteki do obsługi skompilowanych obiektów
Group: Development/Libraries
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
Requires: zstd%{?_isa} >= 1.4.0
Obsoletes: libelf-static < 0.8.14
%description static
The elfutils-static package contains the static libraries to create
applications for handling compiled objects. libelf allows you to
access the internals of the ELF object file format, so you can see the
different sections of an ELF file. libdw provides access to the DWARF
debugging information. libasm provides a programmable assembler
interface.
%description static -l pl.UTF-8
Pakiet elfutils-static zawiera statyczne biblioteki do tworzenia
aplikacji obsługujących skompilowane obiekty. libelf pozwala na dostęp
do wnętrzności formatu pliku obiektowego ELF, co pozwala na oglądanie
różnych sekcji pliku ELF. libdw pozwala na dostęp do informacji DWARF
służących do odpluskwiania. libasm udostępnia programowalny interfejs
asemblera.
%package debuginfod
Summary: debuginfod server and client
Summary(pl.UTF-8): Serwer i klient debuginfod
Group: Libraries
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
Requires: %{name}-debuginfod-libs%{?_isa} = %{version}-%{release}
Requires: json-c%{?_isa} >= 0.11
Requires: libarchive%{?_isa} >= 3.1.2
Requires: libmicrohttpd%{?_isa} >= 0.9.33
Requires: sqlite3-libs%{?_isa} >= 3.7.17
%description debuginfod
debuginfod server and client.
%description debuginfod -l pl.UTF-8
Serwer i klient debuginfod.
%package debuginfod-libs
Summary: debuginfod library
Summary(pl.UTF-8): Biblioteka debuginfod
Group: Libraries
Requires: %{name}-libelf%{?_isa} = %{version}-%{release}
Requires: curl-libs%{?_isa} >= 7.29.0
Requires: json-c%{?_isa} >= 0.11
Conflicts: elfutils-debuginfod < 0.187-3
%description debuginfod-libs
debuginfod library.
%description debuginfod-libs -l pl.UTF-8
Biblioteka debuginfod.
%package debuginfod-devel
Summary: Header file for debuginfod library
Summary(pl.UTF-8): Plik nagłówkowy biblioteki debuginfod
Group: Development/Libraries
Requires: %{name}-debuginfod-libs%{?_isa} = %{version}-%{release}
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
%description debuginfod-devel
Header file for debuginfod library.
%description debuginfod-devel -l pl.UTF-8
Plik nagłówkowy biblioteki debuginfod.
%prep
%setup -q
%patch -P0 -p1
%patch -P1 -p1
%patch -P3 -p1
%patch -P4 -p1
%patch -P5 -p1
%patch -P6 -p1
%{__rm} po/stamp-po
# temporarily disable failing tests (depending on arch)
%ifarch x32
%{__sed} -i -e 's/run-backtrace-native-biarch.sh//' tests/Makefile.am
%endif
# make sure this is not even tried on arch it has no chance to run
%ifarch %{ix86}
%{__sed} -i -e 's/run-disasm-x86-64.sh//' tests/Makefile.am
%endif
%build
#%%{__gettextize}
%{__aclocal} -I m4
%{__autoconf}
%{__autoheader}
%{__automake}
%configure \
--disable-silent-rules \
%{__enable_disable debuginfod} \
--program-prefix=%{programprefix}
# make check depends on test-nlist not stripped
%{__perl} -pi -e 's/^(LDFLAGS =.*)-s/$1/' tests/Makefile
%{__make}
%{__make} -C debian/man
%if %{with tests}
# some tests rely on English messages
LC_ALL=C \
%{__make} -C tests check
%endif
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT{%{_mandir}/man1,/%{_lib}}
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
install debian/man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
%{__mv} $RPM_BUILD_ROOT%{_libdir}/{libelf-*.so,libelf.so.*} $RPM_BUILD_ROOT/%{_lib}
ln -sf /%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/libelf-*.so) \
$RPM_BUILD_ROOT%{_libdir}/libelf.so
%find_lang %{name}
%clean
rm -rf $RPM_BUILD_ROOT
%post libs -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig
%post libelf -p /sbin/ldconfig
%postun libelf -p /sbin/ldconfig
%post debuginfod-libs -p /sbin/ldconfig
%postun debuginfod-libs -p /sbin/ldconfig
%files
%defattr(644,root,root,755)
%doc AUTHORS CONTRIBUTING ChangeLog NEWS NOTES README THANKS TODO
%attr(755,root,root) %{_bindir}/eu-*
%{_mandir}/man1/eu-*.1*
%files libs
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/libasm-*.so
%attr(755,root,root) %ghost %{_libdir}/libasm.so.1
%attr(755,root,root) %{_libdir}/libdw-*.so
%attr(755,root,root) %ghost %{_libdir}/libdw.so.1
%files devel
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/libasm.so
%attr(755,root,root) %{_libdir}/libdw.so
%attr(755,root,root) %{_libdir}/libelf.so
%{_includedir}/dwarf.h
%{_includedir}/gelf.h
%{_includedir}/libelf.h
%{_includedir}/nlist.h
%dir %{_includedir}/elfutils
%{_includedir}/elfutils/elf-knowledge.h
%{_includedir}/elfutils/known-dwarf.h
%{_includedir}/elfutils/libasm.h
%{_includedir}/elfutils/libdw.h
%{_includedir}/elfutils/libdwelf.h
%{_includedir}/elfutils/libdwfl.h
%{_includedir}/elfutils/libdwfl_stacktrace.h
%{_includedir}/elfutils/version.h
%{_pkgconfigdir}/libdw.pc
%{_pkgconfigdir}/libelf.pc
%{_mandir}/man3/elf*.3*
%{_mandir}/man3/gelf*.3*
%{_mandir}/man3/libelf.3*
%files libelf -f %{name}.lang
%defattr(644,root,root,755)
%attr(755,root,root) /%{_lib}/libelf-*.so
%attr(755,root,root) %ghost /%{_lib}/libelf.so.1
%files static
%defattr(644,root,root,755)
%{_libdir}/libasm.a
%{_libdir}/libdw.a
%{_libdir}/libelf.a
%if %{with debuginfod}
%files debuginfod
%defattr(644,root,root,755)
%attr(755,root,root) %{_bindir}/debuginfod
%attr(755,root,root) %{_bindir}/debuginfod-find
%{_mandir}/man1/debuginfod-find.1*
%{_mandir}/man7/debuginfod-client-config.7*
%{_mandir}/man8/debuginfod.8*
# uncomment after packaging debuginfod.service
#%{_mandir}/man8/debuginfod.service.8*
%attr(755,root,root) /etc/profile.d/debuginfod.sh
%attr(755,root,root) /etc/profile.d/debuginfod.csh
# TODO: (but dir owned by fish currently)
#%{_datadir}/fish/vendor_conf.d/debuginfod.fish
%files debuginfod-libs
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/libdebuginfod-*.so
%attr(755,root,root) %ghost %{_libdir}/libdebuginfod.so.1
%files debuginfod-devel
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/libdebuginfod.so
%{_includedir}/elfutils/debuginfod.h
%{_pkgconfigdir}/libdebuginfod.pc
%{_mandir}/man3/debuginfod_*.3*
%endif