source: rtems/contrib/crossrpms/rtems4.9/powerpc/rtems-4.9-powerpc-rtems4.9-binutils.spec @ 430c0f6d

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