source: rtems/contrib/crossrpms/rtems4.9/powerpc/rtems-4.9-powerpc-rtems4.9-gdb.spec @ ea7a607

4.104.114.95
Last change on this file since ea7a607 was ea7a607, checked in by Ralf Corsepius <ralf.corsepius@…>, on 04/28/08 at 14:32:07

Regenerate.

  • Property mode set to 100644
File size: 6.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.9
7%define _infodir                %{_prefix}/info
8%define _mandir                 %{_prefix}/man
9
10%ifos cygwin cygwin32 mingw mingw32
11%define _exeext .exe
12%else
13%define _exeext %{nil}
14%endif
15
16%ifos cygwin cygwin32
17%define optflags -O3 -pipe -march=i486 -funroll-loops
18%define _libdir                 %{_exec_prefix}/lib
19%define debug_package           %{nil}
20%endif
21
22%if "%{_build}" != "%{_host}"
23%define _host_rpmprefix rtems-4.9-%{_host}-
24%else
25%define _host_rpmprefix %{nil}
26%endif
27
28%define gdb_version 6.8
29%define gdb_rpmvers %{expand:%(echo 6.8 | tr - _)}
30
31Name:           rtems-4.9-powerpc-rtems4.9-gdb
32Summary:        Gdb for target powerpc-rtems4.9
33Group:          Development/Tools
34Version:        %{gdb_rpmvers}
35Release:        2%{?dist}
36License:        GPL/LGPL
37URL:            http://sources.redhat.com/gdb
38BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
39
40BuildRequires:  %{_host_rpmprefix}gcc
41
42%if "%{gdb_version}" >= "6.6"
43# suse
44%if "%{?suse}"
45%if "%{?suse}" >= "10.3"
46BuildRequires: libexpat-devel
47%else
48BuildRequires: expat
49%endif
50%else
51# fedora/redhat/cygwin
52BuildRequires: %{_host_rpmprefix}expat-devel
53%endif
54%endif
55
56%if "%{gdb_version}" < "6.6"
57%if "%{_build}" != "%{_host}"
58BuildRequires:  %{_host_rpmprefix}termcap-devel
59%endif
60%endif
61BuildRequires:  %{_host_rpmprefix}readline-devel
62BuildRequires:  %{_host_rpmprefix}ncurses-devel
63
64# Required for building the infos
65BuildRequires:  /sbin/install-info
66BuildRequires:  texinfo >= 4.2
67%if "powerpc-rtems4.9" == "sparc-rtems4.9"
68BuildConflicts: libtermcap-devel termcap-devel
69%endif
70
71
72Requires:       rtems-4.9-gdb-common
73
74Source0:        ftp://ftp.gnu.org/pub/gnu/gdb/gdb-%{gdb_version}.tar.bz2
75%{?_without_sources:NoSource:   0}
76%if "%{gdb_version}" == "6.8"
77Patch0:         gdb-6.8-rtems4.9-20080428.diff
78%endif
79
80%description
81GDB for target powerpc-rtems4.9
82%prep
83%setup -q -c -T -n %{name}-%{version}
84
85%setup -q -D -T -n %{name}-%{version} -a0
86cd gdb-%{gdb_version}
87%{?PATCH0:%patch0 -p1}
88%{?PATCH1:%patch1 -p1}
89cd ..
90
91%if "%{gdb_version}" >= "6.8"
92# Force using a system-provided libreadline
93rm -f gdb-%{gdb_version}/readline/configure
94%endif
95%build
96  export PATH="%{_bindir}:${PATH}"
97  mkdir -p build
98  cd build
99%if "%{_build}" != "%{_host}"
100  CFLAGS_FOR_BUILD="-g -O2 -Wall" \
101%endif
102  CFLAGS="$RPM_OPT_FLAGS" \
103  ../gdb-%{gdb_version}/configure \
104    --build=%_build --host=%_host \
105    --target=powerpc-rtems4.9 \
106    --verbose --disable-nls \
107    --without-included-gettext \
108    --disable-win32-registry \
109    --disable-werror \
110    --enable-sim \
111%if "%{gdb_version}" >= "6.6"
112    --with-system-readline \
113    --with-expat \
114%endif
115    --prefix=%{_prefix} --bindir=%{_bindir} \
116    --includedir=%{_includedir} --libdir=%{_libdir} \
117    --mandir=%{_mandir} --infodir=%{_infodir}
118
119  make %{?_smp_mflags} all
120  make info
121  cd ..
122
123%install
124  export PATH="%{_bindir}:${PATH}"
125  rm -rf $RPM_BUILD_ROOT
126
127  cd build
128  make DESTDIR=$RPM_BUILD_ROOT install
129
130  rm -f $RPM_BUILD_ROOT%{_infodir}/dir
131  touch $RPM_BUILD_ROOT%{_infodir}/dir
132
133# These come from other packages
134  rm -rf $RPM_BUILD_ROOT%{_infodir}/bfd*
135  rm -rf $RPM_BUILD_ROOT%{_infodir}/configure*
136  rm -rf $RPM_BUILD_ROOT%{_infodir}/standards*
137
138# We don't ship host files
139  rm -f ${RPM_BUILD_ROOT}%{_libdir}/libiberty*
140
141# host library, installed to a bogus directory
142  rm -f ${RPM_BUILD_ROOT}%{_libdir}/libpowerpc-rtems4.9-sim.a
143
144  cd ..
145
146# Extract %%__os_install_post into os_install_post~
147cat << \EOF > os_install_post~
148%__os_install_post
149EOF
150
151# Generate customized brp-*scripts
152cat os_install_post~ | while read a x y; do
153case $a in
154# Prevent brp-strip* from trying to handle foreign binaries
155*/brp-strip*)
156  b=$(basename $a)
157  sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b
158  chmod a+x $b
159  ;;
160# Fix up brp-compress to handle %%_prefix != /usr
161*/brp-compress*)
162  b=$(basename $a)
163  sed -e 's,\./usr/,.%{_prefix}/,g' < $a > $b
164  chmod a+x $b
165  ;;
166esac
167done
168
169sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \
170  -e 's,^[ ]*/usr/lib/rpm.*/brp-compress,./brp-compress,' \
171< os_install_post~ > os_install_post
172%define __os_install_post . ./os_install_post
173
174%clean
175  rm -rf $RPM_BUILD_ROOT
176
177# ==============================================================
178# powerpc-rtems4.9-gdb
179# ==============================================================
180# %package -n rtems-4.9-powerpc-rtems4.9-gdb
181# Summary:      rtems gdb for powerpc-rtems4.9
182# Group: Development/Tools
183# %if %build_infos
184# Requires: rtems-4.9-gdb-common
185# %endif
186
187%description -n rtems-4.9-powerpc-rtems4.9-gdb
188GNU gdb targetting powerpc-rtems4.9.
189
190%files -n rtems-4.9-powerpc-rtems4.9-gdb
191%defattr(-,root,root)
192%dir %{_mandir}
193%dir %{_mandir}/man1
194%{_mandir}/man1/powerpc-rtems4.9-*.1*
195
196%dir %{_bindir}
197%{_bindir}/powerpc-rtems4.9-*
198
199# ==============================================================
200# rtems-4.9-gdb-common
201# ==============================================================
202%package -n rtems-4.9-gdb-common
203Summary:      Base package for RTEMS gdbs
204Group: Development/Tools
205Requires(post):         /sbin/install-info
206Requires(preun):        /sbin/install-info
207
208%description -n rtems-4.9-gdb-common
209
210GDB files shared by all targets.
211
212%post -n rtems-4.9-gdb-common
213  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gdb.info.gz || :
214  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gdbint.info.gz || :
215  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/stabs.info.gz || :
216  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/annotate.info.gz || :
217
218%preun -n rtems-4.9-gdb-common
219if [ $1 -eq 0 ]; then
220  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gdb.info.gz || :
221  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gdbint.info.gz || :
222  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/stabs.info.gz || :
223  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/annotate.info.gz || :
224fi
225
226%files -n rtems-4.9-gdb-common
227%defattr(-,root,root)
228%dir %{_infodir}
229%ghost %{_infodir}/dir
230%{_infodir}/gdb.info*
231
232%{_infodir}/gdbint.info*
233%{_infodir}/stabs.info*
234%{_infodir}/annotate.info*
235
Note: See TracBrowser for help on using the repository browser.