source: rtems/contrib/crossrpms/rtems4.10/avr/rtems-4.10-avr-rtems4.10-binutils.spec @ a0b9cc0c

4.104.11
Last change on this file since a0b9cc0c was 6ef6f88, checked in by Ralf Corsepius <ralf.corsepius@…>, on Aug 29, 2009 at 4:18:00 AM

Regenerate.

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