source: rtems/contrib/crossrpms/rtems4.9/arm/rtems-4.9-arm-rtems4.9-binutils.spec @ a7a8491d

4.9
Last change on this file since a7a8491d was a7a8491d, checked in by Ralf Corsepius <ralf.corsepius@…>, on Jan 21, 2009 at 12:19:03 PM

Bump BINUTILS_RPMREL.

  • Property mode set to 100644
File size: 8.3 KB
Line 
1#
2# Please send bugfixes or comments to
3#       http://www.rtems.org/bugzilla
4#
5
6%define _prefix                 /opt/rtems-4.9
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 rtems-4.9-%{_host}-
44%else
45%define _host_rpmprefix %{nil}
46%endif
47
48%define binutils_pkgvers 2.19
49%define binutils_version 2.19
50%define binutils_rpmvers %{expand:%(echo "2.19" | tr - _ )}
51
52Name:           rtems-4.9-arm-rtems4.9-binutils
53Summary:        Binutils for target arm-rtems4.9
54Group:          Development/Tools
55Version:        %{binutils_rpmvers}
56Release:        2%{?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.9-binutils-common
75
76Source0:        ftp://ftp.gnu.org/pub/gnu/binutils/binutils-%{binutils_pkgvers}.tar.bz2
77%{?_without_sources:NoSource:   0}
78%if "%{binutils_version}" == "2.18"
79Patch0:         ftp://ftp.rtems.org/pub/rtems/SOURCES/4.9/binutils-2.18-rtems4.9-20080211.diff
80%endif
81
82%description
83Cross binutils for target arm-rtems4.9
84%prep
85%setup -q -c -T -n %{name}-%{version}
86
87%setup -q -D -T -n %{name}-%{version} -a0
88cd binutils-%{binutils_pkgvers}
89%{?PATCH0:%patch0 -p1}
90cd ..
91
92%build
93  export PATH="%{_bindir}:${PATH}"
94%if "arm-rtems4.9" == "i686-pc-cygwin"
95# The cygwin sources are leaking memory
96  RPM_OPT_FLAGS="$(echo "$RPM_OPT_FLAGS"|sed -e 's; -Wp,-D_FORTIFY_SOURCE=2;;')"
97%endif
98  mkdir -p build
99  cd build
100%if "%{_build}" != "%{_host}"
101  CFLAGS_FOR_BUILD="-g -O2 -Wall" \
102%endif
103  CFLAGS="$RPM_OPT_FLAGS" \
104  ../binutils-%{binutils_pkgvers}/configure \
105    --build=%_build --host=%_host \
106    --target=arm-rtems4.9 \
107    --verbose --disable-nls \
108    --without-included-gettext \
109    --disable-win32-registry \
110    --disable-werror \
111    --prefix=%{_prefix} --bindir=%{_bindir} \
112    --exec-prefix=%{_exec_prefix} \
113    --includedir=%{_includedir} --libdir=%{_libdir} \
114    --mandir=%{_mandir} --infodir=%{_infodir}
115
116  make %{?_smp_mflags} all
117  make info
118  cd ..
119
120%install
121  export PATH="%{_bindir}:${PATH}"
122  rm -rf $RPM_BUILD_ROOT
123
124  cd build
125  make DESTDIR=$RPM_BUILD_ROOT install
126
127  make prefix=$RPM_BUILD_ROOT%{_prefix} \
128    bindir=$RPM_BUILD_ROOT%{_bindir} \
129    includedir=$RPM_BUILD_ROOT%{_includedir} \
130    libdir=$RPM_BUILD_ROOT%{_libdir} \
131    infodir=$RPM_BUILD_ROOT%{_infodir} \
132    mandir=$RPM_BUILD_ROOT%{_mandir} \
133    exec_prefix=$RPM_BUILD_ROOT%{_exec_prefix} \
134    install-info
135
136# Dropped in FSF-binutils-2.9.5, but Cygwin still ships it.
137  rm -rf $RPM_BUILD_ROOT%{_infodir}/configure.info*
138
139  rm -f $RPM_BUILD_ROOT%{_infodir}/dir
140  touch $RPM_BUILD_ROOT%{_infodir}/dir
141
142# binutils does not install share/locale, however it uses it
143  mkdir -p $RPM_BUILD_ROOT%{_prefix}/share/locale
144
145# We don't ship host files
146  rm -f ${RPM_BUILD_ROOT}%{_libdir}/libiberty*
147
148# manpages without corresponding tools
149  if test ! -f ${RPM_BUILD_ROOT}%{_bindir}/arm-rtems4.9-dlltool%{_exeext}; then
150    rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/arm-rtems4.9-dlltool*
151  fi
152  if test ! -f ${RPM_BUILD_ROOT}%{_bindir}/arm-rtems4.9-nlmconv%{_exeext}; then
153    rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/arm-rtems4.9-nlmconv*
154  fi
155  if test ! -f ${RPM_BUILD_ROOT}%{_bindir}/arm-rtems4.9-windres%{_exeext}; then
156    rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/arm-rtems4.9-windres*
157  fi
158  if test ! -f ${RPM_BUILD_ROOT}%{_bindir}/arm-rtems4.9-windmc%{_exeext}; then
159    rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/arm-rtems4.9-windmc*
160  fi
161
162  cd ..
163
164# Extract %%__os_install_post into os_install_post~
165cat << \EOF > os_install_post~
166%__os_install_post
167EOF
168
169# Generate customized brp-*scripts
170cat os_install_post~ | while read a x y; do
171case $a in
172# Prevent brp-strip* from trying to handle foreign binaries
173*/brp-strip*)
174  b=$(basename $a)
175  sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b
176  chmod a+x $b
177  ;;
178# Fix up brp-compress to handle %%_prefix != /usr
179*/brp-compress*)
180  b=$(basename $a)
181  sed -e 's,\./usr/,.%{_prefix}/,g' < $a > $b
182  chmod a+x $b
183  ;;
184esac
185done
186
187sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \
188  -e 's,^[ ]*/usr/lib/rpm.*/brp-compress,./brp-compress,' \
189< os_install_post~ > os_install_post
190%define __os_install_post . ./os_install_post
191
192%clean
193  rm -rf $RPM_BUILD_ROOT
194
195# ==============================================================
196# arm-rtems4.9-binutils
197# ==============================================================
198# %package -n rtems-4.9-arm-rtems4.9-binutils
199# Summary:      rtems binutils for arm-rtems4.9
200# Group: Development/Tools
201# %if %build_infos
202# Requires: rtems-4.9-binutils-common
203# %endif
204
205%description -n rtems-4.9-arm-rtems4.9-binutils
206GNU binutils targetting arm-rtems4.9.
207
208%files -n rtems-4.9-arm-rtems4.9-binutils
209%defattr(-,root,root)
210%dir %{_prefix}
211%dir %{_mandir}
212%dir %{_mandir}/man1
213%{_mandir}/man1/arm-rtems4.9-*.1*
214
215%dir %{_bindir}
216%{_bindir}/arm-rtems4.9-*
217
218%dir %{_exec_prefix}/arm-rtems4.9
219%dir %{_exec_prefix}/arm-rtems4.9/bin
220%{_exec_prefix}/arm-rtems4.9/bin/*
221
222%dir %{_exec_prefix}/arm-rtems4.9/lib
223%{_exec_prefix}/arm-rtems4.9/lib/ldscripts
224# ==============================================================
225# rtems-4.9-binutils-common
226# ==============================================================
227%package -n rtems-4.9-binutils-common
228Summary:      Base package for RTEMS binutils
229Group: Development/Tools
230Requires(post):         /sbin/install-info
231Requires(preun):        /sbin/install-info
232
233%description -n rtems-4.9-binutils-common
234
235RTEMS is an open source operating system for embedded systems.
236
237This is the base for binutils regardless of target CPU.
238
239%post -n rtems-4.9-binutils-common
240  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/as.info.gz || :
241  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/bfd.info.gz || :
242  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz || :
243  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/ld.info.gz || :
244  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/standards.info.gz || :
245%if "%{binutils_version}" > "2.17"
246  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz || :
247%endif
248
249%preun -n rtems-4.9-binutils-common
250if [ $1 -eq 0 ]; then
251  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/as.info.gz || :
252  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/bfd.info.gz || :
253  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz || :
254  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz || :
255  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/standards.info.gz || :
256%if "%{binutils_version}" > "2.17"
257  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz || :
258%endif
259fi
260
261%files -n rtems-4.9-binutils-common
262%defattr(-,root,root)
263%dir %{_prefix}
264%dir %{_infodir}
265%ghost %{_infodir}/dir
266%{_infodir}/as.info*
267%{_infodir}/bfd.info*
268%{_infodir}/binutils.info*
269%{_infodir}/ld.info*
270%{_infodir}/standards.info*
271%if "%{binutils_version}" > "2.17"
272%{_infodir}/gprof.info*
273%endif
274
275%dir %{_prefix}/share
276%dir %{_prefix}/share/locale
277
Note: See TracBrowser for help on using the repository browser.