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