source: rtems/contrib/crossrpms/rtems4.9/sh/rtems-4.9-sh-rtems4.9-gdb.spec @ 7ad3289

4.9
Last change on this file since 7ad3289 was 7ad3289, checked in by Ralf Corsepius <ralf.corsepius@…>, on 01/20/09 at 16:33:34

Regenerate.

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