source: rtems/contrib/crossrpms/rtems4.11/h8300/rtems-4.11-h8300-rtems4.11-gdb.spec @ 09e920b

4.115
Last change on this file since 09e920b was 09e920b, checked in by Ralf Corsepius <ralf.corsepius@…>, on Aug 31, 2011 at 9:17:31 AM

Regenerate.

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