source: rtems/contrib/crossrpms/rtems4.11/powerpc/rtems-4.11-powerpc-rtems4.11-gdb.spec @ d45c69a

4.115
Last change on this file since d45c69a was d45c69a, checked in by Ralf Corsepius <ralf.corsepius@…>, on 12/13/11 at 18:08:46

Regenerate.

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