source: rtems/contrib/crossrpms/rtems4.10/arm/rtems-4.10-arm-rtems4.10-gdb.spec @ 626f03d

4.104.115
Last change on this file since 626f03d was 626f03d, checked in by Ralf Corsepius <ralf.corsepius@…>, on 09/26/09 at 06:06:37

Regenerate.

  • Property mode set to 100644
File size: 8.0 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.8.91
49%define gdb_rpmvers %{expand:%(echo 6.8.91 | tr - _)}
50
51Name:           rtems-4.10-arm-rtems4.10-gdb
52Summary:        Gdb for target arm-rtems4.10
53Group:          Development/Tools
54Version:        %{gdb_rpmvers}
55Release:        4%{?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%if "%{_build}" != "%{_host}"
64# psim doesn't support Cdn-X
65%if "arm-rtems4.10" == "powerpc-rtems4.10"
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 "arm-rtems4.10" == "sparc-rtems4.10"
73%define build_sim --disable-sim
74%endif
75%if "arm-rtems4.10" == "h8300-rtems4.10"
76%define build_sim --disable-sim
77%endif
78%if "%{gdb_version}" >= "6.8.50"
79%if "arm-rtems4.10" == "m32c-rtems4.10"
80%define build_sim --disable-sim
81%endif
82%endif
83%if "arm-rtems4.10" == "lm32-rtems4.10"
84%define build_sim --disable-sim
85%endif
86%if "arm-rtems4.10" == "mipstx39-rtems4.10"
87%define build_sim --disable-sim
88%endif
89%endif
90
91%if "%{gdb_version}" >= "6.6"
92# suse
93%if "%{?suse}" >= "10.3"
94BuildRequires: libexpat-devel
95%else
96# Fedora/CentOS/Cygwin/MinGW
97BuildRequires: %{_host_rpmprefix}expat-devel
98%endif
99%endif
100
101%if "%{gdb_version}" < "6.7"
102%if "%{_build}" != "%{_host}"
103BuildRequires:  %{_host_rpmprefix}termcap-devel
104%endif
105%bcond_with system_readline
106%else
107%bcond_without system_readline
108%endif
109%{?with_system_readline:BuildRequires: %{_host_rpmprefix}readline-devel}
110BuildRequires:  %{_host_rpmprefix}ncurses-devel
111
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
122# Required for building the infos
123BuildRequires:  /sbin/install-info
124BuildRequires:  texinfo >= 4.2
125
126
127Requires:       rtems-4.10-gdb-common
128
129# A copy of a gdb development snapshot having been retrieved from
130# ftp://sourceware.org/pub/gdb/snapshots/branch/gdb-%{gdb_version}.tar.bz2
131Source0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-%{gdb_version}.tar.bz2
132Patch0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-%{gdb_version}-rtems4.10-20090926.diff
133
134%description
135GDB for target arm-rtems4.10
136%prep
137%setup -q -c -T -n %{name}-%{version}
138
139%setup -q -D -T -n %{name}-%{version} -a0
140cd gdb-%{gdb_version}
141%{?PATCH0:%patch0 -p1}
142cd ..
143
144# Force using a system-provided libreadline
145%{?with_system_readline:rm -f gdb-%{gdb_version}/readline/configure}
146%build
147  export PATH="%{_bindir}:${PATH}"
148  mkdir -p build
149  cd build
150%if "%{_build}" != "%{_host}"
151  CFLAGS_FOR_BUILD="-g -O2 -Wall" \
152%endif
153  CFLAGS="$RPM_OPT_FLAGS" \
154  ../gdb-%{gdb_version}/configure \
155    --build=%_build --host=%_host \
156    --target=arm-rtems4.10 \
157    --verbose --disable-nls \
158    --without-included-gettext \
159    --disable-win32-registry \
160    --disable-werror \
161    %{build_sim} \
162    %{?with_system_readline:--with-system-readline} \
163%if "%{gdb_version}" >= "6.6"
164    --with-expat \
165%endif
166%if "%{gdb_version}" >= "6.8.50"
167%if %{with python}
168    --with-python \
169%else
170    --without-python \
171%endif
172%endif
173    --prefix=%{_prefix} --bindir=%{_bindir} \
174    --includedir=%{_includedir} --libdir=%{_libdir} \
175    --mandir=%{_mandir} --infodir=%{_infodir}
176
177  make %{?_smp_mflags} all
178  make info
179  cd ..
180
181%install
182  export PATH="%{_bindir}:${PATH}"
183  rm -rf $RPM_BUILD_ROOT
184
185  cd build
186  make DESTDIR=$RPM_BUILD_ROOT install
187
188  rm -f $RPM_BUILD_ROOT%{_infodir}/dir
189  touch $RPM_BUILD_ROOT%{_infodir}/dir
190
191# These come from other packages
192  rm -rf $RPM_BUILD_ROOT%{_infodir}/bfd*
193  rm -rf $RPM_BUILD_ROOT%{_infodir}/configure*
194  rm -rf $RPM_BUILD_ROOT%{_infodir}/standards*
195
196# We don't ship host files
197  rm -f ${RPM_BUILD_ROOT}%{_libdir}/libiberty*
198
199# host library, installed to a bogus directory
200  rm -f ${RPM_BUILD_ROOT}%{_libdir}/libarm-rtems4.10-sim.a
201
202  cd ..
203
204# Extract %%__os_install_post into os_install_post~
205cat << \EOF > os_install_post~
206%__os_install_post
207EOF
208
209# Generate customized brp-*scripts
210cat os_install_post~ | while read a x y; do
211case $a in
212# Prevent brp-strip* from trying to handle foreign binaries
213*/brp-strip*)
214  b=$(basename $a)
215  sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b
216  chmod a+x $b
217  ;;
218# Fix up brp-compress to handle %%_prefix != /usr
219*/brp-compress*)
220  b=$(basename $a)
221  sed -e 's,\./usr/,.%{_prefix}/,g' < $a > $b
222  chmod a+x $b
223  ;;
224esac
225done
226
227sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \
228  -e 's,^[ ]*/usr/lib/rpm.*/brp-compress,./brp-compress,' \
229< os_install_post~ > os_install_post
230%define __os_install_post . ./os_install_post
231
232%clean
233  rm -rf $RPM_BUILD_ROOT
234
235# ==============================================================
236# arm-rtems4.10-gdb
237# ==============================================================
238# %package -n rtems-4.10-arm-rtems4.10-gdb
239# Summary:      rtems gdb for arm-rtems4.10
240# Group: Development/Tools
241# %if %build_infos
242# Requires: rtems-4.10-gdb-common
243# %endif
244
245%description -n rtems-4.10-arm-rtems4.10-gdb
246GNU gdb targetting arm-rtems4.10.
247
248%files -n rtems-4.10-arm-rtems4.10-gdb
249%defattr(-,root,root)
250%dir %{_prefix}
251%dir %{_prefix}/share
252
253%dir %{_mandir}
254%dir %{_mandir}/man1
255%{_mandir}/man1/arm-rtems4.10-*.1*
256
257%dir %{_bindir}
258%{_bindir}/arm-rtems4.10-*
259
260# ==============================================================
261# rtems-4.10-gdb-common
262# ==============================================================
263%package -n rtems-4.10-gdb-common
264Summary:      Base package for RTEMS gdbs
265Group: Development/Tools
266Requires(post):         /sbin/install-info
267Requires(preun):        /sbin/install-info
268%{?_with_noarch_subpackages:BuildArch: noarch}
269
270%description -n rtems-4.10-gdb-common
271
272GDB files shared by all targets.
273
274%post -n rtems-4.10-gdb-common
275  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gdb.info.gz || :
276  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gdbint.info.gz || :
277  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/stabs.info.gz || :
278  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/annotate.info.gz || :
279
280%preun -n rtems-4.10-gdb-common
281if [ $1 -eq 0 ]; then
282  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gdb.info.gz || :
283  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gdbint.info.gz || :
284  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/stabs.info.gz || :
285  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/annotate.info.gz || :
286fi
287
288%files -n rtems-4.10-gdb-common
289%defattr(-,root,root)
290%dir %{_prefix}
291%dir %{_prefix}/share
292
293%dir %{_infodir}
294%ghost %{_infodir}/dir
295%{_infodir}/gdb.info*
296
297%{_infodir}/gdbint.info*
298%{_infodir}/stabs.info*
299%{_infodir}/annotate.info*
300
Note: See TracBrowser for help on using the repository browser.