source: rtems/contrib/crossrpms/rtems4.11/sh/rtems-4.11-sh-rtems4.11-gdb.spec @ 18c4308

4.115
Last change on this file since 18c4308 was 18c4308, checked in by Ralf Corsepius <ralf.corsepius@…>, on Sep 3, 2010 at 5:48:42 AM

Regenerate.

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