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

4.10
Last change on this file since 981a831 was 981a831, checked in by Ralf Corsepius <ralf.corsepius@…>, on Sep 19, 2011 at 10:45:55 PM

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