source: rtems/contrib/crossrpms/rtems4.10/bfin/rtems-4.10-bfin-rtems4.10-gdb.spec @ 3b35bcc5

4.104.115
Last change on this file since 3b35bcc5 was 3b35bcc5, checked in by Ralf Corsepius <ralf.corsepius@…>, on 01/22/09 at 14:45:06

Regenerate.

  • Property mode set to 100644
File size: 7.2 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 rtems-4.10-%{_host}-
44%else
45%define _host_rpmprefix %{nil}
46%endif
47
48%define gdb_version 6.5
49%define gdb_rpmvers %{expand:%(echo 6.5 | tr - _)}
50
51Name:           rtems-4.10-bfin-rtems4.10-gdb
52Summary:        Gdb for target bfin-rtems4.10
53Group:          Development/Tools
54Version:        %{gdb_rpmvers}
55Release:        4%{?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%define build_sim --enable-sim
63# psim doesn't support Cdn-X
64%if ("bfin-rtems4.10" == "powerpc-rtems4.10") && ("%{_build}" != "%{_host}")
65%define build_sim --disable-sim
66%endif
67%ifos mingw mingw32
68# Mingw lacks functions required by the simulator
69%if "bfin-rtems4.10" == "sparc-rtems4.10"
70%define build_sim --disable-sim
71%endif
72%if "bfin-rtems4.10" == "h8300-rtems4.10"
73%define build_sim --disable-sim
74%endif
75%endif
76
77%if "%{gdb_version}" >= "6.6"
78# suse
79%if "%{?suse}"
80%if "%{?suse}" >= "10.3"
81BuildRequires: libexpat-devel
82%else
83BuildRequires: expat
84%endif
85%else
86# fedora/redhat/cygwin
87BuildRequires: %{_host_rpmprefix}expat-devel
88%endif
89%endif
90
91%if "%{gdb_version}" < "6.7"
92%if "%{_build}" != "%{_host}"
93BuildRequires:  %{_host_rpmprefix}termcap-devel
94%endif
95%endif
96BuildRequires:  %{_host_rpmprefix}readline-devel
97BuildRequires:  %{_host_rpmprefix}ncurses-devel
98
99# Required for building the infos
100BuildRequires:  /sbin/install-info
101BuildRequires:  texinfo >= 4.2
102
103
104Requires:       rtems-4.10-gdb-common
105
106Source0:        ftp://ftp.gnu.org/pub/gnu/gdb/gdb-%{gdb_version}.tar.bz2
107%{?_without_sources:NoSource:   0}
108Patch0:         ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-6.5-bfinrtems-20090122.diff
109
110%description
111GDB for target bfin-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%if "%{gdb_version}" >= "6.7"
121# Force using a system-provided libreadline
122rm -f gdb-%{gdb_version}/readline/configure
123%endif
124%build
125  export PATH="%{_bindir}:${PATH}"
126  mkdir -p build
127  cd build
128%if "%{_build}" != "%{_host}"
129  CFLAGS_FOR_BUILD="-g -O2 -Wall" \
130%endif
131  CFLAGS="$RPM_OPT_FLAGS" \
132  ../gdb-%{gdb_version}/configure \
133    --build=%_build --host=%_host \
134    --target=bfin-rtems4.10 \
135    --verbose --disable-nls \
136    --without-included-gettext \
137    --disable-win32-registry \
138    --disable-werror \
139    %{build_sim} \
140%if "%{gdb_version}" >= "6.7"
141    --with-system-readline \
142%endif
143%if "%{gdb_version}" >= "6.6"
144    --with-expat \
145%endif
146    --prefix=%{_prefix} --bindir=%{_bindir} \
147    --includedir=%{_includedir} --libdir=%{_libdir} \
148    --mandir=%{_mandir} --infodir=%{_infodir}
149
150  make %{?_smp_mflags} all
151  make info
152  cd ..
153
154%install
155  export PATH="%{_bindir}:${PATH}"
156  rm -rf $RPM_BUILD_ROOT
157
158  cd build
159  make DESTDIR=$RPM_BUILD_ROOT install
160
161  rm -f $RPM_BUILD_ROOT%{_infodir}/dir
162  touch $RPM_BUILD_ROOT%{_infodir}/dir
163
164# These come from other packages
165  rm -rf $RPM_BUILD_ROOT%{_infodir}/bfd*
166  rm -rf $RPM_BUILD_ROOT%{_infodir}/configure*
167  rm -rf $RPM_BUILD_ROOT%{_infodir}/standards*
168
169# We don't ship host files
170  rm -f ${RPM_BUILD_ROOT}%{_libdir}/libiberty*
171
172# host library, installed to a bogus directory
173  rm -f ${RPM_BUILD_ROOT}%{_libdir}/libbfin-rtems4.10-sim.a
174
175  cd ..
176
177# Extract %%__os_install_post into os_install_post~
178cat << \EOF > os_install_post~
179%__os_install_post
180EOF
181
182# Generate customized brp-*scripts
183cat os_install_post~ | while read a x y; do
184case $a in
185# Prevent brp-strip* from trying to handle foreign binaries
186*/brp-strip*)
187  b=$(basename $a)
188  sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b
189  chmod a+x $b
190  ;;
191# Fix up brp-compress to handle %%_prefix != /usr
192*/brp-compress*)
193  b=$(basename $a)
194  sed -e 's,\./usr/,.%{_prefix}/,g' < $a > $b
195  chmod a+x $b
196  ;;
197esac
198done
199
200sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \
201  -e 's,^[ ]*/usr/lib/rpm.*/brp-compress,./brp-compress,' \
202< os_install_post~ > os_install_post
203%define __os_install_post . ./os_install_post
204
205%clean
206  rm -rf $RPM_BUILD_ROOT
207
208# ==============================================================
209# bfin-rtems4.10-gdb
210# ==============================================================
211# %package -n rtems-4.10-bfin-rtems4.10-gdb
212# Summary:      rtems gdb for bfin-rtems4.10
213# Group: Development/Tools
214# %if %build_infos
215# Requires: rtems-4.10-gdb-common
216# %endif
217
218%description -n rtems-4.10-bfin-rtems4.10-gdb
219GNU gdb targetting bfin-rtems4.10.
220
221%files -n rtems-4.10-bfin-rtems4.10-gdb
222%defattr(-,root,root)
223%dir %{_mandir}
224%dir %{_mandir}/man1
225%{_mandir}/man1/bfin-rtems4.10-*.1*
226
227%dir %{_bindir}
228%{_bindir}/bfin-rtems4.10-*
229
230# ==============================================================
231# rtems-4.10-gdb-common
232# ==============================================================
233%package -n rtems-4.10-gdb-common
234Summary:      Base package for RTEMS gdbs
235Group: Development/Tools
236Requires(post):         /sbin/install-info
237Requires(preun):        /sbin/install-info
238
239%description -n rtems-4.10-gdb-common
240
241GDB files shared by all targets.
242
243%post -n rtems-4.10-gdb-common
244  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gdb.info.gz || :
245  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gdbint.info.gz || :
246  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/stabs.info.gz || :
247  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/annotate.info.gz || :
248
249%preun -n rtems-4.10-gdb-common
250if [ $1 -eq 0 ]; then
251  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gdb.info.gz || :
252  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gdbint.info.gz || :
253  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/stabs.info.gz || :
254  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/annotate.info.gz || :
255fi
256
257%files -n rtems-4.10-gdb-common
258%defattr(-,root,root)
259%dir %{_infodir}
260%ghost %{_infodir}/dir
261%{_infodir}/gdb.info*
262
263%{_infodir}/gdbint.info*
264%{_infodir}/stabs.info*
265%{_infodir}/annotate.info*
266
Note: See TracBrowser for help on using the repository browser.