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

4.10
Last change on this file since c53e0e31 was c53e0e31, checked in by Ralf Corsepius <ralf.corsepius@…>, on May 20, 2011 at 4:24:08 AM

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