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