source: rtems/contrib/crossrpms/rtems4.10/mips/rtems-4.10-mips-rtems4.10-gdb.spec @ 9b0be4d6

4.10
Last change on this file since 9b0be4d6 was c53e0e31, checked in by Ralf Corsepius <ralf.corsepius@…>, on 05/20/11 at 04:24:08

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