~ubuntu-branches/ubuntu/hoary/binutils/hoary

« back to all changes in this revision

Viewing changes to binutils.spec

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2005-03-18 13:07:52 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20050318130752-j4i37zgqclj53b94
Tags: 2.15-5ubuntu2
debian/rules: Call pkgstriptranslations if present (the package does not
use debhelper, thus it does not happen automatically).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
%define cross_compile 0
2
 
%{?_with_crosscompile: %{expand: %%define cross_compile 1}}
3
 
%{!?_with_crosscompile: %{expand: %%define _host %{_target_platform}}}
4
 
%{!?_with_crosscompile: %{expand: %%define _build %{_target_platform}}}
5
 
 
6
 
# Define `coff_target' as coff if you want to add i386-coff instead of
7
 
# i386-pe.
8
 
%define coff_target pe
9
 
%{?_with_coff: %{expand: %%define coff_target coff}}
10
 
%define all_targets 0
11
 
%{?_with_all: %{expand: %%define all_targets 1}}
12
 
 
13
 
Summary: A GNU collection of binary utilities.
14
 
Name: binutils
15
 
Version: 2.14.90.0.7
16
 
Release: 1
17
 
Copyright: GPL
18
 
Group: Development/Tools
19
 
URL: http://sources.redhat.com/binutils
20
 
Source: http://www.kernel.org/pub/linux/devel/binutils/binutils-%{version}.tar.gz
21
 
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root
22
 
Prereq: /sbin/install-info
23
 
 
24
 
%description
25
 
Binutils is a collection of binary utilities, including ar (for creating,
26
 
modifying and extracting from archives), nm (for listing symbols from
27
 
object files), objcopy (for copying and translating object files),
28
 
objdump (for displaying information from object files), ranlib (for
29
 
generating an index for the contents of an archive), size (for listing
30
 
the section sizes of an object or archive file), strings (for listing
31
 
printable strings from files), strip (for discarding symbols), c++filt
32
 
(a filter for demangling encoded C++ symbols), and addr2line (for
33
 
converting addresses to file and line).
34
 
 
35
 
%prep
36
 
%setup -q
37
 
 
38
 
# Apply additional Linux patches.
39
 
/bin/sh patches/README
40
 
 
41
 
%build
42
 
if [ -x /usr/bin/getconf ] ; then
43
 
  NRPROC=$(/usr/bin/getconf _NPROCESSORS_ONLN)
44
 
   if [ $NRPROC -eq 0 ] ; then
45
 
    NRPROC=1
46
 
  fi
47
 
else
48
 
  NRPROC=1
49
 
fi
50
 
echo "MAKE=make -j $NRPROC" > makefile
51
 
echo "include Makefile" >> makefile
52
 
ADDITIONAL_TARGETS=""
53
 
%ifos linux
54
 
%if %{all_targets}
55
 
ADDITIONAL_TARGETS="--enable-targets=alpha-linux,arm-linux,cris-linux,hppa-linux,i386-linux,x86_64-linux,ia64-linux,m68k-linux,mips-linux,mips64-linux,mips64el-linux,mipsel-linux,ppc-linux,ppc64-linux,s390-linux,s390x-linux,sh-linux,sparc-linux,sparc64-linux,i386-linuxaout"
56
 
%else
57
 
%ifarch %{ix86}
58
 
ADDITIONAL_TARGETS="--enable-targets=i386-linuxaout,i386-%{coff_target}"
59
 
%endif
60
 
%ifarch ia64
61
 
ADDITIONAL_TARGETS="--enable-targets=i386-linux"
62
 
%endif
63
 
%ifarch sparc ppc s390
64
 
ADDITIONAL_TARGETS="--enable-64-bit-bfd"
65
 
%endif
66
 
%endif
67
 
%endif
68
 
 
69
 
# Binutils come with its own custom libtool
70
 
%define __libtoolize echo
71
 
AR=%{__ar}; export AR
72
 
CC=%{__cc}; export CC
73
 
LD=%{__ld}; export LD
74
 
NM=%{__nm}; export NM
75
 
