source: rtems/contrib/crossrpms/rtems4.9/avr/rtems-4.9-avr-rtems4.9-gdb.spec @ 567fed3

4.104.114.95
Last change on this file since 567fed3 was 25eda206, checked in by Ralf Corsepius <ralf.corsepius@…>, on Nov 1, 2007 at 5:58:05 AM

gdb-6.7.1-4

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