source: rtems/contrib/crossrpms/rtems4.10/m32c/rtems-4.10-m32c-rtems4.10-gdb.spec @ c74285e

4.104.115
Last change on this file since c74285e was c74285e, checked in by Ralf Corsepius <ralf.corsepius@…>, on 09/18/09 at 10:39:06

Regenerate.

  • Property mode set to 100644
File size: 8.1 KB
RevLine 
[b38ae26b]1#
2# Please send bugfixes or comments to
3#       http://www.rtems.org/bugzilla
4#
5
[54726239]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
[b38ae26b]21
22%ifos cygwin cygwin32 mingw mingw32
23%define _exeext .exe
[3b35bcc5]24%define debug_package           %{nil}
25%define _libdir                 %{_exec_prefix}/lib
[b38ae26b]26%else
27%define _exeext %{nil}
28%endif
29
30%ifos cygwin cygwin32
31%define optflags -O3 -pipe -march=i486 -funroll-loops
[3b35bcc5]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
[b38ae26b]40%endif
41
42%if "%{_build}" != "%{_host}"
[6d3f0321]43%define _host_rpmprefix %{_host}-
[b38ae26b]44%else
45%define _host_rpmprefix %{nil}
46%endif
47
[a4c2b009]48%define gdb_version 6.8.91
49%define gdb_rpmvers %{expand:%(echo 6.8.91 | tr - _)}
[b38ae26b]50
51Name:           rtems-4.10-m32c-rtems4.10-gdb
52Summary:        Gdb for target m32c-rtems4.10
53Group:          Development/Tools
54Version:        %{gdb_rpmvers}
[c74285e]55Release:        2%{?dist}
[b38ae26b]56License:        GPL/LGPL
57URL:            http://sources.redhat.com/gdb
58BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
59
60BuildRequires:  %{_host_rpmprefix}gcc
61
[3b35bcc5]62%define build_sim --enable-sim
[147257d4]63%if "%{_build}" != "%{_host}"
[3b35bcc5]64# psim doesn't support Cdn-X
[147257d4]65%if "m32c-rtems4.10" == "powerpc-rtems4.10"
[3b35bcc5]66%define build_sim --disable-sim
67%endif
[147257d4]68%endif
69
[3b35bcc5]70%ifos mingw mingw32
71# Mingw lacks functions required by the simulator
72%if "m32c-rtems4.10" == "sparc-rtems4.10"
73%define build_sim --disable-sim
74%endif
75%if "m32c-rtems4.10" == "h8300-rtems4.10"
76%define build_sim --disable-sim
77%endif
[aab8725]78%if "%{gdb_version}" >= "6.8.50"
79%if "m32c-rtems4.10" == "m32c-rtems4.10"
80%define build_sim --disable-sim
81%endif
82%endif
[f29c64b]83%if "m32c-rtems4.10" == "lm32-rtems4.10"
84%define build_sim --disable-sim
85%endif
[147257d4]86%if "m32c-rtems4.10" == "mipstx39-rtems4.10"
87%define build_sim --disable-sim
88%endif
[3b35bcc5]89%endif
90
[b38ae26b]91%if "%{gdb_version}" >= "6.6"
92# suse
[88ab8f3]93%if "%{?suse}" >= "10.3"
[b38ae26b]94BuildRequires: libexpat-devel
95%else
[147257d4]96# Fedora/CentOS/Cygwin/MinGW
[b38ae26b]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
[c74285e]105%bcond_with system_readline
[b38ae26b]106%endif
[c74285e]107
108%if 0%{?fedora} >= 12
109%bcond_with system_readline
110%else
111%bcond_without system_readline
112%endif
113%{?with_system_readline:BuildRequires: %{_host_rpmprefix}readline-devel}
[b38ae26b]114BuildRequires:  %{_host_rpmprefix}ncurses-devel
115
[757e5de0]116%if "%{gdb_version}" >= "6.8.50"
117%if "%{_build}" != "%{_host}"
118# Can't build python Cdn-X
119%bcond_with python
120%else
121%bcond_without python
122%endif
123%endif
124%{?with_python:BuildRequires: %{_host_rpmprefix}python-devel}
125
[eb33c6e1]126# Required for building the infos
127BuildRequires:  /sbin/install-info
128BuildRequires:  texinfo >= 4.2
[b38ae26b]129
130
[eb33c6e1]131Requires:       rtems-4.10-gdb-common
132
[f29c64b]133# A copy of a gdb development snapshot having been retrieved from
[c74285e]134# ftp://sourceware.org/pub/gdb/snapshots/branch/gdb-%{gdb_version}.tar.bz2
[f29c64b]135Source0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-%{gdb_version}.tar.bz2
[c74285e]136Patch0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-%{gdb_version}-rtems4.10-20090918.diff
[b38ae26b]137
138%description
139GDB for target m32c-rtems4.10
140%prep
141%setup -q -c -T -n %{name}-%{version}
142
143%setup -q -D -T -n %{name}-%{version} -a0
144cd gdb-%{gdb_version}
145%{?PATCH0:%patch0 -p1}
146cd ..
147
148# Force using a system-provided libreadline
[c74285e]149%{?with_system_readline:rm -f gdb-%{gdb_version}/readline/configure}
[b38ae26b]150%build
151  export PATH="%{_bindir}:${PATH}"
152  mkdir -p build
153  cd build
154%if "%{_build}" != "%{_host}"
155  CFLAGS_FOR_BUILD="-g -O2 -Wall" \
156%endif
157  CFLAGS="$RPM_OPT_FLAGS" \
158  ../gdb-%{gdb_version}/configure \
159    --build=%_build --host=%_host \
160    --target=m32c-rtems4.10 \
161    --verbose --disable-nls \
162    --without-included-gettext \
163    --disable-win32-registry \
164    --disable-werror \
[3b35bcc5]165    %{build_sim} \
[c74285e]166    %{?with_system_readline:--with-system-readline} \
[b38ae26b]167%if "%{gdb_version}" >= "6.6"
168    --with-expat \
[88ab8f3]169%endif
170%if "%{gdb_version}" >= "6.8.50"
[757e5de0]171%if %{with python}
172    --with-python \
173%else
[88ab8f3]174    --without-python \
[757e5de0]175%endif
[b38ae26b]176%endif
177    --prefix=%{_prefix} --bindir=%{_bindir} \
178    --includedir=%{_includedir} --libdir=%{_libdir} \
179    --mandir=%{_mandir} --infodir=%{_infodir}
180
181  make %{?_smp_mflags} all
[eb33c6e1]182  make info
[b38ae26b]183  cd ..
184
185%install
186  export PATH="%{_bindir}:${PATH}"
187  rm -rf $RPM_BUILD_ROOT
188
189  cd build
190  make DESTDIR=$RPM_BUILD_ROOT install
191
[eb33c6e1]192  rm -f $RPM_BUILD_ROOT%{_infodir}/dir
193  touch $RPM_BUILD_ROOT%{_infodir}/dir
194
195# These come from other packages
196  rm -rf $RPM_BUILD_ROOT%{_infodir}/bfd*
197  rm -rf $RPM_BUILD_ROOT%{_infodir}/configure*
198  rm -rf $RPM_BUILD_ROOT%{_infodir}/standards*
[b38ae26b]199
200# We don't ship host files
201  rm -f ${RPM_BUILD_ROOT}%{_libdir}/libiberty*
202
203# host library, installed to a bogus directory
204  rm -f ${RPM_BUILD_ROOT}%{_libdir}/libm32c-rtems4.10-sim.a
205
206  cd ..
207
208# Extract %%__os_install_post into os_install_post~
209cat << \EOF > os_install_post~
210%__os_install_post
211EOF
212
213# Generate customized brp-*scripts
214cat os_install_post~ | while read a x y; do
215case $a in
216# Prevent brp-strip* from trying to handle foreign binaries
217*/brp-strip*)
218  b=$(basename $a)
219  sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b
220  chmod a+x $b
221  ;;
222# Fix up brp-compress to handle %%_prefix != /usr
223*/brp-compress*)
224  b=$(basename $a)
225  sed -e 's,\./usr/,.%{_prefix}/,g' < $a > $b
226  chmod a+x $b
227  ;;
228esac
229done
230
231sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \
232  -e 's,^[ ]*/usr/lib/rpm.*/brp-compress,./brp-compress,' \
233< os_install_post~ > os_install_post
234%define __os_install_post . ./os_install_post
235
236%clean
237  rm -rf $RPM_BUILD_ROOT
238
239# ==============================================================
240# m32c-rtems4.10-gdb
241# ==============================================================
242# %package -n rtems-4.10-m32c-rtems4.10-gdb
243# Summary:      rtems gdb for m32c-rtems4.10
244# Group: Development/Tools
245# %if %build_infos
246# Requires: rtems-4.10-gdb-common
247# %endif
248
249%description -n rtems-4.10-m32c-rtems4.10-gdb
250GNU gdb targetting m32c-rtems4.10.
251
252%files -n rtems-4.10-m32c-rtems4.10-gdb
253%defattr(-,root,root)
[cae117d9]254%dir %{_prefix}
255%dir %{_prefix}/share
256
[b38ae26b]257%dir %{_mandir}
258%dir %{_mandir}/man1
259%{_mandir}/man1/m32c-rtems4.10-*.1*
260
261%dir %{_bindir}
262%{_bindir}/m32c-rtems4.10-*
263
[eb33c6e1]264# ==============================================================
265# rtems-4.10-gdb-common
266# ==============================================================
267%package -n rtems-4.10-gdb-common
268Summary:      Base package for RTEMS gdbs
269Group: Development/Tools
270Requires(post):         /sbin/install-info
271Requires(preun):        /sbin/install-info
272%{?_with_noarch_subpackages:BuildArch: noarch}
273
274%description -n rtems-4.10-gdb-common
275
276GDB files shared by all targets.
277
278%post -n rtems-4.10-gdb-common
279  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gdb.info.gz || :
280  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gdbint.info.gz || :
281  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/stabs.info.gz || :
282  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/annotate.info.gz || :
283
284%preun -n rtems-4.10-gdb-common
285if [ $1 -eq 0 ]; then
286  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gdb.info.gz || :
287  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gdbint.info.gz || :
288  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/stabs.info.gz || :
289  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/annotate.info.gz || :
290fi
291
292%files -n rtems-4.10-gdb-common
293%defattr(-,root,root)
294%dir %{_prefix}
295%dir %{_prefix}/share
296
297%dir %{_infodir}
298%ghost %{_infodir}/dir
299%{_infodir}/gdb.info*
300
301%{_infodir}/gdbint.info*
302%{_infodir}/stabs.info*
303%{_infodir}/annotate.info*
304
Note: See TracBrowser for help on using the repository browser.