source: rtems/contrib/crossrpms/rtems4.10/powerpc/rtems-4.10-powerpc-rtems4.10-gdb.spec @ fb0a7e9

4.104.11
Last change on this file since fb0a7e9 was fb0a7e9, checked in by Ralf Corsepius <ralf.corsepius@…>, on Mar 12, 2009 at 9:01:09 AM

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