source: rtems/contrib/crossrpms/rtems4.9/mipstx39/rtems-4.9-mipstx39-rtems4.9-gdb.spec @ b1f7366

4.9
Last change on this file since b1f7366 was b1f7366, checked in by Ralf Corsepius <ralf.corsepius@…>, on 07/21/09 at 06:11:40

Regenerate.

  • Property mode set to 100644
File size: 7.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.9
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.8
49%define gdb_rpmvers %{expand:%(echo 6.8 | tr - _)}
50
51Name:           rtems-4.9-mipstx39-rtems4.9-gdb
52Summary:        Gdb for target mipstx39-rtems4.9
53Group:          Development/Tools
54Version:        %{gdb_rpmvers}
55Release:        8%{?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 "mipstx39-rtems4.9" == "powerpc-rtems4.9"
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 "mipstx39-rtems4.9" == "sparc-rtems4.9"
73%define build_sim --disable-sim
74%endif
75%if "mipstx39-rtems4.9" == "h8300-rtems4.9"
76%define build_sim --disable-sim
77%endif
78%if "%{gdb_version}" >= "6.8.50"
79%if "mipstx39-rtems4.9" == "m32c-rtems4.9"
80%define build_sim --disable-sim
81%endif
82%endif
83%if "mipstx39-rtems4.9" == "lm32-rtems4.9"
84%define build_sim --disable-sim
85%endif
86%if "mipstx39-rtems4.9" == "mipstx39-rtems4.9"
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.9-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.8"
119Patch0:         ftp://ftp.rtems.org/pub/rtems/SOURCES/4.9/gdb-6.8-rtems4.9-20090721.diff
120%endif
121
122%description
123GDB for target mipstx39-rtems4.9
124%prep
125%setup -q -c -T -n %{name}-%{version}
126
127%setup -q -D -T -n %{name}-%{version} -a0
128cd gdb-%{gdb_version}
129%{?PATCH0:%patch0 -p1}
130cd ..
131
132%if "%{gdb_version}" >= "6.7"
133# Force using a system-provided libreadline
134rm -f gdb-%{gdb_version}/readline/configure
135%endif
136%build
137  export PATH="%{_bindir}:${PATH}"
138  mkdir -p build
139  cd build
140%if "%{_build}" != "%{_host}"
141  CFLAGS_FOR_BUILD="-g -O2 -Wall" \
142%endif
143  CFLAGS="$RPM_OPT_FLAGS" \
144  ../gdb-%{gdb_version}/configure \
145    --build=%_build --host=%_host \
146    --target=mipstx39-rtems4.9 \
147    --verbose --disable-nls \
148    --without-included-gettext \
149    --disable-win32-registry \
150    --disable-werror \
151    %{build_sim} \
152%if "%{gdb_version}" >= "6.7"
153    --with-system-readline \
154%endif
155%if "%{gdb_version}" >= "6.6"
156    --with-expat \
157%endif
158%if "%{gdb_version}" >= "6.8.50"
159    --without-python \
160%endif
161    --prefix=%{_prefix} --bindir=%{_bindir} \
162    --includedir=%{_includedir} --libdir=%{_libdir} \
163    --mandir=%{_mandir} --infodir=%{_infodir}
164
165  make %{?_smp_mflags} all
166  make info
167  cd ..
168
169%install
170  export PATH="%{_bindir}:${PATH}"
171  rm -rf $RPM_BUILD_ROOT
172
173  cd build
174  make DESTDIR=$RPM_BUILD_ROOT install
175
176  rm -f $RPM_BUILD_ROOT%{_infodir}/dir
177  touch $RPM_BUILD_ROOT%{_infodir}/dir
178
179# These come from other packages
180  rm -rf $RPM_BUILD_ROOT%{_infodir}/bfd*
181  rm -rf $RPM_BUILD_ROOT%{_infodir}/configure*
182  rm -rf $RPM_BUILD_ROOT%{_infodir}/standards*
183
184# We don't ship host files
185  rm -f ${RPM_BUILD_ROOT}%{_libdir}/libiberty*
186
187# host library, installed to a bogus directory
188  rm -f ${RPM_BUILD_ROOT}%{_libdir}/libmipstx39-rtems4.9-sim.a
189
190  cd ..
191
192# Extract %%__os_install_post into os_install_post~
193cat << \EOF > os_install_post~
194%__os_install_post
195EOF
196
197# Generate customized brp-*scripts
198cat os_install_post~ | while read a x y; do
199case $a in
200# Prevent brp-strip* from trying to handle foreign binaries
201*/brp-strip*)
202  b=$(basename $a)
203  sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b
204  chmod a+x $b
205  ;;
206# Fix up brp-compress to handle %%_prefix != /usr
207*/brp-compress*)
208  b=$(basename $a)
209  sed -e 's,\./usr/,.%{_prefix}/,g' < $a > $b
210  chmod a+x $b
211  ;;
212esac
213done
214
215sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \
216  -e 's,^[ ]*/usr/lib/rpm.*/brp-compress,./brp-compress,' \
217< os_install_post~ > os_install_post
218%define __os_install_post . ./os_install_post
219
220%clean
221  rm -rf $RPM_BUILD_ROOT
222
223# ==============================================================
224# mipstx39-rtems4.9-gdb
225# ==============================================================
226# %package -n rtems-4.9-mipstx39-rtems4.9-gdb
227# Summary:      rtems gdb for mipstx39-rtems4.9
228# Group: Development/Tools
229# %if %build_infos
230# Requires: rtems-4.9-gdb-common
231# %endif
232
233%description -n rtems-4.9-mipstx39-rtems4.9-gdb
234GNU gdb targetting mipstx39-rtems4.9.
235
236%files -n rtems-4.9-mipstx39-rtems4.9-gdb
237%defattr(-,root,root)
238%dir %{_mandir}
239%dir %{_mandir}/man1
240%{_mandir}/man1/mipstx39-rtems4.9-*.1*
241
242%dir %{_bindir}
243%{_bindir}/mipstx39-rtems4.9-*
244
245# ==============================================================
246# rtems-4.9-gdb-common
247# ==============================================================
248%package -n rtems-4.9-gdb-common
249Summary:      Base package for RTEMS gdbs
250Group: Development/Tools
251Requires(post):         /sbin/install-info
252Requires(preun):        /sbin/install-info
253
254%description -n rtems-4.9-gdb-common
255
256GDB files shared by all targets.
257
258%post -n rtems-4.9-gdb-common
259  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gdb.info.gz || :
260  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gdbint.info.gz || :
261  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/stabs.info.gz || :
262  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/annotate.info.gz || :
263
264%preun -n rtems-4.9-gdb-common
265if [ $1 -eq 0 ]; then
266  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gdb.info.gz || :
267  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gdbint.info.gz || :
268  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/stabs.info.gz || :
269  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/annotate.info.gz || :
270fi
271
272%files -n rtems-4.9-gdb-common
273%defattr(-,root,root)
274%dir %{_infodir}
275%ghost %{_infodir}/dir
276%{_infodir}/gdb.info*
277
278%{_infodir}/gdbint.info*
279%{_infodir}/stabs.info*
280%{_infodir}/annotate.info*
281
Note: See TracBrowser for help on using the repository browser.