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

4.104.115
Last change on this file since bdd00f2 was 4a23fa97, checked in by Ralf Corsepius <ralf.corsepius@…>, on 03/29/10 at 13:31:41

Regenerate.

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