source: rtems/contrib/crossrpms/rtems4.10/h8300/rtems-4.10-h8300-rtems4.10-gdb.spec @ b897028

4.104.115
Last change on this file since b897028 was 147257d4, checked in by Ralf Corsepius <ralf.corsepius@…>, on 01/26/09 at 07:36:15

Regenerate.

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