source: rtems/contrib/crossrpms/rtems4.8/m68k/rtems-4.8-m68k-rtems4.8-gdb.spec @ 433f689

4.8
Last change on this file since 433f689 was 433f689, checked in by Ralf Corsepius <ralf.corsepius@…>, on Apr 29, 2008 at 2:50:12 PM

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.6
29%define gdb_rpmvers %{expand:%(echo 6.6 | tr - _)}
30
31Name:           rtems-4.8-m68k-rtems4.8-gdb
32Summary:        Gdb for target m68k-rtems4.8
33Group:          Development/Tools
34Version:        %{gdb_rpmvers}
35Release:        12%{?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}
73%if "%{gdb_version}" == "6.6"
74Patch0:         gdb-6.6-rtems4.8-20071216.diff
75%endif
76
77%description
78GDB for target m68k-rtems4.8
79%prep
80%setup -q -c -T -n %{name}-%{version}
81
82%setup -q -D -T -n %{name}-%{version} -a0
83cd gdb-%{gdb_version}
84%{?PATCH0:%patch0 -p1}
85cd ..
86
87%if "%{gdb_version}" >= "6.7"
88# Force using a system-provided libreadline
89rm -f gdb-%{gdb_version}/readline/configure
90%endif
91%build
92  export PATH="%{_bindir}:${PATH}"
93  mkdir -p build
94  cd build
95%if "%{_build}" != "%{_host}"
96  CFLAGS_FOR_BUILD="-g -O2 -Wall" \
97%endif
98  CFLAGS="$RPM_OPT_FLAGS" \
99  ../gdb-%{gdb_version}/configure \
100    --build=%_build --host=%_host \
101    --target=m68k-rtems4.8 \
102    --verbose --disable-nls \
103    --without-included-gettext \
104    --disable-win32-registry \
105    --disable-werror \
106    --enable-sim \
107%if "%{gdb_version}" >= "6.6"
108    --with-system-readline \
109    --with-expat \
110%endif
111    --prefix=%{_prefix} --bindir=%{_bindir} \
112    --includedir=%{_includedir} --libdir=%{_libdir} \
113    --mandir=%{_mandir} --infodir=%{_infodir}
114
115  make %{?_smp_mflags} all
116  make info
117  cd ..
118
119%install
120  export PATH="%{_bindir}:${PATH}"
121  rm -rf $RPM_BUILD_ROOT
122
123  cd build
124  make DESTDIR=$RPM_BUILD_ROOT install
125
126  rm -f $RPM_BUILD_ROOT%{_infodir}/dir
127  touch $RPM_BUILD_ROOT%{_infodir}/dir
128
129# These come from other packages
130  rm -rf $RPM_BUILD_ROOT%{_infodir}/bfd*
131  rm -rf $RPM_BUILD_ROOT%{_infodir}/configure*
132  rm -rf $RPM_BUILD_ROOT%{_infodir}/standards*
133
134# We don't ship host files
135  rm -f ${RPM_BUILD_ROOT}%{_libdir}/libiberty*
136
137# host library, installed to a bogus directory
138  rm -f ${RPM_BUILD_ROOT}%{_libdir}/libm68k-rtems4.8-sim.a
139
140  cd ..
141
142# Extract %%__os_install_post into os_install_post~
143cat << \EOF > os_install_post~
144%__os_install_post
145EOF
146
147# Generate customized brp-*scripts
148cat os_install_post~ | while read a x y; do
149case $a in
150# Prevent brp-strip* from trying to handle foreign binaries
151*/brp-strip*)
152  b=$(basename $a)
153  sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b
154  chmod a+x $b
155  ;;
156# Fix up brp-compress to handle %%_prefix != /usr
157*/brp-compress*)
158  b=$(basename $a)
159  sed -e 's,\./usr/,.%{_prefix}/,g' < $a > $b
160  chmod a+x $b
161  ;;
162esac
163done
164
165sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \
166  -e 's,^[ ]*/usr/lib/rpm.*/brp-compress,./brp-compress,' \
167< os_install_post~ > os_install_post
168%define __os_install_post . ./os_install_post
169
170%clean
171  rm -rf $RPM_BUILD_ROOT
172
173# ==============================================================
174# m68k-rtems4.8-gdb
175# ==============================================================
176# %package -n rtems-4.8-m68k-rtems4.8-gdb
177# Summary:      rtems gdb for m68k-rtems4.8
178# Group: Development/Tools
179# %if %build_infos
180# Requires: rtems-4.8-gdb-common
181# %endif
182
183%description -n rtems-4.8-m68k-rtems4.8-gdb
184GNU gdb targetting m68k-rtems4.8.
185
186%files -n rtems-4.8-m68k-rtems4.8-gdb
187%defattr(-,root,root)
188%dir %{_mandir}
189%dir %{_mandir}/man1
190%{_mandir}/man1/m68k-rtems4.8-*.1*
191
192%dir %{_bindir}
193%{_bindir}/m68k-rtems4.8-*
194
195# ==============================================================
196# rtems-4.8-gdb-common
197# ==============================================================
198%package -n rtems-4.8-gdb-common
199Summary:      Base package for RTEMS gdbs
200Group: Development/Tools
201Requires(post):         /sbin/install-info
202Requires(preun):        /sbin/install-info
203
204%description -n rtems-4.8-gdb-common
205
206GDB files shared by all targets.
207
208%post -n rtems-4.8-gdb-common
209  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gdb.info.gz || :
210  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gdbint.info.gz || :
211  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/stabs.info.gz || :
212  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/annotate.info.gz || :
213
214%preun -n rtems-4.8-gdb-common
215if [ $1 -eq 0 ]; then
216  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gdb.info.gz || :
217  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gdbint.info.gz || :
218  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/stabs.info.gz || :
219  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/annotate.info.gz || :
220fi
221
222%files -n rtems-4.8-gdb-common
223%defattr(-,root,root)
224%dir %{_infodir}
225%ghost %{_infodir}/dir
226%{_infodir}/gdb.info*
227
228%{_infodir}/gdbint.info*
229%{_infodir}/stabs.info*
230%{_infodir}/annotate.info*
231
Note: See TracBrowser for help on using the repository browser.