source: rtems/contrib/crossrpms/rtems4.11/sparc/rtems-4.11-sparc-rtems4.11-gdb.spec @ ac620ef

4.115
Last change on this file since ac620ef was ac620ef, checked in by Ralf Corsepius <ralf.corsepius@…>, on Sep 1, 2011 at 3:55:47 AM

Regenerate.

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