source: rtems/contrib/crossrpms/rtems4.10/m32c/rtems-4.10-m32c-rtems4.10-gdb.spec @ 78a345f6

4.104.115
Last change on this file since 78a345f6 was 54726239, checked in by Ralf Corsepius <ralf.corsepius@…>, on 10/16/08 at 03:09:18

Regenerate.

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