source: rtems/contrib/crossrpms/rtems4.10/lm32/rtems-4.10-lm32-rtems4.10-gdb.spec @ 981a831

4.10
Last change on this file since 981a831 was 981a831, checked in by Ralf Corsepius <ralf.corsepius@…>, on Sep 19, 2011 at 10:45:55 PM

Regenerate.

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