source: rtems/contrib/crossrpms/rtems4.10/sh/rtems-4.10-sh-rtems4.10-gdb.spec @ 981a831

4.10
Last change on this file since 981a831 was 981a831, checked in by Ralf Corsepius <ralf.corsepius@…>, on Sep 19, 2011 at 10:45:55 PM

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