source: rtems/contrib/crossrpms/rtems4.11/m68k/rtems-4.11-m68k-rtems4.11-gdb.spec @ 66c7307

4.104.11
Last change on this file since 66c7307 was 64c228c4, checked in by Ralf Corsepius <ralf.corsepius@…>, on Mar 20, 2010 at 6:59:01 AM

Regenerate.

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