source: rtems/contrib/crossrpms/rtems4.10/powerpc/rtems-4.10-powerpc-rtems4.10-binutils.spec @ 3f6e3fa

4.104.114.9
Last change on this file since 3f6e3fa was 3f6e3fa, checked in by Ralf Corsepius <ralf.corsepius@…>, on Jul 3, 2008 at 3:30:57 PM

New.

  • 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-powerpc-rtems4.10-binutils
33Summary:        Binutils for target powerpc-rtems4.10
34Group:          Development/Tools
35Version:        %{binutils_rpmvers}
36Release:        1%{?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:         binutils-2.18-rtems4.9-20080211.diff
60%endif
61
62%description
63Cross binutils for target powerpc-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 "powerpc-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=powerpc-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}/powerpc-rtems4.10-dlltool%{_exeext}; then
130    rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/powerpc-rtems4.10-dlltool*
131  fi
132  if test ! -f ${RPM_BUILD_ROOT}%{_bindir}/powerpc-rtems4.10-nlmconv%{_exeext}; then
133    rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/powerpc-rtems4.10-nlmconv*
134  fi
135  if test ! -f ${RPM_BUILD_ROOT}%{_bindir}/powerpc-rtems4.10-windres%{_exeext}; then
136    rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/powerpc-rtems4.10-windres*
137  fi
138
139  cd ..
140
141# Extract %%__os_install_post into os_install_post~
142cat << \EOF > os_install_post~
143%__os_install_post
144EOF
145
146# Generate customized brp-*scripts
147cat os_install_post~ | while read a x y; do
148case $a in
149# Prevent brp-strip* from trying to handle foreign binaries
150*/brp-strip*)
151  b=$(basename $a)
152  sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b
153  chmod a+x $b
154  ;;
155# Fix up brp-compress to handle %%_prefix != /usr
156*/brp-compress*)
157  b=$(basename $a)
158  sed -e 's,\./usr/,.%{_prefix}/,g' < $a > $b
159  chmod a+x $b
160  ;;
161esac
162done
163
164sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \
165  -e 's,^[ ]*/usr/lib/rpm.*/brp-compress,./brp-compress,' \
166< os_install_post~ > os_install_post
167%define __os_install_post . ./os_install_post
168
169%clean
170  rm -rf $RPM_BUILD_ROOT
171
172# ==============================================================
173# powerpc-rtems4.10-binutils
174# ==============================================================
175# %package -n rtems-4.10-powerpc-rtems4.10-binutils
176# Summary:      rtems binutils for powerpc-rtems4.10
177# Group: Development/Tools
178# %if %build_infos
179# Requires: rtems-4.10-binutils-common
180# %endif
181
182%description -n rtems-4.10-powerpc-rtems4.10-binutils
183GNU binutils targetting powerpc-rtems4.10.
184
185%files -n rtems-4.10-powerpc-rtems4.10-binutils
186%defattr(-,root,root)
187%dir %{_mandir}
188%dir %{_mandir}/man1
189%{_mandir}/man1/powerpc-rtems4.10-*.1*
190
191%dir %{_bindir}
192%{_bindir}/powerpc-rtems4.10-*
193
194%dir %{_exec_prefix}/powerpc-rtems4.10
195%dir %{_exec_prefix}/powerpc-rtems4.10/bin
196%{_exec_prefix}/powerpc-rtems4.10/bin/*
197
198%dir %{_exec_prefix}/powerpc-rtems4.10/lib
199%{_exec_prefix}/powerpc-rtems4.10/lib/ldscripts
200# ==============================================================
201# rtems-4.10-binutils-common
202# ==============================================================
203%package -n rtems-4.10-binutils-common
204Summary:      Base package for RTEMS binutils
205Group: Development/Tools
206Requires(post):         /sbin/install-info
207Requires(preun):        /sbin/install-info
208
209%description -n rtems-4.10-binutils-common
210
211RTEMS is an open source operating system for embedded systems.
212
213This is the base for binutils regardless of target CPU.
214
215%post -n rtems-4.10-binutils-common
216  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/as.info.gz || :
217  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/bfd.info.gz || :
218  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz || :
219  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/ld.info.gz || :
220  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/standards.info.gz || :
221%if "%{binutils_version}" > "2.17"
222  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz || :
223%endif
224
225%preun -n rtems-4.10-binutils-common
226if [ $1 -eq 0 ]; then
227  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/as.info.gz || :
228  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/bfd.info.gz || :
229  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz || :
230  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz || :
231  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/standards.info.gz || :
232%if "%{binutils_version}" > "2.17"
233  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz || :
234%endif
235fi
236
237%files -n rtems-4.10-binutils-common
238%defattr(-,root,root)
239%dir %{_infodir}
240%ghost %{_infodir}/dir
241%{_infodir}/as.info*
242%{_infodir}/bfd.info*
243%{_infodir}/binutils.info*
244%{_infodir}/ld.info*
245%{_infodir}/standards.info*
246%if "%{binutils_version}" > "2.17"
247%{_infodir}/gprof.info*
248%endif
249
250%dir %{_prefix}/share
251%dir %{_prefix}/share/locale
252
Note: See TracBrowser for help on using the repository browser.