source: rtems/contrib/crossrpms/rtems4.8/i386/rtems-4.8-i386-rtems4.8-gdb.spec @ 8683760

4.8
Last change on this file since 8683760 was 8683760, checked in by Ralf Corsepius <ralf.corsepius@…>, on 09/03/08 at 09:30:34

Regenerate.

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