source: rtems/contrib/crossrpms/rtems4.10/mipstx39/rtems-4.10-mipstx39-rtems4.10-gdb.spec @ d09e7fc

4.104.115
Last change on this file since d09e7fc was b0015ab, checked in by Ralf Corsepius <ralf.corsepius@…>, on 12/22/09 at 16:30:22

gdb-7.0.1

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