source: rtems/contrib/crossrpms/rtems4.11/bfin/rtems-4.11-bfin-rtems4.11-gdb.spec @ 0423216

4.115
Last change on this file since 0423216 was 0423216, checked in by Ralf Corsepius <ralf.corsepius@…>, on 09/01/11 at 09:22:43

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