source: rtems/contrib/crossrpms/rtems4.8/m68k/rtems-4.8-m68k-rtems4.8-binutils.spec @ d475f9d

4.8
Last change on this file since d475f9d was d475f9d, checked in by Ralf Corsepius <ralf.corsepius@…>, on Dec 17, 2007 at 7:52:25 AM

Regenerate.

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