source: rtems/contrib/crossrpms/rtems4.10/powerpc/rtems-4.10-powerpc-rtems4.10-gdb.spec @ c53e0e31

4.10
Last change on this file since c53e0e31 was c53e0e31, checked in by Ralf Corsepius <ralf.corsepius@…>, on May 20, 2011 at 4:24:08 AM

Regenerate.

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