source: rtems/contrib/crossrpms/rtems4.10/arm/rtems-4.10-arm-rtems4.10-binutils.spec @ 183e5cf

4.104.114.9
Last change on this file since 183e5cf was 183e5cf, checked in by Ralf Corsepius <ralf.corsepius@…>, on Aug 28, 2008 at 2:13:55 PM

Regenerate.

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