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

4.104.114.84.95
Last change on this file since 3675f57 was c48c3590, checked in by Ralf Corsepius <ralf.corsepius@…>, on Aug 7, 2007 at 3:41:57 PM

BINUTILS_RPMREL = 2

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