RANLIB=%{__ranlib}; export RANLIB
76
 
%configure --enable-shared $ADDITIONAL_TARGETS
77
 
make configure-bfd
78
 
%if %{cross_compile}
79
 
make headers -C bfd CFLAGS=-O
80
 
make tooldir=%{_prefix} all info CFLAGS_FOR_BUILD="-O -pipe"
81
 
%else
82
 
make headers -C bfd
83
 
make tooldir=%{_prefix} all info
84
 
%endif
85
 
 
86
 
%install
87
 
rm -rf ${RPM_BUILD_ROOT}
88
 
mkdir -p ${RPM_BUILD_ROOT}%{_prefix}
89
 
# Works for both rpm 3.0 and 4.0.
90
 
make prefix=${RPM_BUILD_ROOT}%{_prefix} \
91
 
     exec_prefix=$RPM_BUILD_ROOT%{_prefix} \
92
 
     tooldir=$RPM_BUILD_ROOT%{_prefix} \
93
 
     infodir=${RPM_BUILD_ROOT}%{_infodir} \
94
 
     mandir=${RPM_BUILD_ROOT}%{_mandir} \
95
 
     includedir=$RPM_BUILD_ROOT%{_prefix}/include \
96
 
     libdir=$RPM_BUILD_ROOT%{_prefix}/lib \
97
 
     bindir=$RPM_BUILD_ROOT%{_prefix}/bin \
98
 
     install install-info
99
 
#%makeinstall tooldir=${RPM_BUILD_ROOT}%{_prefix}
100
 
#make prefix=${RPM_BUILD_ROOT}%{_prefix} infodir=${RPM_BUILD_ROOT}%{_infodir} install-info
101
 
strip ${RPM_BUILD_ROOT}%{_prefix}/bin/*
102
 
gzip -q9f ${RPM_BUILD_ROOT}%{_infodir}/*.info*
103
 
 
104
 
#install -m 644 libiberty/libiberty.a ${RPM_BUILD_ROOT}%{_prefix}/lib
105
 
install -m 644 include/libiberty.h ${RPM_BUILD_ROOT}%{_prefix}/include
106
 
 
107
 
chmod +x ${RPM_BUILD_ROOT}%{_prefix}/lib/lib*.so*
108
 
 
109
 
rm -f ${RPM_BUILD_ROOT}%{_prefix}/lib/lib{bfd,opcodes}.{la,so}
110
 
rm -f ${RPM_BUILD_ROOT}%{_infodir}/dir
111
 
rm -f %{buildroot}%{_mandir}/man1/{dlltool,nlmconv,windres}*
112
 
 
113
 
%clean
114
 
rm -rf ${RPM_BUILD_ROOT}
115
 
 
116
 
%post
117
 
/sbin/ldconfig
118
 
/sbin/install-info --info-dir=%{_infodir} %{_infodir}/as.info.gz
119
 
/sbin/install-info --info-dir=%{_infodir} %{_infodir}/bfd.info.gz
120
 
/sbin/install-info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz
121
 
/sbin/install-info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz
122
 
/sbin/install-info --info-dir=%{_infodir} %{_infodir}/ld.info.gz
123
 
/sbin/install-info --info-dir=%{_infodir} %{_infodir}/standards.info.gz
124
 
 
125
 
%preun
126
 
if [ $1 = 0 ] ;then
127
 
  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/as.info.gz
128
 
  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/bfd.info.gz
129
 
  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz
130
 
  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz
131
 
  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz
132
 
  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/standards.info.gz
133
 
fi
134
 
 
135
 
%postun -p /sbin/ldconfig
136
 
 
137
 
%files
138
 
%defattr(-,root,root)
139
 
%doc README
140
 
%{_prefix}/bin/*
141
 
%{_mandir}/man1/*
142
 
%{_prefix}/include/*
143
 
%{_prefix}/lib/ldscripts/*
144
 
%{_prefix}/lib/lib*
145
 
%{_infodir}/*info*
146
 
%{_datadir}/locale/*/LC_MESSAGES/*.mo