source: rtems/contrib/crossrpms/rtems4.9/m68k/rtems-4.9-m68k-rtems4.9-gdb.spec @ c4ad618

4.9
Last change on this file since c4ad618 was c4ad618, checked in by Ralf Corsepius <ralf.corsepius@…>, on 09/23/09 at 16:41:27

Regenerate.

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