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