source: rtems/contrib/crossrpms/rtems4.9/bfin/rtems-4.9-bfin-rtems4.9-gdb.spec @ 430c0f6d

4.9
Last change on this file since 430c0f6d was 9589c665, checked in by Ralf Corsepius <ralf.corsepius@…>, on 09/03/08 at 22:48:11

Regenerate.

  • Property mode set to 100644
File size: 5.9 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.5
29%define gdb_rpmvers %{expand:%(echo 6.5 | tr - _)}
30
31Name:           rtems-4.9-bfin-rtems4.9-gdb
32Summary:        Gdb for target bfin-rtems4.9
33Group:          Development/Tools
34Version:        %{gdb_rpmvers}
35Release:        4%{?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.7"
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
68
69Requires:       rtems-4.9-gdb-common
70
71Source0:        ftp://ftp.gnu.org/pub/gnu/gdb/gdb-%{gdb_version}.tar.bz2
72%{?_without_sources:NoSource:   0}
73Patch0:         ftp://ftp.rtems.org/pub/rtems/SOURCES/4.9/gdb-6.5-bfinrtems-20071114.diff
74
75%description
76GDB for target bfin-rtems4.9
77%prep
78%setup -q -c -T -n %{name}-%{version}
79
80%setup -q -D -T -n %{name}-%{version} -a0
81cd gdb-%{gdb_version}
82%{?PATCH0:%patch0 -p1}
83cd ..
84
85%if "%{gdb_version}" >= "6.7"
86# Force using a system-provided libreadline
87rm -f gdb-%{gdb_version}/readline/configure
88%endif
89%build
90  export PATH="%{_bindir}:${PATH}"
91  mkdir -p build
92  cd build
93%if "%{_build}" != "%{_host}"
94  CFLAGS_FOR_BUILD="-g -O2 -Wall" \
95%endif
96  CFLAGS="$RPM_OPT_FLAGS" \
97  ../gdb-%{gdb_version}/configure \
98    --build=%_build --host=%_host \
99    --target=bfin-rtems4.9 \
100    --verbose --disable-nls \
101    --without-included-gettext \
102    --disable-win32-registry \
103    --disable-werror \
104    --enable-sim \
105%if "%{gdb_version}" >= "6.7"
106    --with-system-readline \
107%endif
108%if "%{gdb_version}" >= "6.6"
109    --with-expat \
110%endif
111    --prefix=%{_prefix} --bindir=%{_bindir} \
112    --includedir=%{_includedir} --libdir=%{_libdir} \
113    --mandir=%{_mandir} --infodir=%{_infodir}
114
115  make %{?_smp_mflags} all
116  make info
117  cd ..
118
119%install
120  export PATH="%{_bindir}:${PATH}"
121  rm -rf $RPM_BUILD_ROOT
122
123  cd build
124  make DESTDIR=$RPM_BUILD_ROOT install
125
126  rm -f $RPM_BUILD_ROOT%{_infodir}/dir
127  touch $RPM_BUILD_ROOT%{_infodir}/dir
128
129# These come from other packages
130  rm -rf $RPM_BUILD_ROOT%{_infodir}/bfd*
131  rm -rf $RPM_BUILD_ROOT%{_infodir}/configure*
132  rm -rf $RPM_BUILD_ROOT%{_infodir}/standards*
133
134# We don't ship host files
135  rm -f ${RPM_BUILD_ROOT}%{_libdir}/libiberty*
136
137# host library, installed to a bogus directory
138  rm -f ${RPM_BUILD_ROOT}%{_libdir}/libbfin-rtems4.9-sim.a
139
140  cd ..
141
142# Extract %%__os_install_post into os_install_post~
143cat << \EOF > os_install_post~
144%__os_install_post
145EOF
146
147# Generate customized brp-*scripts
148cat os_install_post~ | while read a x y; do
149case $a in
150# Prevent brp-strip* from trying to handle foreign binaries
151*/brp-strip*)
152  b=$(basename $a)
153  sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b
154  chmod a+x $b
155  ;;
156# Fix up brp-compress to handle %%_prefix != /usr
157*/brp-compress*)
158  b=$(basename $a)
159  sed -e 's,\./usr/,.%{_prefix}/,g' < $a > $b
160  chmod a+x $b
161  ;;
162esac
163done
164
165sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \
166  -e 's,^[ ]*/usr/lib/rpm.*/brp-compress,./brp-compress,' \
167< os_install_post~ > os_install_post
168%define __os_install_post . ./os_install_post
169
170%clean
171  rm -rf $RPM_BUILD_ROOT
172
173# ==============================================================
174# bfin-rtems4.9-gdb
175# ==============================================================
176# %package -n rtems-4.9-bfin-rtems4.9-gdb
177# Summary:      rtems gdb for bfin-rtems4.9
178# Group: Development/Tools
179# %if %build_infos
180# Requires: rtems-4.9-gdb-common
181# %endif
182
183%description -n rtems-4.9-bfin-rtems4.9-gdb
184GNU gdb targetting bfin-rtems4.9.
185
186%files -n rtems-4.9-bfin-rtems4.9-gdb
187%defattr(-,root,root)
188%dir %{_mandir}
189%dir %{_mandir}/man1
190%{_mandir}/man1/bfin-rtems4.9-*.1*
191
192%dir %{_bindir}
193%{_bindir}/bfin-rtems4.9-*
194
195# ==============================================================
196# rtems-4.9-gdb-common
197# ==============================================================
198%package -n rtems-4.9-gdb-common
199Summary:      Base package for RTEMS gdbs
200Group: Development/Tools
201Requires(post):         /sbin/install-info
202Requires(preun):        /sbin/install-info
203
204%description -n rtems-4.9-gdb-common
205
206GDB files shared by all targets.
207
208%post -n rtems-4.9-gdb-common
209  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gdb.info.gz || :
210  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gdbint.info.gz || :
211  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/stabs.info.gz || :
212  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/annotate.info.gz || :
213
214%preun -n rtems-4.9-gdb-common
215if [ $1 -eq 0 ]; then
216  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gdb.info.gz || :
217  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gdbint.info.gz || :
218  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/stabs.info.gz || :
219  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/annotate.info.gz || :
220fi
221
222%files -n rtems-4.9-gdb-common
223%defattr(-,root,root)
224%dir %{_infodir}
225%ghost %{_infodir}/dir
226%{_infodir}/gdb.info*
227
228%{_infodir}/gdbint.info*
229%{_infodir}/stabs.info*
230%{_infodir}/annotate.info*
231
Note: See TracBrowser for help on using the repository browser.