source: rtems/contrib/crossrpms/rtems4.10/sparc/rtems-4.10-sparc-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.1 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.8
49%define gdb_rpmvers %{expand:%(echo 6.8 | tr - _)}
50
51Name:           rtems-4.10-sparc-rtems4.10-gdb
52Summary:        Gdb for target sparc-rtems4.10
53Group:          Development/Tools
54Version:        %{gdb_rpmvers}
55Release:        7%{?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 ("sparc-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 "sparc-rtems4.10" == "sparc-rtems4.10"
70%define build_sim --disable-sim
71%endif
72%if "sparc-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
107Patch0:  ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-6.8-rtems4.10-20090122.diff
108
109%description
110GDB for target sparc-rtems4.10
111%prep
112%setup -q -c -T -n %{name}-%{version}
113
114%setup -q -D -T -n %{name}-%{version} -a0
115cd gdb-%{gdb_version}
116%{?PATCH0:%patch0 -p1}
117cd ..
118
119%if "%{gdb_version}" >= "6.7"
120# Force using a system-provided libreadline
121rm -f gdb-%{gdb_version}/readline/configure
122%endif
123%build
124  export PATH="%{_bindir}:${PATH}"
125  mkdir -p build
126  cd build
127%if "%{_build}" != "%{_host}"
128  CFLAGS_FOR_BUILD="-g -O2 -Wall" \
129%endif
130  CFLAGS="$RPM_OPT_FLAGS" \
131  ../gdb-%{gdb_version}/configure \
132    --build=%_build --host=%_host \
133    --target=sparc-rtems4.10 \
134    --verbose --disable-nls \
135    --without-included-gettext \
136    --disable-win32-registry \
137    --disable-werror \
138    %{build_sim} \
139%if "%{gdb_version}" >= "6.7"
140    --with-system-readline \
141%endif
142%if "%{gdb_version}" >= "6.6"
143    --with-expat \
144%endif
145    --prefix=%{_prefix} --bindir=%{_bindir} \
146    --includedir=%{_includedir} --libdir=%{_libdir} \
147    --mandir=%{_mandir} --infodir=%{_infodir}
148
149  make %{?_smp_mflags} all
150  make info
151  cd ..
152
153%install
154  export PATH="%{_bindir}:${PATH}"
155  rm -rf $RPM_BUILD_ROOT
156
157  cd build
158  make DESTDIR=$RPM_BUILD_ROOT install
159
160  rm -f $RPM_BUILD_ROOT%{_infodir}/dir
161  touch $RPM_BUILD_ROOT%{_infodir}/dir
162
163# These come from other packages
164  rm -rf $RPM_BUILD_ROOT%{_infodir}/bfd*
165  rm -rf $RPM_BUILD_ROOT%{_infodir}/configure*
166  rm -rf $RPM_BUILD_ROOT%{_infodir}/standards*
167
168# We don't ship host files
169  rm -f ${RPM_BUILD_ROOT}%{_libdir}/libiberty*
170
171# host library, installed to a bogus directory
172  rm -f ${RPM_BUILD_ROOT}%{_libdir}/libsparc-rtems4.10-sim.a
173
174  cd ..
175
176# Extract %%__os_install_post into os_install_post~
177cat << \EOF > os_install_post~
178%__os_install_post
179EOF
180
181# Generate customized brp-*scripts
182cat os_install_post~ | while read a x y; do
183case $a in
184# Prevent brp-strip* from trying to handle foreign binaries
185*/brp-strip*)
186  b=$(basename $a)
187  sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b
188  chmod a+x $b
189  ;;
190# Fix up brp-compress to handle %%_prefix != /usr
191*/brp-compress*)
192  b=$(basename $a)
193  sed -e 's,\./usr/,.%{_prefix}/,g' < $a > $b
194  chmod a+x $b
195  ;;
196esac
197done
198
199sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \
200  -e 's,^[ ]*/usr/lib/rpm.*/brp-compress,./brp-compress,' \
201< os_install_post~ > os_install_post
202%define __os_install_post . ./os_install_post
203
204%clean
205  rm -rf $RPM_BUILD_ROOT
206
207# ==============================================================
208# sparc-rtems4.10-gdb
209# ==============================================================
210# %package -n rtems-4.10-sparc-rtems4.10-gdb
211# Summary:      rtems gdb for sparc-rtems4.10
212# Group: Development/Tools
213# %if %build_infos
214# Requires: rtems-4.10-gdb-common
215# %endif
216
217%description -n rtems-4.10-sparc-rtems4.10-gdb
218GNU gdb targetting sparc-rtems4.10.
219
220%files -n rtems-4.10-sparc-rtems4.10-gdb
221%defattr(-,root,root)
222%dir %{_mandir}
223%dir %{_mandir}/man1
224%{_mandir}/man1/sparc-rtems4.10-*.1*
225
226%dir %{_bindir}
227%{_bindir}/sparc-rtems4.10-*
228
229# ==============================================================
230# rtems-4.10-gdb-common
231# ==============================================================
232%package -n rtems-4.10-gdb-common
233Summary:      Base package for RTEMS gdbs
234Group: Development/Tools
235Requires(post):         /sbin/install-info
236Requires(preun):        /sbin/install-info
237
238%description -n rtems-4.10-gdb-common
239
240GDB files shared by all targets.
241
242%post -n rtems-4.10-gdb-common
243  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gdb.info.gz || :
244  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gdbint.info.gz || :
245  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/stabs.info.gz || :
246  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/annotate.info.gz || :
247
248%preun -n rtems-4.10-gdb-common
249if [ $1 -eq 0 ]; then
250  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gdb.info.gz || :
251  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gdbint.info.gz || :
252  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/stabs.info.gz || :
253  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/annotate.info.gz || :
254fi
255
256%files -n rtems-4.10-gdb-common
257%defattr(-,root,root)
258%dir %{_infodir}
259%ghost %{_infodir}/dir
260%{_infodir}/gdb.info*
261
262%{_infodir}/gdbint.info*
263%{_infodir}/stabs.info*
264%{_infodir}/annotate.info*
265
Note: See TracBrowser for help on using the repository browser.