source: rtems/contrib/crossrpms/rtems4.11/mipstx39/rtems-4.11-mipstx39-rtems4.11-gdb.spec @ 64c228c4

4.104.115
Last change on this file since 64c228c4 was 64c228c4, checked in by Ralf Corsepius <ralf.corsepius@…>, on Mar 20, 2010 at 6:59:01 AM

Regenerate.

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