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