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