source: rtems/contrib/crossrpms/rtems4.9/h8300/rtems-4.9-h8300-rtems4.9-gdb.spec @ 51aac0e

4.104.114.9
Last change on this file since 51aac0e was 51aac0e, checked in by Ralf Corsepius <ralf.corsepius@…>, on Sep 28, 2007 at 7:38:40 AM

Cleanups.

  • Property mode set to 100644
File size: 5.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.9
7%define _infodir                %{_prefix}/info
8%define _mandir                 %{_prefix}/man
9
10%ifos cygwin cygwin32 mingw mingw32
11%define _exeext .exe
12%else
13%define _exeext %{nil}
14%endif
15
16%define gdb_version 6.6
17%define gdb_rpmvers %{expand:%(echo 6.6 | tr - _)}
18
19Name:           rtems-4.9-h8300-rtems4.9-gdb
20Summary:        Gdb for target h8300-rtems4.9
21Group:          Development/Tools
22Version:        %{gdb_rpmvers}
23Release:        1%{?dist}
24License:        GPL/LGPL
25URL:            http://sources.redhat.com/gdb
26BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
27
28%if "%{gdb_version}" >= "6.6"
29%if "%{?suse}"
30BuildRequires:  expat
31%else 
32BuildRequires:  expat-devel
33%endif
34%endif
35# Required for building the infos
36BuildRequires:  /sbin/install-info
37BuildRequires:  texinfo >= 4.2
38%if "h8300-rtems4.9" == "sparc-rtems4.9"
39BuildRequires:  libtermcap-devel
40%endif
41BuildRequires:  ncurses-devel
42
43Requires:       rtems-4.9-gdb-common
44
45Source0:        ftp://ftp.gnu.org/pub/gnu/gdb/gdb-%{gdb_version}.tar.bz2
46%{?_without_sources:NoSource:   0}
47%if "%{gdb_version}" == "6.5"
48Patch0:         gdb-6.5-rtems-20060713.diff
49%endif
50%if "%{gdb_version}" == "6.6"
51Patch0:         gdb-6.6-rtems4.8-20070306.diff
52%endif
53
54%description
55GDB for target h8300-rtems4.9
56%prep
57%setup -q -c -T -n %{name}-%{version}
58
59%setup -q -D -T -n %{name}-%{version} -a0
60cd gdb-%{gdb_version}
61%{?PATCH0:%patch0 -p1}
62cd ..
63
64%build
65  mkdir -p build
66  cd build
67  CFLAGS="$RPM_OPT_FLAGS" \
68  ../gdb-%{gdb_version}/configure \
69    --build=%_build --host=%_host \
70    --target=h8300-rtems4.9 \
71    --verbose --disable-nls \
72    --without-included-gettext \
73    --disable-win32-registry \
74    --disable-werror \
75    --enable-sim \
76    --prefix=%{_prefix} --bindir=%{_bindir} \
77    --includedir=%{_includedir} --libdir=%{_libdir} \
78    --mandir=%{_mandir} --infodir=%{_infodir}
79
80  make all
81  make info
82  cd ..
83
84%install
85  rm -rf $RPM_BUILD_ROOT
86
87  cd build
88%if "%{gdb_version}" >= "6.3"
89  make DESTDIR=$RPM_BUILD_ROOT install
90%else
91  make prefix=$RPM_BUILD_ROOT%{_prefix} \
92    bindir=$RPM_BUILD_ROOT%{_bindir} \
93    includedir=$RPM_BUILD_ROOT%{_includedir} \
94    libdir=$RPM_BUILD_ROOT%{_libdir} \
95    infodir=$RPM_BUILD_ROOT%{_infodir} \
96    mandir=$RPM_BUILD_ROOT%{_mandir} \
97    install
98
99  make prefix=$RPM_BUILD_ROOT%{_prefix} \
100    bindir=$RPM_BUILD_ROOT%{_bindir} \
101    includedir=$RPM_BUILD_ROOT%{_includedir} \
102    libdir=$RPM_BUILD_ROOT%{_libdir} \
103    infodir=$RPM_BUILD_ROOT%{_infodir} \
104    mandir=$RPM_BUILD_ROOT%{_mandir} \
105    install-info
106%endif
107
108  rm -f $RPM_BUILD_ROOT%{_infodir}/dir
109  touch $RPM_BUILD_ROOT%{_infodir}/dir
110
111# These come from other packages
112  rm -rf $RPM_BUILD_ROOT%{_infodir}/bfd*
113  rm -rf $RPM_BUILD_ROOT%{_infodir}/configure*
114  rm -rf $RPM_BUILD_ROOT%{_infodir}/standards*
115
116# We don't ship host files
117  rm -f ${RPM_BUILD_ROOT}%{_libdir}/libiberty*
118
119%if "%{gdb_version}" >= "6.4"
120# host library, installed to a bogus directory
121  rm -f ${RPM_BUILD_ROOT}%{_libdir}/libh8300-rtems4.9-sim.a
122%endif
123
124  cd ..
125
126# Extract %%__os_install_post into os_install_post~
127cat << \EOF > os_install_post~
128%__os_install_post
129EOF
130
131# Generate customized brp-*scripts
132cat os_install_post~ | while read a x y; do
133case $a in
134# Prevent brp-strip* from trying to handle foreign binaries
135*/brp-strip*)
136  b=$(basename $a)
137  sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b
138  chmod a+x $b
139  ;;
140# Fix up brp-compress to handle %%_prefix != /usr
141*/brp-compress*)
142  b=$(basename $a)
143  sed -e 's,\./usr/,.%{_prefix}/,g' < $a > $b
144  chmod a+x $b
145  ;;
146esac
147done
148
149sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \
150  -e 's,^[ ]*/usr/lib/rpm.*/brp-compress,./brp-compress,' \
151< os_install_post~ > os_install_post
152%define __os_install_post . ./os_install_post
153
154%clean
155  rm -rf $RPM_BUILD_ROOT
156
157# ==============================================================
158# h8300-rtems4.9-gdb
159# ==============================================================
160# %package -n rtems-4.9-h8300-rtems4.9-gdb
161# Summary:      rtems gdb for h8300-rtems4.9
162# Group: Development/Tools
163# %if %build_infos
164# Requires: rtems-4.9-gdb-common
165# %endif
166
167%description -n rtems-4.9-h8300-rtems4.9-gdb
168
169GNU gdb targetting h8300-rtems4.9.
170
171%files -n rtems-4.9-h8300-rtems4.9-gdb
172%defattr(-,root,root)
173%dir %{_mandir}
174%dir %{_mandir}/man1
175%{_mandir}/man1/h8300-rtems4.9-*.1*
176
177%dir %{_bindir}
178%{_bindir}/h8300-rtems4.9-*
179
180# ==============================================================
181# rtems-4.9-gdb-common
182# ==============================================================
183%package -n rtems-4.9-gdb-common
184Summary:      Base package for RTEMS gdbs
185Group: Development/Tools
186Requires(post):         /sbin/install-info
187Requires(preun):        /sbin/install-info
188
189%description -n rtems-4.9-gdb-common
190
191GDB files shared by all targets.
192
193%post -n rtems-4.9-gdb-common
194  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gdb.info.gz || :
195%if "%{gdb_version}" < "6.3"
196  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/mmalloc.info.gz || :
197%endif
198  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gdbint.info.gz || :
199  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/stabs.info.gz || :
200  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/annotate.info.gz || :
201
202%preun -n rtems-4.9-gdb-common
203if [ $1 -eq 0 ]; then
204  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gdb.info.gz || :
205%if "%{gdb_version}" < "6.3"
206  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/mmalloc.info.gz || :
207%endif
208  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gdbint.info.gz || :
209  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/stabs.info.gz || :
210  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/annotate.info.gz || :
211fi
212
213%files -n rtems-4.9-gdb-common
214%defattr(-,root,root)
215%dir %{_infodir}
216%ghost %{_infodir}/dir
217%{_infodir}/gdb.info*
218
219# FIXME: When had mmalloc.info been removed?
220%if "%{gdb_version}" < "6.3"
221%{_infodir}/mmalloc.info*
222%endif
223%{_infodir}/gdbint.info*
224%{_infodir}/stabs.info*
225%{_infodir}/annotate.info*
226
Note: See TracBrowser for help on using the repository browser.