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

4.104.114.95
Last change on this file since 7df9456 was 1f129d87, checked in by Ralf Corsepius <ralf.corsepius@…>, on 03/25/08 at 05:50:32

Regenerate.

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