source: rtems/contrib/crossrpms/rtems4.9/sparc/rtems-4.9-sparc-rtems4.9-gdb.spec @ e067753

4.9
Last change on this file since e067753 was e067753, checked in by Ralf Corsepius <ralf.corsepius@…>, on Nov 11, 2009 at 3:16:46 PM

Regenerate.

  • Property mode set to 100644
File size: 7.9 KB
RevLine 
[2d9201a]1#
2# Please send bugfixes or comments to
3#       http://www.rtems.org/bugzilla
4#
5
[7ad3289]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
[2d9201a]21
22%ifos cygwin cygwin32 mingw mingw32
23%define _exeext .exe
[7ad3289]24%define debug_package           %{nil}
25%define _libdir                 %{_exec_prefix}/lib
[2d9201a]26%else
27%define _exeext %{nil}
28%endif
29
[1f129d87]30%ifos cygwin cygwin32
31%define optflags -O3 -pipe -march=i486 -funroll-loops
[7ad3289]32%endif
33
34%ifos mingw mingw32
35%if %{defined _mingw32_cflags}
36%define optflags %{_mingw32_cflags}
37%else
38%define optflags -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -mms-bitfields
39%endif
[1f129d87]40%endif
41
[ea7a607]42%if "%{_build}" != "%{_host}"
[a9c3667]43%define _host_rpmprefix %{_host}-
[ea7a607]44%else
45%define _host_rpmprefix %{nil}
46%endif
47
48%define gdb_version 6.8
49%define gdb_rpmvers %{expand:%(echo 6.8 | tr - _)}
[2d9201a]50
51Name:           rtems-4.9-sparc-rtems4.9-gdb
52Summary:        Gdb for target sparc-rtems4.9
53Group:          Development/Tools
54Version:        %{gdb_rpmvers}
[e067753]55Release:        11%{?dist}
[2d9201a]56License:        GPL/LGPL
57URL:            http://sources.redhat.com/gdb
58BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
59
[ea7a607]60BuildRequires:  %{_host_rpmprefix}gcc
[1f129d87]61
[a9c3667]62%define build_sim --enable-sim
63%if "%{_build}" != "%{_host}"
64# psim doesn't support Cdn-X
65%if "sparc-rtems4.9" == "powerpc-rtems4.9"
66%define build_sim --disable-sim
67%endif
68%endif
69
70%ifos mingw mingw32
71# Mingw lacks functions required by the simulator
72%if "sparc-rtems4.9" == "sparc-rtems4.9"
73%define build_sim --disable-sim
74%endif
75%if "sparc-rtems4.9" == "h8300-rtems4.9"
76%define build_sim --disable-sim
77%endif
78%if "%{gdb_version}" >= "6.8.50"
79%if "sparc-rtems4.9" == "m32c-rtems4.9"
80%define build_sim --disable-sim
81%endif
82%endif
83%if "sparc-rtems4.9" == "lm32-rtems4.9"
84%define build_sim --disable-sim
85%endif
86%if "sparc-rtems4.9" == "mipstx39-rtems4.9"
87%define build_sim --disable-sim
88%endif
89%endif
90
[2d9201a]91%if "%{gdb_version}" >= "6.6"
[25eda206]92# suse
93%if "%{?suse}" >= "10.3"
94BuildRequires: libexpat-devel
95%else
[a9c3667]96# Fedora/CentOS/Cygwin/MinGW
[ea7a607]97BuildRequires: %{_host_rpmprefix}expat-devel
98%endif
99%endif
100
[5633d25f]101%if "%{gdb_version}" < "6.7"
[ea7a607]102%if "%{_build}" != "%{_host}"
103BuildRequires:  %{_host_rpmprefix}termcap-devel
[2d9201a]104%endif
[48569c74]105%bcond_with system_readline
106%else
107%bcond_without system_readline
[2d9201a]108%endif
[48569c74]109%{?with_system_readline:BuildRequires: %{_host_rpmprefix}readline-devel}
[ea7a607]110BuildRequires:  %{_host_rpmprefix}ncurses-devel
111
[48569c74]112%if "%{gdb_version}" >= "6.8.50"
113%if "%{_build}" != "%{_host}"
114# Can't build python Cdn-X
115%bcond_with python
116%else
117%bcond_without python
118%endif
119%endif
120%{?with_python:BuildRequires: %{_host_rpmprefix}python-devel}
121
[df16b8bf]122# Required for building the infos
123BuildRequires:  /sbin/install-info
124BuildRequires:  texinfo >= 4.2
[ea7a607]125
[2d9201a]126
[df16b8bf]127Requires:       rtems-4.9-gdb-common
128
[2d9201a]129Source0:        ftp://ftp.gnu.org/pub/gnu/gdb/gdb-%{gdb_version}.tar.bz2
130%{?_without_sources:NoSource:   0}
[ea7a607]131%if "%{gdb_version}" == "6.8"
[e067753]132Patch0:         ftp://ftp.rtems.org/pub/rtems/SOURCES/4.9/gdb-6.8-rtems4.9-20091111.diff
[25eda206]133%endif
[2d9201a]134
135%description
136GDB for target sparc-rtems4.9
137%prep
138%setup -q -c -T -n %{name}-%{version}
139
140%setup -q -D -T -n %{name}-%{version} -a0
141cd gdb-%{gdb_version}
142%{?PATCH0:%patch0 -p1}
143cd ..
144
[ea7a607]145# Force using a system-provided libreadline
[48569c74]146%{?with_system_readline:rm -f gdb-%{gdb_version}/readline/configure}
[2d9201a]147%build
[1f129d87]148  export PATH="%{_bindir}:${PATH}"
[2d9201a]149  mkdir -p build
150  cd build
[ea7a607]151%if "%{_build}" != "%{_host}"
152  CFLAGS_FOR_BUILD="-g -O2 -Wall" \
153%endif
[2d9201a]154  CFLAGS="$RPM_OPT_FLAGS" \
155  ../gdb-%{gdb_version}/configure \
156    --build=%_build --host=%_host \
157    --target=sparc-rtems4.9 \
158    --verbose --disable-nls \
159    --without-included-gettext \
160    --disable-win32-registry \
161    --disable-werror \
[a9c3667]162    %{build_sim} \
[48569c74]163    %{?with_system_readline:--with-system-readline} \
[9589c665]164%if "%{gdb_version}" >= "6.6"
[25eda206]165    --with-expat \
[a9c3667]166%endif
167%if "%{gdb_version}" >= "6.8.50"
[48569c74]168%if %{with python}
169    --with-python \
170%else
[a9c3667]171    --without-python \
[48569c74]172%endif
[25eda206]173%endif
[2d9201a]174    --prefix=%{_prefix} --bindir=%{_bindir} \
175    --includedir=%{_includedir} --libdir=%{_libdir} \
176    --mandir=%{_mandir} --infodir=%{_infodir}
177
[fbce31e]178  make %{?_smp_mflags} all
[df16b8bf]179  make info
[2d9201a]180  cd ..
181
182%install
[1f129d87]183  export PATH="%{_bindir}:${PATH}"
[2d9201a]184  rm -rf $RPM_BUILD_ROOT
185
186  cd build
187  make DESTDIR=$RPM_BUILD_ROOT install
188
[df16b8bf]189  rm -f $RPM_BUILD_ROOT%{_infodir}/dir
190  touch $RPM_BUILD_ROOT%{_infodir}/dir
191
192# These come from other packages
193  rm -rf $RPM_BUILD_ROOT%{_infodir}/bfd*
194  rm -rf $RPM_BUILD_ROOT%{_infodir}/configure*
195  rm -rf $RPM_BUILD_ROOT%{_infodir}/standards*
[2d9201a]196
197# We don't ship host files
198  rm -f ${RPM_BUILD_ROOT}%{_libdir}/libiberty*
199
200# host library, installed to a bogus directory
201  rm -f ${RPM_BUILD_ROOT}%{_libdir}/libsparc-rtems4.9-sim.a
202
203  cd ..
204
205# Extract %%__os_install_post into os_install_post~
206cat << \EOF > os_install_post~
207%__os_install_post
208EOF
209
210# Generate customized brp-*scripts
211cat os_install_post~ | while read a x y; do
212case $a in
213# Prevent brp-strip* from trying to handle foreign binaries
214*/brp-strip*)
215  b=$(basename $a)
216  sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b
217  chmod a+x $b
218  ;;
219# Fix up brp-compress to handle %%_prefix != /usr
220*/brp-compress*)
221  b=$(basename $a)
222  sed -e 's,\./usr/,.%{_prefix}/,g' < $a > $b
223  chmod a+x $b
224  ;;
225esac
226done
227
228sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \
229  -e 's,^[ ]*/usr/lib/rpm.*/brp-compress,./brp-compress,' \
230< os_install_post~ > os_install_post
231%define __os_install_post . ./os_install_post
232
233%clean
234  rm -rf $RPM_BUILD_ROOT
235
236# ==============================================================
237# sparc-rtems4.9-gdb
238# ==============================================================
239# %package -n rtems-4.9-sparc-rtems4.9-gdb
240# Summary:      rtems gdb for sparc-rtems4.9
241# Group: Development/Tools
242# %if %build_infos
243# Requires: rtems-4.9-gdb-common
244# %endif
245
246%description -n rtems-4.9-sparc-rtems4.9-gdb
247GNU gdb targetting sparc-rtems4.9.
248
249%files -n rtems-4.9-sparc-rtems4.9-gdb
250%defattr(-,root,root)
[48569c74]251%dir %{_prefix}
252%dir %{_prefix}/share
253
[2d9201a]254%dir %{_mandir}
255%dir %{_mandir}/man1
256%{_mandir}/man1/sparc-rtems4.9-*.1*
257
258%dir %{_bindir}
259%{_bindir}/sparc-rtems4.9-*
260
[df16b8bf]261# ==============================================================
262# rtems-4.9-gdb-common
263# ==============================================================
264%package -n rtems-4.9-gdb-common
265Summary:      Base package for RTEMS gdbs
266Group: Development/Tools
267Requires(post):         /sbin/install-info
268Requires(preun):        /sbin/install-info
[48569c74]269%{?_with_noarch_subpackages:BuildArch: noarch}
[df16b8bf]270
271%description -n rtems-4.9-gdb-common
272
273GDB files shared by all targets.
274
275%post -n rtems-4.9-gdb-common
276  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gdb.info.gz || :
277  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gdbint.info.gz || :
278  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/stabs.info.gz || :
279  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/annotate.info.gz || :
280
281%preun -n rtems-4.9-gdb-common
282if [ $1 -eq 0 ]; then
283  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gdb.info.gz || :
284  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gdbint.info.gz || :
285  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/stabs.info.gz || :
286  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/annotate.info.gz || :
287fi
288
289%files -n rtems-4.9-gdb-common
290%defattr(-,root,root)
[48569c74]291%dir %{_prefix}
292%dir %{_prefix}/share
293
[df16b8bf]294%dir %{_infodir}
295%ghost %{_infodir}/dir
296%{_infodir}/gdb.info*
297
298%{_infodir}/gdbint.info*
299%{_infodir}/stabs.info*
300%{_infodir}/annotate.info*
301
Note: See TracBrowser for help on using the repository browser.