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