source: rtems/contrib/crossrpms/rtems4.10/powerpc/rtems-4.10-powerpc-rtems4.10-gdb.spec @ 0ebf210b

4.104.115
Last change on this file since 0ebf210b was 74e1fca, checked in by Ralf Corsepius <ralf.corsepius@…>, on Apr 6, 2010 at 12:03:34 PM

Regenerate.

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