source: rtems/contrib/crossrpms/rtems4.8/sh/rtems-4.8-sh-rtems4.8-binutils.spec @ 8683760

4.8
Last change on this file since 8683760 was 8683760, checked in by Ralf Corsepius <ralf.corsepius@…>, on 09/03/08 at 09:30:34

Regenerate.

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