source: rtems/contrib/crossrpms/rtems4.10/bfin/rtems-4.10-bfin-rtems4.10-gdb.spec @ 0ebf210b

4.104.115
Last change on this file since 0ebf210b was 4a23fa97, checked in by Ralf Corsepius <ralf.corsepius@…>, on 03/29/10 at 13:31:41

Regenerate.

  • Property mode set to 100644
File size: 5.9 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%define debug_package           %{nil}
25%define _libdir                 %{_exec_prefix}/lib
26%else
27%define _exeext %{nil}
28%endif
29
30%ifos cygwin cygwin32
31%define optflags -O3 -pipe -march=i486 -funroll-loops
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
40%endif
41
42%if "%{_build}" != "%{_host}"
43%define _host_rpmprefix %{_host}-
44%else
45%define _host_rpmprefix %{nil}
46%endif
47
48%define gdb_version 6.5
49%define gdb_rpmvers %{expand:%(echo 6.5 | tr - _)}
50
51Name:           rtems-4.10-bfin-rtems4.10-gdb
52Summary:        Gdb for target bfin-rtems4.10
53Group:          Development/Tools
54Version:        %{gdb_rpmvers}
55Release:        12%{?dist}
56License:        GPL/LGPL
57URL:            http://sources.redhat.com/gdb
58BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
59
60BuildRequires:  %{_host_rpmprefix}gcc
61
62%define build_sim --enable-sim
63
64
65%if "%{gdb_version}" >= "6.6"
66# suse
67%if "%{?suse}" >= "10.3"
68BuildRequires: libexpat-devel
69%else
70# Fedora/CentOS/Cygwin/MinGW
71BuildRequires: %{_host_rpmprefix}expat-devel
72%endif
73%endif
74
75%if "%{gdb_version}" < "6.7"
76%if "%{_build}" != "%{_host}"
77BuildRequires:  %{_host_rpmprefix}termcap-devel
78%endif
79%bcond_with system_readline
80%else
81%bcond_without system_readline
82%endif
83%{?with_system_readline:BuildRequires: %{_host_rpmprefix}readline-devel}
84BuildRequires:  %{_host_rpmprefix}ncurses-devel
85
86%if "%{gdb_version}" >= "6.8.50"
87%if "%{_build}" != "%{_host}"
88# Can't build python Cdn-X
89%bcond_with python
90%else
91%bcond_without python
92%endif
93%endif
94%{?with_python:BuildRequires: %{_host_rpmprefix}python-devel}
95
96
97
98Source0:        ftp://ftp.gnu.org/pub/gnu/gdb/gdb-%{gdb_version}.tar.bz2
99%{?_without_sources:NoSource:   0}
100Patch0:         ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-6.5-bfinrtems-20090122.diff
101
102%description
103GDB for target bfin-rtems4.10
104%prep
105%setup -q -c -T -n %{name}-%{version}
106
107%setup -q -D -T -n %{name}-%{version} -a0
108cd gdb-%{gdb_version}
109%{?PATCH0:%patch0 -p1}
110cd ..
111
112# Force using a system-provided libreadline
113%{?with_system_readline:rm -f gdb-%{gdb_version}/readline/configure}
114%build
115  export PATH="%{_bindir}:${PATH}"
116  mkdir -p build
117  cd build
118%if "%{_build}" != "%{_host}"
119  CFLAGS_FOR_BUILD="-g -O2 -Wall" \
120%endif
121  CFLAGS="$RPM_OPT_FLAGS" \
122  ../gdb-%{gdb_version}/configure \
123    --build=%_build --host=%_host \
124    --target=bfin-rtems4.10 \
125    --verbose --disable-nls \
126    --without-included-gettext \
127    --disable-win32-registry \
128    --disable-werror \
129    %{build_sim} \
130    %{?with_system_readline:--with-system-readline} \
131%if "%{gdb_version}" >= "6.6"
132    --with-expat \
133%endif
134%if "%{gdb_version}" >= "6.8.50"
135%if %{with python}
136    --with-python \
137%else
138    --without-python \
139%endif
140%endif
141    --prefix=%{_prefix} --bindir=%{_bindir} \
142    --includedir=%{_includedir} --libdir=%{_libdir} \
143    --mandir=%{_mandir} --infodir=%{_infodir}
144
145  make %{?_smp_mflags} all
146  cd ..
147
148%install
149  export PATH="%{_bindir}:${PATH}"
150  rm -rf $RPM_BUILD_ROOT
151
152  cd build
153  make DESTDIR=$RPM_BUILD_ROOT install
154
155# Conflict with a native gdb's infos
156  rm -rf $RPM_BUILD_ROOT%{_infodir}
157
158# We don't ship host files
159  rm -f ${RPM_BUILD_ROOT}%{_libdir}/libiberty*
160
161# host library, installed to a bogus directory
162  rm -f ${RPM_BUILD_ROOT}%{_libdir}/libbfin-rtems4.10-sim.a
163
164%if "%{gdb_version}" >= "7.0"
165# Bug in gdb-7.0, bogusly installs linux-only files
166  somethinguseful=0
167  for f in ${RPM_BUILD_ROOT}%{_datadir}/gdb/syscalls/*.xml; do
168    case $f in
169    *linux.xml) rm -f $f;;
170    *.xml) somethinguseful=1;;
171    esac
172  done
173  if test $somethinguseful -eq 0; then
174    rm -rf "${RPM_BUILD_ROOT}%{_datadir}/gdb/syscalls"
175  fi
176%endif
177
178  cd ..
179
180# Extract %%__os_install_post into os_install_post~
181cat << \EOF > os_install_post~
182%__os_install_post
183EOF
184
185# Generate customized brp-*scripts
186cat os_install_post~ | while read a x y; do
187case $a in
188# Prevent brp-strip* from trying to handle foreign binaries
189*/brp-strip*)
190  b=$(basename $a)
191  sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b
192  chmod a+x $b
193  ;;
194# Fix up brp-compress to handle %%_prefix != /usr
195*/brp-compress*)
196  b=$(basename $a)
197  sed -e 's,\./usr/,.%{_prefix}/,g' < $a > $b
198  chmod a+x $b
199  ;;
200esac
201done
202
203sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \
204  -e 's,^[ ]*/usr/lib/rpm.*/brp-compress,./brp-compress,' \
205< os_install_post~ > os_install_post
206%define __os_install_post . ./os_install_post
207
208%clean
209  rm -rf $RPM_BUILD_ROOT
210
211# ==============================================================
212# bfin-rtems4.10-gdb
213# ==============================================================
214# %package -n rtems-4.10-bfin-rtems4.10-gdb
215# Summary:      rtems gdb for bfin-rtems4.10
216# Group: Development/Tools
217# %if %build_infos
218# Requires: rtems-4.10-gdb-common
219# %endif
220
221%description -n rtems-4.10-bfin-rtems4.10-gdb
222GNU gdb targetting bfin-rtems4.10.
223
224%files -n rtems-4.10-bfin-rtems4.10-gdb
225%defattr(-,root,root)
226%dir %{_prefix}
227%dir %{_prefix}/share
228
229%dir %{_mandir}
230%dir %{_mandir}/man1
231%{_mandir}/man1/bfin-rtems4.10-*.1*
232
233%dir %{_bindir}
234%{_bindir}/bfin-rtems4.10-*
235
Note: See TracBrowser for help on using the repository browser.