source: rtems/contrib/crossrpms/rtems4.8/bfin/rtems-4.8-bfin-rtems4.8-gdb.spec @ 4cf3275

4.8
Last change on this file since 4cf3275 was 433f689, checked in by Ralf Corsepius <ralf.corsepius@…>, on 04/29/08 at 14:50:12

Update gdb packaging.

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