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

4.104.115
Last change on this file since b3bfca66 was b3bfca66, checked in by Ralf Corsepius <ralf.corsepius@…>, on 10/23/08 at 04:34:14

Regenerate.

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