]> git.pld-linux.org Git - packages/binutils.git/blob - binutils.spec
depend only on debuginfod libs
[packages/binutils.git] / binutils.spec
1 # TODO: PR/26302 <https://sourceware.org/bugzilla/show_bug.cgi?id=26302> (breaks kernel-tools build)
2 #
3 # Conditional build:
4 %bcond_with     allarchs        # enable all targets
5 # define addtargets x,y,z       # build with additional targets x,y,z (e.g. x86_64-linux)
6                                 # http://sourceware.org/ml/binutils/2008-03/msg00162.html
7 %bcond_with     pax             # without PaX flags (for upstream bugreports)
8 %bcond_without  gold            # don't build gold (no C++ dependencies)
9 %bcond_without  default_bfd     # default ld.bfd instead of gold
10 %bcond_without  debuginfod      # debuginfo lokups with debuginfod
11 %bcond_with     gasp            # gasp
12 %bcond_without  gprofng         # gprofng
13 %bcond_without  jansson         # Package Metadata embedding support
14 %bcond_without  msgpack         # msgpack support
15 %bcond_with     tests           # check target
16
17 %ifnarch %{ix86} %{x8664} x32 aarch64 %{arm}
18 %undefine       with_gold
19 %endif
20 %ifarch %{arm}
21 %undefine       with_gasp
22 %endif
23 %ifnarch %{ix86} %{x8664} aarch64
24 %undefine       with_gprofng    1
25 %endif
26
27 Summary:        GNU Binary Utility Development Utilities
28 Summary(de.UTF-8):      GNU Binary Utility Development Utilities
29 Summary(es.UTF-8):      Utilitarios para desarrollo de binarios de la GNU
30 Summary(fr.UTF-8):      Utilitaires de développement binaire de GNU
31 Summary(pl.UTF-8):      Narzędzia GNU dla programistów
32 Summary(pt_BR.UTF-8):   Utilitários para desenvolvimento de binários da GNU
33 Summary(ru.UTF-8):      Набор инструментов GNU для построения исполняемых программ
34 Summary(tr.UTF-8):      GNU geliştirme araçları
35 Summary(uk.UTF-8):      Набір інструментів GNU для побудови виконуваних програм
36 Name:           binutils
37 Version:        2.39
38 Release:        1
39 Epoch:          4
40 License:        GPL v3+
41 Group:          Development/Tools
42 Source0:        https://ftp.gnu.org/gnu/binutils/%{name}-%{version}.tar.lz
43 # Source0-md5:  061a1460a09cc71e51886c008be55d44
44 Source1:        http://www.mif.pg.gda.pl/homepages/ankry/man-PLD/%{name}-non-english-man-pages.tar.bz2
45 # Source1-md5:  a717d9707ec77d82acb6ec9078c472d6
46 Patch0:         %{name}-gasp.patch
47 Patch1:         %{name}-info.patch
48 Patch2:         %{name}-libtool-relink.patch
49 Patch3:         %{name}-pt_pax_flags.patch
50
51 Patch6:         %{name}-absolute-gnu_debuglink-path.patch
52 Patch7:         %{name}-libtool-m.patch
53 Patch9:         %{name}-tooldir.patch
54 Patch10:        %{name}-sanity-check.patch
55 URL:            http://www.sourceware.org/binutils/
56 BuildRequires:  autoconf >= 2.69
57 BuildRequires:  automake >= 1:1.11
58 BuildRequires:  bison
59 %{?with_debuginfod:BuildRequires:       elfutils-debuginfod-devel >= 0.179}
60 BuildRequires:  flex
61 BuildRequires:  gettext-tools
62 %{?with_jansson:BuildRequires:  jansson-devel}
63 %{?with_gold:BuildRequires:     libstdc++-devel >= 6:4.0-1}
64 %{?with_tests:BuildRequires:    libstdc++-static >= 6:4.0}
65 BuildRequires:  lzip
66 %{?with_msgpack:BuildRequires:  msgpack-devel}
67 BuildRequires:  perl-tools-pod
68 BuildRequires:  pkgconfig
69 BuildRequires:  rpmbuild(macros) >= 1.527
70 %ifarch sparc sparc32
71 BuildRequires:  sparc32
72 %endif
73 BuildRequires:  tar >= 1:1.22
74 BuildRequires:  texinfo >= 4.2
75 BuildRequires:  zlib-devel
76 %{?with_tests:BuildRequires:    zlib-static}
77 %{?with_debuginfod:Requires:    elfutils-debuginfod-libs >= 0.179}
78 Conflicts:      gcc-c++ < 5:3.3
79 Conflicts:      modutils < 2.4.17
80 Conflicts:      rpmbuild(macros) < 1.660
81 Obsoletes:      binutils-gold
82 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
83
84 %description
85 Binutils is a collection of binary utilities, including:
86 - ar - create, modify and extract from archives,
87 - nm - lists symbols from object files,
88 - objcopy - copy and translate object files,
89 - objdump - display information from object files,
90 - ranlib - generate an index for the contents of an archive,
91 - size - list the section sizes of an object or archive file,
92 - strings - list printable strings from files,
93 - strip - discard symbols,
94 - addr2line - convert addresses to file and line.
95
96 %description -l es.UTF-8
97 Binutils es una colección de utilitarios necesarios para compilar
98 programas. Incluye assembler y linker, así como varios otros programas
99 para trabajar con formatos que se puedan ejecutar.
100
101 %description -l pl.UTF-8
102 Pakiet binutils zawiera zestaw narzędzi umożliwiających kompilację
103 programów. Znajdują się tutaj między innymi assembler, konsolidator
104 (linker), a także inne narzędzia do manipulowania binarnymi plikami
105 programów i bibliotek.
106
107 %description -l pt_BR.UTF-8
108 binutils é uma coletânea de utilitários necessários para compilar
109 programas. Inclui assembler e linker, assim como vários outros
110 programas para trabalhar com formatos executáveis.
111
112 %description -l ru.UTF-8
113 binutils - это набор инструментов, необходимых для компилляции
114 программ. Включает ассемблер, компоновщик и набор других программ для
115 работы с исполняемыми файлами разнообразных форматов.
116
117 %description -l uk.UTF-8
118 binutils - це набір інструментів, необхідних для компіляції програм.
119 Містить асемблер, компоновщик та інші програми, необхідні для роботи з
120 виконуваними файлами різних форматів.
121
122 %package libs
123 Summary:        GNU binutils shared libraries
124 Summary(pl.UTF-8):      Biblioteki współdzielone GNU binutils
125 Group:          Libraries
126 Conflicts:      binutils < 3:2.17.50.0.8-3
127
128 %description libs
129 GNU binutils shared libraries (libbfd, libopcodes).
130
131 %description libs -l pl.UTF-8
132 Biblioteki współdzielone GNU binutils (libbfd, libopcodes).
133
134 %package devel
135 Summary:        Development files for GNU binutils libraries
136 Summary(pl.UTF-8):      Pliki programistyczne bibliotek GNU binutils
137 Group:          Development/Libraries
138 Requires:       %{name}-libs = %{epoch}:%{version}-%{release}
139
140 %description devel
141 Development files for GNU binutils libraries (libbfd, libopcodes) and
142 static libiberty library.
143
144 %description devel -l pl.UTF-8
145 Pliki programistyczne bibliotek GNU binutils (libbfd, libopcodes) oraz
146 statyczna biblioteka libiberty.
147
148 %package static
149 Summary:        GNU binutils static libraries
150 Summary(pl.UTF-8):      Biblioteki statyczne do GNU binutils
151 Group:          Development/Libraries
152 Requires:       %{name}-devel = %{epoch}:%{version}-%{release}
153 #Requires:      zlib-static
154
155 %description static
156 Static GNU binutils libraries (libbfd, libopcodes).
157
158 %description static -l pl.UTF-8
159 Biblioteki statyczne GNU binutils (libbfd, libopcodes).
160
161 %package gasp
162 Summary:        GASP - old preprocessor for assembly programs
163 Summary(pl.UTF-8):      GASP - stary preprocesor dla programów w asemblerze
164 Group:          Development/Tools
165 Requires:       %{name} = %{epoch}:%{version}-%{release}
166
167 %description gasp
168 GASP - old preprocessor for assembly programs. It's officially
169 obsoleted, but it's still needed to build some packages.
170
171 %description gasp -l pl.UTF-8
172 GASP - stary preprocesor dla programów w asemblerze. Jest oficjalnie
173 uznany za przestarzały, ale jest nadal potrzebny do zbudowania
174 niektórych pakietów.
175
176 %prep
177 %setup -q
178 %{?with_gasp:%patch0 -p1}
179 %patch1 -p1
180 %patch2 -p1
181 %{?with_pax:%patch3 -p1}
182
183 %patch6 -p1
184 %patch7 -p1
185 %patch9 -p1
186 %patch10 -p1
187
188 %{__sed} -i -e '1s,.*env perl,#!%{__perl},' gprofng/gp-display-html/gp-display-html.in
189
190 # file contains hacks for ac 2.69 only
191 %{__rm} config/override.m4
192
193 %build
194 %{__aclocal}
195 %{__autoconf}
196
197 # non-standard regeneration (needed because of gasp patch)
198 # AM_BINUTILS_WARNINGS in bfd/warning.m4, ZW_GNU_GETTEXT_SISTER_DIR in config/gettext-sister.m4
199 for dir in gas bfd; do
200         cd $dir || exit 1
201         %{__aclocal} -I .. -I ../config -I ../bfd
202         %{__automake} Makefile
203         test -f doc/Makefile.am && %{__automake} doc/Makefile
204         %{__autoconf}
205         cd ..
206 done
207
208 # More targets
209 TARGETS=
210 %ifarch ia64
211 TARGETS=i686-linux
212 %endif
213 # uhm?
214 %ifarch %{ix86}
215 TARGETS=x86_64-linux
216 %endif
217 %ifarch sparc
218 TARGETS=sparc64-linux
219 %endif
220 %ifarch %{x8664}
221 TARGETS="x86_64-pep"
222 %endif
223 %ifarch x32
224 TARGETS="x86_64-linux,x86_64-pep"
225 %endif
226 %{?addtargets:TARGETS="%{addtargets}"}
227
228 cp -f /usr/share/automake/config.* .
229 CFLAGS="%{rpmcflags}"; export CFLAGS
230 CXXFLAGS="%{rpmcxxflags}"; export CXXFLAGS
231 CC="%{__cc}"; export CC
232 CXX="%{__cxx}"; export CXX
233 %ifarch sparc
234 sparc32 \
235 %endif
236 ./configure %{_target_platform} \
237         --prefix=%{_prefix} \
238         --libdir=%{_libdir} \
239         --infodir=%{_infodir} \
240         --mandir=%{_mandir} \
241         --sysconfdir=%{_sysconfdir} \
242         --disable-debug \
243         --disable-silent-rules \
244         --disable-werror \
245 %ifarch sparc
246         --enable-64-bit-bfd \
247 %else
248         %{?with_allarchs:--enable-64-bit-bfd} \
249 %endif
250         --enable-build-warnings=,-Wno-missing-prototypes \
251         --enable-install-libiberty \
252         --enable-lto \
253         --enable-plugins \
254         --enable-shared \
255         %{?with_allarchs:--enable-targets=alpha-linux,arm-linux,cris-linux,hppa-linux,i386-linux,ia64-linux,x86_64-linux,x86_64-linux-gnux32,m68k-linux,mips-linux,mips64-linux,mips64el-linux,mipsel-linux,ppc-linux,s390-linux,s390x-linux,sh-linux,sparc-linux,sparc64-linux,i386-linuxaout,x86_64-pep} \
256         %{!?with_allarchs:`[ -n "${TARGETS}" ] && echo "--enable-targets=${TARGETS}"`} \
257         --with-tooldir=%{_prefix} \
258         --with-zlib \
259 %if %{with gold}
260         --enable-gold%{!?with_default_bfd:=default} --enable-ld%{?with_default_bfd:=default} \
261 %endif
262         %{__enable_disable msgpack} \
263         %{__enable_disable jansson} \
264         %{__with_without debuginfod}
265
266 %{__make}
267
268 %{?with_tests:%{__make} -j1 check}
269
270 %install
271 rm -rf $RPM_BUILD_ROOT
272 install -d $RPM_BUILD_ROOT%{_libdir}/bfd-plugins
273
274 %{__make} -j1 install \
275         DESTDIR=$RPM_BUILD_ROOT
276
277 # remove these man pages unless we cross-build for win*/netware platforms.
278 # however, this should be done in Makefiles.
279 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/{dlltool,windmc,windres}.1
280
281 bzip2 -dc %{SOURCE1} | tar xf - -C $RPM_BUILD_ROOT%{_mandir}
282
283 # overwrite libiberty.a with PIC version
284 cp -pf libiberty/pic/libiberty.a $RPM_BUILD_ROOT%{_libdir}
285
286 # remove evil -L pointing inside builder's home
287 perl -pi -e 's@-L[^ ]*/pic @@g' $RPM_BUILD_ROOT%{_libdir}/libbfd.la
288
289 [ -x $RPM_BUILD_ROOT%{_bindir}/ld.bfd ] || ln $RPM_BUILD_ROOT%{_bindir}/ld{,.bfd}
290
291 rm -f $RPM_BUILD_ROOT%{_infodir}/dir
292
293 %if %{with gold}
294 install -d gold-doc
295 cp -p gold/{README,ChangeLog,TODO} gold-doc
296 %endif
297
298 %find_lang bfd
299 %find_lang binutils
300 %find_lang gas
301 %find_lang gprof
302 touch ld.lang gold.lang
303 %find_lang ld
304 %if %{with gold}
305 %find_lang gold
306 %endif
307 %find_lang opcodes
308 cat bfd.lang opcodes.lang > %{name}-libs.lang
309 cat gas.lang gprof.lang ld.lang gold.lang >> %{name}.lang
310
311 %clean
312 rm -rf $RPM_BUILD_ROOT
313
314 %post   -p /sbin/postshell
315 -/usr/sbin/fix-info-dir -c %{_infodir}
316
317 %postun -p /sbin/postshell
318 -/usr/sbin/fix-info-dir -c %{_infodir}
319
320 %post   libs -p /sbin/ldconfig
321 %postun libs -p /sbin/ldconfig
322
323 %post   devel -p /sbin/postshell
324 -/usr/sbin/fix-info-dir -c %{_infodir}
325
326 %postun devel -p /sbin/postshell
327 -/usr/sbin/fix-info-dir -c %{_infodir}
328
329 %post   gasp -p /sbin/postshell
330 -/usr/sbin/fix-info-dir -c %{_infodir}
331
332 %postun gasp -p /sbin/postshell
333 -/usr/sbin/fix-info-dir -c %{_infodir}
334
335 %files -f %{name}.lang
336 %defattr(644,root,root,755)
337 %doc README
338 %{?with_gold:%doc gold-doc}
339 %{?with_gprofng:%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/gprofng.rc}
340 %attr(755,root,root) %{_bindir}/addr2line
341 %attr(755,root,root) %{_bindir}/ar
342 %attr(755,root,root) %{_bindir}/as
343 %attr(755,root,root) %{_bindir}/c++filt
344 %attr(755,root,root) %{_bindir}/elfedit
345 %if %{with gprofng}
346 %attr(755,root,root) %{_bindir}/gp-archive
347 %attr(755,root,root) %{_bindir}/gp-collect-app
348 %attr(755,root,root) %{_bindir}/gp-display-html
349 %attr(755,root,root) %{_bindir}/gp-display-src
350 %attr(755,root,root) %{_bindir}/gp-display-text
351 %attr(755,root,root) %{_bindir}/gprofng
352 %endif
353 %attr(755,root,root) %{_bindir}/gprof
354 %attr(755,root,root) %{_bindir}/ld
355 %attr(755,root,root) %{_bindir}/ld.bfd
356 %if %{with gold}
357 %attr(755,root,root) %{_bindir}/ld.gold
358 %attr(755,root,root) %{_bindir}/dwp
359 %endif
360 %attr(755,root,root) %{_bindir}/nm
361 %attr(755,root,root) %{_bindir}/objcopy
362 %attr(755,root,root) %{_bindir}/objdump
363 %attr(755,root,root) %{_bindir}/ranlib
364 %attr(755,root,root) %{_bindir}/readelf
365 %attr(755,root,root) %{_bindir}/size
366 %attr(755,root,root) %{_bindir}/strings
367 %attr(755,root,root) %{_bindir}/strip
368 %if %{with gprofng}
369 %dir %{_libdir}/gprofng
370 %attr(755,root,root) %{_libdir}/gprofng/libgp-collector.so
371 %attr(755,root,root) %{_libdir}/gprofng/libgp-collectorAPI.so
372 %attr(755,root,root) %{_libdir}/gprofng/libgp-heap.so
373 %attr(755,root,root) %{_libdir}/gprofng/libgp-iotrace.so
374 %attr(755,root,root) %{_libdir}/gprofng/libgp-sync.so
375 %attr(755,root,root) %{_libdir}/gprofng/libgprofng.so.*.*.*
376 %attr(755,root,root) %{_libdir}/gprofng/libgprofng.so.0
377 %endif
378 %{_prefix}/lib/ldscripts
379 %{_infodir}/as.info*
380 %{_infodir}/binutils.info*
381 %{_infodir}/ctf-spec.info*
382 %{_infodir}/gprof.info*
383 %{?with_gprofng:%{_infodir}/gprofng.info*}
384 %{_infodir}/ld.info*
385 %{_mandir}/man1/addr2line.1*
386 %{_mandir}/man1/ar.1*
387 %{_mandir}/man1/as.1*
388 %{_mandir}/man1/c++filt.1*
389 %{_mandir}/man1/elfedit.1*
390 %if %{with gprofng}
391 %{_mandir}/man1/gp-archive.*
392 %{_mandir}/man1/gp-collect-app.*
393 %{_mandir}/man1/gp-display-html.*
394 %{_mandir}/man1/gp-display-src.*
395 %{_mandir}/man1/gp-display-text.*
396 %{_mandir}/man1/gprofng.1*
397 %endif
398 %{_mandir}/man1/gprof.1*
399 %{_mandir}/man1/ld.1*
400 %{_mandir}/man1/nm.1*
401 %{_mandir}/man1/objcopy.1*
402 %{_mandir}/man1/objdump.1*
403 %{_mandir}/man1/ranlib.1*
404 %{_mandir}/man1/readelf.1*
405 %{_mandir}/man1/size.1*
406 %{_mandir}/man1/strings.1*
407 %{_mandir}/man1/strip.1*
408 %lang(cs) %{_mandir}/cs/man1/*
409 %lang(de) %{_mandir}/de/man1/*
410 %lang(es) %{_mandir}/es/man1/*
411 %lang(fi) %{_mandir}/fi/man1/*
412 %lang(fr) %{_mandir}/fr/man1/*
413 %lang(hu) %{_mandir}/hu/man1/*
414 %lang(ja) %{_mandir}/ja/man1/*
415 %lang(pl) %{_mandir}/pl/man1/*
416
417 %files libs -f %{name}-libs.lang
418 %defattr(644,root,root,755)
419 %attr(755,root,root) %{_libdir}/libbfd-%{version}.so
420 %attr(755,root,root) %{_libdir}/libctf.so.*.*
421 %attr(755,root,root) %ghost %{_libdir}/libctf.so.0
422 %attr(755,root,root) %{_libdir}/libctf-nobfd.so.*.*
423 %attr(755,root,root) %ghost %{_libdir}/libctf-nobfd.so.0
424 %attr(755,root,root) %{_libdir}/libopcodes-%{version}.so
425 %dir %{_libdir}/bfd-plugins
426 %attr(755,root,root) %{_libdir}/bfd-plugins/libdep.so
427
428 %files devel
429 %defattr(644,root,root,755)
430 %attr(755,root,root) %{_libdir}/libbfd.so
431 %attr(755,root,root) %{_libdir}/libctf.so
432 %attr(755,root,root) %{_libdir}/libctf-nobfd.so
433 %attr(755,root,root) %{_libdir}/libopcodes.so
434 %{?with_gprofng:%attr(755,root,root) %{_libdir}/gprofng/libgprofng.so}
435 %{_libdir}/libbfd.la
436 %{_libdir}/libctf.la
437 %{_libdir}/libctf-nobfd.la
438 %{_libdir}/libopcodes.la
439 %{_libdir}/libiberty.a
440 %{_includedir}/ansidecl.h
441 %{_includedir}/bfd.h
442 %{_includedir}/bfdlink.h
443 %{_includedir}/ctf-api.h
444 %{_includedir}/ctf.h
445 %{_includedir}/diagnostics.h
446 %{_includedir}/dis-asm.h
447 %{_includedir}/plugin-api.h
448 %{_includedir}/symcat.h
449 %{_includedir}/libiberty
450 %if %{with gprofng}
451 %{_includedir}/collectorAPI.h
452 %{_includedir}/libcollector.h
453 %{_includedir}/libfcollector.h
454 %endif
455 %{_infodir}/bfd.info*
456
457 %files static
458 %defattr(644,root,root,755)
459 %{_libdir}/libbfd.a
460 %{_libdir}/libctf.a
461 %{_libdir}/libctf-nobfd.a
462 %{_libdir}/libopcodes.a
463
464 %if %{with gasp}
465 %files gasp
466 %defattr(644,root,root,755)
467 %attr(755,root,root) %{_bindir}/gasp
468 %{_infodir}/gasp.info*
469 %endif
This page took 0.068534 seconds and 4 git commands to generate.