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
|
#
# Please submit bugfixes or comments via http://bugs.meego.com/
#
%define scanf_has_m 1
%define use_zlib 1
%define use_xz 0
Name: elfutils
Version: 0.152
Release: 1
License: GPLv2 with exceptions
Summary: A collection of utilities and DSOs to handle compiled objects
Url: https://fedorahosted.org/elfutils/
Group: Development/Tools
Source: http://fedorahosted.org/releases/e/l/elfutils/%{name}-%{version}.tar.bz2
Patch1: elfutils-robustify.patch
Patch2: elfutils-portability.patch
Requires: elfutils-libelf-%{_arch} = %{version}
Requires: elfutils-libs-%{_arch} = %{version}
BuildRequires: bison >= 1.875
BuildRequires: bzip2
BuildRequires: flex >= 2.5.4a
%if %{use_zlib}
BuildRequires: bzip2-devel
BuildRequires: pkgconfig(zlib) >= 1.2.2.3
%endif
%if %{use_xz}
BuildRequires: pkgconfig(liblzma)
%endif
%define _gnu %{nil}
%define _program_prefix 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), readelf (to see the raw ELF file structures), and elflint
(to check for well-formed ELF files).
%package libs
Summary: Libraries to handle compiled objects
Group: System/Libraries
Requires: elfutils-libelf-%{_arch} = %{version}
Provides: elfutils-libs-%{_arch} = %{version}
%description libs
The elfutils-libs package contains libraries which implement DWARF, ELF,
and machine-specific ELF handling. These libraries are used by the programs
in the elfutils package. The elfutils-devel package enables building
other programs using these libraries.
%package devel
Summary: Development libraries to handle compiled objects
Group: Development/Libraries
Requires: elfutils-libelf-devel-%{_arch} = %{version}
Requires: elfutils-libs-%{_arch} = %{version}
Provides: elfutils-devel-%{_arch} = %{version}
%description devel
The elfutils-devel package contains the libraries to create
applications for handling compiled objects. libebl provides some
higher-level ELF access functionality. libdw provides access to
the DWARF debugging information. libasm provides a programmable
assembler interface.
%package devel-static
Summary: Static archives to handle compiled objects
Group: Development/Libraries
Requires: elfutils-devel-%{_arch} = %{version}
Requires: elfutils-libelf-devel-static-%{_arch} = %{version}
Provides: elfutils-devel-static-%{_arch} = %{version}
%description devel-static
The elfutils-devel-static package contains the static archives
with the code to handle compiled objects.
%package libelf
Summary: Library to read and write ELF files
Group: System/Libraries
Provides: elfutils-libelf-%{_arch} = %{version}
Obsoletes: libelf <= 0.8.2-2
%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.
%package libelf-devel
Summary: Development support for libelf
Group: Development/Libraries
Requires: elfutils-libelf-%{_arch} = %{version}
Provides: elfutils-libelf-devel-%{_arch} = %{version}
Obsoletes: libelf-devel <= 0.8.2-2
%description libelf-devel
The elfutils-libelf-devel package contains the 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.
%package libelf-devel-static
Summary: Static archive of libelf
Group: Development/Libraries
Requires: elfutils-libelf-devel-%{_arch} = %{version}
Provides: elfutils-libelf-devel-static-%{_arch} = %{version}
%description libelf-devel-static
The elfutils-libelf-static package contains the static archive
for libelf.
%prep
%setup -q
%patch1 -p1 -b .robustify
%if !0%{?scanf_has_m}
sed -i.scanf-m -e 's/%m/%a/g' src/addr2line.c tests/line2addr.c
%endif
find . -name \*.sh ! -perm -0100 -print | xargs chmod +x
%build
# Remove -Wall from default flags. The makefiles enable enough warnings
# themselves, and they use -Werror. Appending -Wall defeats the cases where
# the makefiles disable some specific warnings for specific code.
RPM_OPT_FLAGS=${RPM_OPT_FLAGS/-Wall/}
RPM_OPT_FLAGS=${RPM_OPT_FLAGS/-Wunused/}
%reconfigure CFLAGS="%{optflags} -fexceptions" --disable-nls
make
%install
make -s install DESTDIR=%{buildroot}
chmod +x %{buildroot}%{_libdir}/lib*.so*
chmod +x %{buildroot}%{_libdir}/elfutils/lib*.so*
# XXX Nuke unpackaged files
(cd %{buildroot}
rm -f .%{_bindir}/eu-ld
)
%check
#make -s check
%clean
rm -rf %{buildroot}
%post libs -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig
%post libelf -p /sbin/ldconfig
%postun libelf -p /sbin/ldconfig
%files
%defattr(-,root,root)
%doc README COPYING
%{_bindir}/eu-addr2line
%{_bindir}/eu-ar
%{_bindir}/eu-elfcmp
%{_bindir}/eu-elflint
%{_bindir}/eu-findtextrel
%{_bindir}/eu-nm
%{_bindir}/eu-objdump
%{_bindir}/eu-ranlib
%{_bindir}/eu-readelf
%{_bindir}/eu-size
%{_bindir}/eu-strings
%{_bindir}/eu-strip
#%{_bindir}/eu-ld
%{_bindir}/eu-unstrip
%{_bindir}/eu-make-debug-archive
%files libs
%defattr(-,root,root)
%{_libdir}/libasm-%{version}.so
%{_libdir}/libasm.so.*
%{_libdir}/libdw-%{version}.so
%{_libdir}/libdw.so.*
%dir %{_libdir}/elfutils
%{_libdir}/elfutils/lib*.so
%files devel
%defattr(-,root,root)
%{_includedir}/dwarf.h
%dir %{_includedir}/elfutils
%{_includedir}/elfutils/elf-knowledge.h
%{_includedir}/elfutils/libasm.h
%{_includedir}/elfutils/libebl.h
%{_includedir}/elfutils/libdw.h
%{_includedir}/elfutils/libdwfl.h
%{_includedir}/elfutils/version.h
%{_libdir}/libebl.a
%{_libdir}/libasm.so
%{_libdir}/libdw.so
%files devel-static
%defattr(-,root,root)
%{_libdir}/libasm.a
%{_libdir}/libdw.a
%files libelf
%defattr(-,root,root)
%{_libdir}/libelf-%{version}.so
%{_libdir}/libelf.so.*
%files libelf-devel
%defattr(-,root,root)
%{_includedir}/libelf.h
%{_includedir}/gelf.h
%{_includedir}/nlist.h
%{_libdir}/libelf.so
%files libelf-devel-static
%defattr(-,root,root)
%{_libdir}/libelf.a
|