source: rtems/contrib/crossrpms/rtems4.10/avr/rtems-4.10-avr-rtems4.10-gdb.spec @ 5ca8bf3b

4.104.115
Last change on this file since 5ca8bf3b was 5ca8bf3b, checked in by Ralf Corsepius <ralf.corsepius@…>, on Jun 29, 2009 at 4:55:24 PM

Update to gdb-6.8.50.20090629

  • 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 rtems-4.10-%{_host}-
44%else
45%define _host_rpmprefix %{nil}
46%endif
47
48%define gdb_version 6.8.50.20090629
49%define gdb_rpmvers %{expand:%(echo 6.8.50.20090629 | tr - _)}
50
51Name:           rtems-4.10-avr-rtems4.10-gdb
52Summary:        Gdb for target avr-rtems4.10
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%if "%{_build}" != "%{_host}"
64# psim doesn't support Cdn-X
65%if "avr-rtems4.10" == "powerpc-rtems4.10"
66%define build_sim --disable-sim
67%endif
68%endif
69
70%ifos mingw mingw32
71# Mingw lacks functions required by the simulator
72%if "avr-rtems4.10" == "sparc-rtems4.10"
73%define build_sim --disable-sim
74%endif
75%if "avr-rtems4.10" == "h8300-rtems4.10"
76%define build_sim --disable-sim
77%endif
78%if "%{gdb_version}" >= "6.8.50"
79%if "avr-rtems4.10" == "m32c-rtems4.10"
80%define build_sim --disable-sim
81%endif
82%endif
83%if "avr-rtems4.10" == "lm32-rtems4.10"
84%define build_sim --disable-sim
85%endif
86%if "avr-rtems4.10" == "mipstx39-rtems4.10"
87%define build_sim --disable-sim
88%endif
89%endif
90
91%if "%{gdb_version}" >= "6.6"
92# suse
93%if "%{?suse}" >= "10.3"
94BuildRequires: libexpat-devel
95%else
96# Fedora/CentOS/Cygwin/MinGW
97BuildRequires: %{_host_rpmprefix}expat-devel
98%endif
99%endif
100
101%if "%{gdb_version}" < "6.7"
102%if "%{_build}" != "%{_host}"
103BuildRequires:  %{_host_rpmprefix}termcap-devel
104%endif
105%endif
106BuildRequires:  %{_host_rpmprefix}readline-devel
107BuildRequires:  %{_host_rpmprefix}ncurses-devel
108
109# Required for building the infos
110BuildRequires:  /sbin/install-info
111BuildRequires:  texinfo >= 4.2
112
113
114Requires:       rtems-4.10-gdb-common
115
116# A copy of a gdb development snapshot having been retrieved from
117# ftp://sources.redhat.com/pub/gdb/snapshots/current/gdb-%{gdb_version}.tar.bz2
118Source0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-%{gdb_version}.tar.bz2
119
120# rtems-4.10 patches
121# + lm32-sim/gdb http://sourceware.org/ml/gdb-patches/2008-12/msg00373.html
122# + misc small fixes to lm32-sim/gdb
123# + avr simulator
124Patch0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-6.8.50.20090629-rtems4.10-20090629.diff
125
126%description
127GDB for target avr-rtems4.10
128%prep
129%setup -q -c -T -n %{name}-%{version}
130
131%setup -q -D -T -n %{name}-%{version} -a0
132cd gdb-%{gdb_version}
133%{?PATCH0:%patch0 -p1}
134cd ..
135
136%if "%{gdb_version}" >= "6.7"
137# Force using a system-provided libreadline
138rm -f gdb-%{gdb_version}/readline/configure
139%endif
140%build
141  export PATH="%{_bindir}:${PATH}"
142  mkdir -p build
143  cd build
144%if "%{_build}" != "%{_host}"
145  CFLAGS_FOR_BUILD="-g -O2 -Wall" \
146%endif
147  CFLAGS="$RPM_OPT_FLAGS" \
148  ../gdb-%{gdb_version}/configure \
149    --build=%_build --host=%_host \
150    --target=avr-rtems4.10 \
151    --verbose --disable-nls \
152    --without-included-gettext \
153    --disable-win32-registry \
154    --disable-werror \
155    %{build_sim} \
156%if "%{gdb_version}" >= "6.7"
157    --with-system-readline \
158%endif
159%if "%{gdb_version}" >= "6.6"
160    --with-expat \
161%endif
162%if "%{gdb_version}" >= "6.8.50"
163    --without-python \
164%endif
165    --prefix=%{_prefix} --bindir=%{_bindir} \
166    --includedir=%{_includedir} --libdir=%{_libdir} \
167    --mandir=%{_mandir} --infodir=%{_infodir}
168
169  make %{?_smp_mflags} all
170  make info
171  cd ..
172
173%install
174  export PATH="%{_bindir}:${PATH}"
175  rm -rf $RPM_BUILD_ROOT
176
177  cd build
178  make DESTDIR=$RPM_BUILD_ROOT install
179
180  rm -f $RPM_BUILD_ROOT%{_infodir}/dir
181  touch $RPM_BUILD_ROOT%{_infodir}/dir
182
183# These come from other packages
184  rm -rf $RPM_BUILD_ROOT%{_infodir}/bfd*
185  rm -rf $RPM_BUILD_ROOT%{_infodir}/configure*
186  rm -rf $RPM_BUILD_ROOT%{_infodir}/standards*
187
188# We don't ship host files
189  rm -f ${RPM_BUILD_ROOT}%{_libdir}/libiberty*
190
191# host library, installed to a bogus directory
192  rm -f ${RPM_BUILD_ROOT}%{_libdir}/libavr-rtems4.10-sim.a
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# avr-rtems4.10-gdb
229# ==============================================================
230# %package -n rtems-4.10-avr-rtems4.10-gdb
231# Summary:      rtems gdb for avr-rtems4.10
232# Group: Development/Tools
233# %if %build_infos
234# Requires: rtems-4.10-gdb-common
235# %endif
236
237%description -n rtems-4.10-avr-rtems4.10-gdb
238GNU gdb targetting avr-rtems4.10.
239
240%files -n rtems-4.10-avr-rtems4.10-gdb
241%defattr(-,root,root)
242%dir %{_mandir}
243%dir %{_mandir}/man1
244%{_mandir}/man1/avr-rtems4.10-*.1*
245
246%dir %{_bindir}
247%{_bindir}/avr-rtems4.10-*
248
249# ==============================================================
250# rtems-4.10-gdb-common
251# ==============================================================
252%package -n rtems-4.10-gdb-common
253Summary:      Base package for RTEMS gdbs
254Group: Development/Tools
255Requires(post):         /sbin/install-info
256Requires(preun):        /sbin/install-info
257
258%description -n rtems-4.10-gdb-common
259
260GDB files shared by all targets.
261
262%post -n rtems-4.10-gdb-common
263  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gdb.info.gz || :
264  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gdbint.info.gz || :
265  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/stabs.info.gz || :
266  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/annotate.info.gz || :
267
268%preun -n rtems-4.10-gdb-common
269if [ $1 -eq 0 ]; then
270  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gdb.info.gz || :
271  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gdbint.info.gz || :
272  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/stabs.info.gz || :
273  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/annotate.info.gz || :
274fi
275
276%files -n rtems-4.10-gdb-common
277%defattr(-,root,root)
278%dir %{_infodir}
279%ghost %{_infodir}/dir
280%{_infodir}/gdb.info*
281
282%{_infodir}/gdbint.info*
283%{_infodir}/stabs.info*
284%{_infodir}/annotate.info*
285
Note: See TracBrowser for help on using the repository browser.