source: rtems/contrib/crossrpms/rtems4.11/i386/rtems-4.11-i386-rtems4.11-binutils.spec @ bf862710

4.104.115
Last change on this file since bf862710 was bf862710, checked in by Ralf Corsepius <ralf.corsepius@…>, on Mar 17, 2010 at 5:07:25 AM

Fork preps.

  • Property mode set to 100644
File size: 8.1 KB
Line 
1#
2# Please send bugfixes or comments to
3#       http://www.rtems.org/bugzilla
4#
5
6%define _prefix                 /opt/rtems-4.11
7%define _exec_prefix            %{_prefix}
8%define _bindir                 %{_exec_prefix}/bin
9%define _sbindir                %{_exec_prefix}/sbin
10%define _libexecdir             %{_exec_prefix}/libexec
11%define _datarootdir            %{_prefix}/share
12%define _datadir                %{_datarootdir}
13%define _sysconfdir             %{_prefix}/etc
14%define _sharedstatedir         %{_prefix}/com
15%define _localstatedir          %{_prefix}/var
16%define _includedir             %{_prefix}/include
17%define _libdir                 %{_exec_prefix}/%{_lib}
18%define _mandir                 %{_datarootdir}/man
19%define _infodir                %{_datarootdir}/info
20%define _localedir              %{_datarootdir}/locale
21
22%ifos cygwin cygwin32 mingw mingw32
23%define _exeext .exe
24%define debug_package           %{nil}
25%define _libdir                 %{_exec_prefix}/lib
26%else
27%define _exeext %{nil}
28%endif
29
30%ifos cygwin cygwin32
31%define optflags -O3 -pipe -march=i486 -funroll-loops
32%endif
33
34%ifos mingw mingw32
35%if %{defined _mingw32_cflags}
36%define optflags %{_mingw32_cflags}
37%else
38%define optflags -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -mms-bitfields
39%endif
40%endif
41
42%if "%{_build}" != "%{_host}"
43%define _host_rpmprefix %{_host}-
44%else
45%define _host_rpmprefix %{nil}
46%endif
47
48%define binutils_pkgvers 2.20.1
49%define binutils_version 2.20.1
50%define binutils_rpmvers %{expand:%(echo "2.20.1" | tr - _ )}
51
52Name:           rtems-4.11-i386-rtems4.11-binutils
53Summary:        Binutils for target i386-rtems4.11
54Group:          Development/Tools
55Version:        %{binutils_rpmvers}
56Release:        1%{?dist}
57License:        GPL/LGPL
58URL:            http://sources.redhat.com/binutils
59BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
60
61BuildRequires:  %{_host_rpmprefix}gcc
62
63%if "%{binutils_version}" >= "2.18"
64# Bug in bfd: Doesn't build without texinfo installed
65BuildRequires:  texinfo >= 4.2
66%else
67# Required for building the infos
68BuildRequires:  /sbin/install-info
69BuildRequires:  texinfo >= 4.2
70%endif
71BuildRequires:  flex
72BuildRequires:  bison
73
74Requires:       rtems-4.11-binutils-common
75
76Source0: ftp://ftp.gnu.org/gnu/binutils/binutils-%{binutils_pkgvers}.tar.bz2
77Patch0:  ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/binutils-2.20.1-rtems4.10-20100310.diff
78
79%description
80Cross binutils for target i386-rtems4.11
81%prep
82%setup -q -c -T -n %{name}-%{version}
83
84%setup -q -D -T -n %{name}-%{version} -a0
85cd binutils-%{binutils_pkgvers}
86%{?PATCH0:%patch0 -p1}
87cd ..
88
89%build
90  export PATH="%{_bindir}:${PATH}"
91  mkdir -p build
92  cd build
93%if "%{_build}" != "%{_host}"
94  CFLAGS_FOR_BUILD="-g -O2 -Wall" \
95%endif
96  CFLAGS="$RPM_OPT_FLAGS" \
97  ../binutils-%{binutils_pkgvers}/configure \
98    --build=%_build --host=%_host \
99    --target=i386-rtems4.11 \
100    --verbose --disable-nls \
101    --without-included-gettext \
102    --disable-win32-registry \
103    --disable-werror \
104    --prefix=%{_prefix} --bindir=%{_bindir} \
105    --exec-prefix=%{_exec_prefix} \
106    --includedir=%{_includedir} --libdir=%{_libdir} \
107    --mandir=%{_mandir} --infodir=%{_infodir}
108
109  make %{?_smp_mflags} all
110  make info
111  cd ..
112
113%install
114  export PATH="%{_bindir}:${PATH}"
115  rm -rf $RPM_BUILD_ROOT
116
117  cd build
118  make DESTDIR=$RPM_BUILD_ROOT install
119
120  make prefix=$RPM_BUILD_ROOT%{_prefix} \
121    bindir=$RPM_BUILD_ROOT%{_bindir} \
122    includedir=$RPM_BUILD_ROOT%{_includedir} \
123    libdir=$RPM_BUILD_ROOT%{_libdir} \
124    infodir=$RPM_BUILD_ROOT%{_infodir} \
125    mandir=$RPM_BUILD_ROOT%{_mandir} \
126    exec_prefix=$RPM_BUILD_ROOT%{_exec_prefix} \
127    install-info
128
129# Dropped in FSF-binutils-2.9.5, but Cygwin still ships it.
130  rm -rf $RPM_BUILD_ROOT%{_infodir}/configure.info*
131
132  rm -f $RPM_BUILD_ROOT%{_infodir}/dir
133  touch $RPM_BUILD_ROOT%{_infodir}/dir
134
135# binutils does not install share/locale, however it uses it
136  mkdir -p $RPM_BUILD_ROOT%{_prefix}/share/locale
137
138# We don't ship host files
139  rm -f ${RPM_BUILD_ROOT}%{_libdir}/libiberty*
140
141# manpages without corresponding tools
142  if test ! -f ${RPM_BUILD_ROOT}%{_bindir}/i386-rtems4.11-dlltool%{_exeext}; then
143    rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/i386-rtems4.11-dlltool*
144  fi
145  if test ! -f ${RPM_BUILD_ROOT}%{_bindir}/i386-rtems4.11-nlmconv%{_exeext}; then
146    rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/i386-rtems4.11-nlmconv*
147  fi
148  if test ! -f ${RPM_BUILD_ROOT}%{_bindir}/i386-rtems4.11-windres%{_exeext}; then
149    rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/i386-rtems4.11-windres*
150  fi
151  if test ! -f ${RPM_BUILD_ROOT}%{_bindir}/i386-rtems4.11-windmc%{_exeext}; then
152    rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/i386-rtems4.11-windmc*
153  fi
154
155  cd ..
156
157# Extract %%__os_install_post into os_install_post~
158cat << \EOF > os_install_post~
159%__os_install_post
160EOF
161
162# Generate customized brp-*scripts
163cat os_install_post~ | while read a x y; do
164case $a in
165# Prevent brp-strip* from trying to handle foreign binaries
166*/brp-strip*)
167  b=$(basename $a)
168  sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b
169  chmod a+x $b
170  ;;
171# Fix up brp-compress to handle %%_prefix != /usr
172*/brp-compress*)
173  b=$(basename $a)
174  sed -e 's,\./usr/,.%{_prefix}/,g' < $a > $b
175  chmod a+x $b
176  ;;
177esac
178done
179
180sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \
181  -e 's,^[ ]*/usr/lib/rpm.*/brp-compress,./brp-compress,' \
182< os_install_post~ > os_install_post
183%define __os_install_post . ./os_install_post
184
185%clean
186  rm -rf $RPM_BUILD_ROOT
187
188# ==============================================================
189# i386-rtems4.11-binutils
190# ==============================================================
191# %package -n rtems-4.11-i386-rtems4.11-binutils
192# Summary:      rtems binutils for i386-rtems4.11
193# Group: Development/Tools
194# %if %build_infos
195# Requires: rtems-4.11-binutils-common
196# %endif
197
198%description -n rtems-4.11-i386-rtems4.11-binutils
199GNU binutils targetting i386-rtems4.11.
200
201%files -n rtems-4.11-i386-rtems4.11-binutils
202%defattr(-,root,root)
203%dir %{_prefix}
204%dir %{_datarootdir}
205
206%dir %{_mandir}
207%dir %{_mandir}/man1
208%{_mandir}/man1/i386-rtems4.11-*.1*
209
210%dir %{_bindir}
211%{_bindir}/i386-rtems4.11-*
212
213%dir %{_exec_prefix}/i386-rtems4.11
214%dir %{_exec_prefix}/i386-rtems4.11/bin
215%{_exec_prefix}/i386-rtems4.11/bin/*
216
217%dir %{_exec_prefix}/i386-rtems4.11/lib
218%{_exec_prefix}/i386-rtems4.11/lib/ldscripts
219# ==============================================================
220# rtems-4.11-binutils-common
221# ==============================================================
222%package -n rtems-4.11-binutils-common
223Summary:      Base package for RTEMS binutils
224Group: Development/Tools
225%{?_with_noarch_subpackages:BuildArch: noarch}
226
227Requires(post):         /sbin/install-info
228Requires(preun):        /sbin/install-info
229
230%description -n rtems-4.11-binutils-common
231
232RTEMS is an open source operating system for embedded systems.
233
234This is the base for binutils regardless of target CPU.
235
236%post -n rtems-4.11-binutils-common
237  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/as.info.gz || :
238  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/bfd.info.gz || :
239  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz || :
240  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/ld.info.gz || :
241  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/standards.info.gz || :
242  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz || :
243
244%preun -n rtems-4.11-binutils-common
245if [ $1 -eq 0 ]; then
246  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/as.info.gz || :
247  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/bfd.info.gz || :
248  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz || :
249  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz || :
250  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/standards.info.gz || :
251  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz || :
252fi
253
254%files -n rtems-4.11-binutils-common
255%defattr(-,root,root)
256%dir %{_prefix}
257%dir %{_infodir}
258%ghost %{_infodir}/dir
259%{_infodir}/as.info*
260%{_infodir}/bfd.info*
261%{_infodir}/binutils.info*
262%{_infodir}/ld.info*
263%{_infodir}/standards.info*
264%{_infodir}/gprof.info*
265
266%dir %{_prefix}/share
267%dir %{_prefix}/share/locale
268
Note: See TracBrowser for help on using the repository browser.