source: rtems/contrib/crossrpms/rtems4.8/h8300/rtems-4.8-h8300-rtems4.8-gdb.spec @ a3edc1b8

4.8
Last change on this file since a3edc1b8 was a3edc1b8, checked in by Ralf Corsepius <ralf.corsepius@…>, on 07/24/09 at 10:26:17

Regenerate.

  • Property mode set to 100644
File size: 7.6 KB
Line 
1#
2# Please send bugfixes or comments to
3#       http://www.rtems.org/bugzilla
4#
5
6%define _prefix                 /opt/rtems-4.8
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 6.6
49%define gdb_rpmvers %{expand:%(echo 6.6 | tr - _)}
50
51Name:           rtems-4.8-h8300-rtems4.8-gdb
52Summary:        Gdb for target h8300-rtems4.8
53Group:          Development/Tools
54Version:        %{gdb_rpmvers}
55Release:        15%{?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.8" == "powerpc-rtems4.8"
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.8" == "sparc-rtems4.8"
73%define build_sim --disable-sim
74%endif
75%if "h8300-rtems4.8" == "h8300-rtems4.8"
76%define build_sim --disable-sim
77%endif
78%if "%{gdb_version}" >= "6.8.50"
79%if "h8300-rtems4.8" == "m32c-rtems4.8"
80%define build_sim --disable-sim
81%endif
82%endif
83%if "h8300-rtems4.8" == "lm32-rtems4.8"
84%define build_sim --disable-sim
85%endif
86%if "h8300-rtems4.8" == "mipstx39-rtems4.8"
87%define build_sim --disable-sim
88%endif
89%endif
90
91%if "%{gdb_version}" >= "6.6"
92# suse
93%if "%{?suse}" >= "10.3"
94BuildRequires: libexpat-devel
95%else
96# Fedora/CentOS/Cygwin/MinGW
97BuildRequires: %{_host_rpmprefix}expat-devel
98%endif
99%endif
100
101%if "%{gdb_version}" < "6.7"
102%if "%{_build}" != "%{_host}"
103BuildRequires:  %{_host_rpmprefix}termcap-devel
104%endif
105%endif
106BuildRequires:  %{_host_rpmprefix}readline-devel
107BuildRequires:  %{_host_rpmprefix}ncurses-devel
108
109# Required for building the infos
110BuildRequires:  /sbin/install-info
111BuildRequires:  texinfo >= 4.2
112
113
114Requires:       rtems-4.8-gdb-common
115
116Source0:        ftp://ftp.gnu.org/pub/gnu/gdb/gdb-%{gdb_version}.tar.bz2
117%{?_without_sources:NoSource:   0}
118%if "%{gdb_version}" == "6.6"
119Patch0:         ftp://ftp.rtems.org/pub/rtems/SOURCES/4.8/gdb-6.6-rtems4.8-20090724.diff
120%endif
121%if "%{gdb_version}" == "6.8"
122Patch0:         ftp://ftp.rtems.org/pub/rtems/SOURCES/4.8/gdb-6.8-rtems4.8-20080429.diff
123%endif
124
125%description
126GDB for target h8300-rtems4.8
127%prep
128%setup -q -c -T -n %{name}-%{version}
129
130%setup -q -D -T -n %{name}-%{version} -a0
131cd gdb-%{gdb_version}
132%{?PATCH0:%patch0 -p1}
133cd ..
134
135%if "%{gdb_version}" >= "6.7"
136# Force using a system-provided libreadline
137rm -f gdb-%{gdb_version}/readline/configure
138%endif
139%build
140  export PATH="%{_bindir}:${PATH}"
141  mkdir -p build
142  cd build
143%if "%{_build}" != "%{_host}"
144  CFLAGS_FOR_BUILD="-g -O2 -Wall" \
145%endif
146  CFLAGS="$RPM_OPT_FLAGS" \
147  ../gdb-%{gdb_version}/configure \
148    --build=%_build --host=%_host \
149    --target=h8300-rtems4.8 \
150    --verbose --disable-nls \
151    --without-included-gettext \
152    --disable-win32-registry \
153    --disable-werror \
154    %{build_sim} \
155%if "%{gdb_version}" >= "6.7"
156    --with-system-readline \
157%endif
158%if "%{gdb_version}" >= "6.6"
159    --with-expat \
160%endif
161%if "%{gdb_version}" >= "6.8.50"
162    --without-python \
163%endif
164    --prefix=%{_prefix} --bindir=%{_bindir} \
165    --includedir=%{_includedir} --libdir=%{_libdir} \
166    --mandir=%{_mandir} --infodir=%{_infodir}
167
168  make %{?_smp_mflags} all
169  make info
170  cd ..
171
172%install
173  export PATH="%{_bindir}:${PATH}"
174  rm -rf $RPM_BUILD_ROOT
175
176  cd build
177  make DESTDIR=$RPM_BUILD_ROOT install
178
179  rm -f $RPM_BUILD_ROOT%{_infodir}/dir
180  touch $RPM_BUILD_ROOT%{_infodir}/dir
181
182# These come from other packages
183  rm -rf $RPM_BUILD_ROOT%{_infodir}/bfd*
184  rm -rf $RPM_BUILD_ROOT%{_infodir}/configure*
185  rm -rf $RPM_BUILD_ROOT%{_infodir}/standards*
186
187# We don't ship host files
188  rm -f ${RPM_BUILD_ROOT}%{_libdir}/libiberty*
189
190# host library, installed to a bogus directory
191  rm -f ${RPM_BUILD_ROOT}%{_libdir}/libh8300-rtems4.8-sim.a
192
193  cd ..
194
195# Extract %%__os_install_post into os_install_post~
196cat << \EOF > os_install_post~
197%__os_install_post
198EOF
199
200# Generate customized brp-*scripts
201cat os_install_post~ | while read a x y; do
202case $a in
203# Prevent brp-strip* from trying to handle foreign binaries
204*/brp-strip*)
205  b=$(basename $a)
206  sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b
207  chmod a+x $b
208  ;;
209# Fix up brp-compress to handle %%_prefix != /usr
210*/brp-compress*)
211  b=$(basename $a)
212  sed -e 's,\./usr/,.%{_prefix}/,g' < $a > $b
213  chmod a+x $b
214  ;;
215esac
216done
217
218sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \
219  -e 's,^[ ]*/usr/lib/rpm.*/brp-compress,./brp-compress,' \
220< os_install_post~ > os_install_post
221%define __os_install_post . ./os_install_post
222
223%clean
224  rm -rf $RPM_BUILD_ROOT
225
226# ==============================================================
227# h8300-rtems4.8-gdb
228# ==============================================================
229# %package -n rtems-4.8-h8300-rtems4.8-gdb
230# Summary:      rtems gdb for h8300-rtems4.8
231# Group: Development/Tools
232# %if %build_infos
233# Requires: rtems-4.8-gdb-common
234# %endif
235
236%description -n rtems-4.8-h8300-rtems4.8-gdb
237GNU gdb targetting h8300-rtems4.8.
238
239%files -n rtems-4.8-h8300-rtems4.8-gdb
240%defattr(-,root,root)
241%dir %{_mandir}
242%dir %{_mandir}/man1
243%{_mandir}/man1/h8300-rtems4.8-*.1*
244
245%dir %{_bindir}
246%{_bindir}/h8300-rtems4.8-*
247
248# ==============================================================
249# rtems-4.8-gdb-common
250# ==============================================================
251%package -n rtems-4.8-gdb-common
252Summary:      Base package for RTEMS gdbs
253Group: Development/Tools
254Requires(post):         /sbin/install-info
255Requires(preun):        /sbin/install-info
256
257%description -n rtems-4.8-gdb-common
258
259GDB files shared by all targets.
260
261%post -n rtems-4.8-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.8-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.8-gdb-common
276%defattr(-,root,root)
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.