1 | # |
---|
2 | # Please send bugfixes or comments to |
---|
3 | # http://www.rtems.org/bugzilla |
---|
4 | # |
---|
5 | |
---|
6 | %define _prefix /opt/rtems-4.11 |
---|
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 7.3.1 |
---|
49 | %define gdb_rpmvers %{expand:%(echo 7.3.1 | tr - _)} |
---|
50 | |
---|
51 | Name: rtems-4.11-bfin-rtems4.11-gdb |
---|
52 | Summary: Gdb for target bfin-rtems4.11 |
---|
53 | Group: Development/Tools |
---|
54 | Version: %{gdb_rpmvers} |
---|
55 | Release: 1%{?dist} |
---|
56 | License: GPL/LGPL |
---|
57 | URL: http://sources.redhat.com/gdb |
---|
58 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) |
---|
59 | |
---|
60 | BuildRequires: %{_host_rpmprefix}gcc |
---|
61 | |
---|
62 | %global build_sim --enable-sim |
---|
63 | |
---|
64 | # Whether to build against system readline |
---|
65 | # Default: yes |
---|
66 | %bcond_without system_readline |
---|
67 | |
---|
68 | # Whether to build python support |
---|
69 | %if "%{_build}" != "%{_host}" |
---|
70 | # Can't build python Cdn-X |
---|
71 | %bcond_with python |
---|
72 | %else |
---|
73 | %bcond_without python |
---|
74 | %endif |
---|
75 | %{?with_python:BuildRequires: %{_host_rpmprefix}python-devel} |
---|
76 | |
---|
77 | |
---|
78 | # suse |
---|
79 | %if "%{?suse}" >= "10.3" |
---|
80 | BuildRequires: libexpat-devel |
---|
81 | %else |
---|
82 | # Fedora/CentOS/Cygwin/MinGW |
---|
83 | BuildRequires: %{_host_rpmprefix}expat-devel |
---|
84 | %endif |
---|
85 | |
---|
86 | %{?with_system_readline:BuildRequires: %{_host_rpmprefix}readline-devel} |
---|
87 | BuildRequires: %{_host_rpmprefix}ncurses-devel |
---|
88 | |
---|
89 | # Required for building the infos |
---|
90 | BuildRequires: /sbin/install-info |
---|
91 | BuildRequires: texinfo >= 4.2 |
---|
92 | Requires: rtems-4.11-gdb-common |
---|
93 | |
---|
94 | %if "%{gdb_version}" == "7.3.1" |
---|
95 | Source0: ftp://ftp.gnu.org/gnu/gdb/gdb-7.3.1.tar.bz2 |
---|
96 | Patch0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.11/gdb-7.3.1-rtems4.11-20110905.diff |
---|
97 | %endif |
---|
98 | %if "%{gdb_version}" == "7.2" |
---|
99 | Source0: ftp://ftp.gnu.org/gnu/gdb/gdb-7.2.tar.bz2 |
---|
100 | Patch0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.11/gdb-7.2-rtems4.11-20100907.diff |
---|
101 | %endif |
---|
102 | |
---|
103 | %description |
---|
104 | GDB for target bfin-rtems4.11 |
---|
105 | %prep |
---|
106 | %setup -q -c -T -n %{name}-%{version} |
---|
107 | |
---|
108 | %setup -q -D -T -n %{name}-%{version} -a0 |
---|
109 | cd gdb-%{gdb_version} |
---|
110 | %{?PATCH0:%patch0 -p1} |
---|
111 | cd .. |
---|
112 | |
---|
113 | # Force using a system-provided libreadline |
---|
114 | %{?with_system_readline:rm -f gdb-%{gdb_version}/readline/configure} |
---|
115 | %build |
---|
116 | export PATH="%{_bindir}:${PATH}" |
---|
117 | mkdir -p build |
---|
118 | cd build |
---|
119 | %if "%{_build}" != "%{_host}" |
---|
120 | CFLAGS_FOR_BUILD="-g -O2 -Wall" \ |
---|
121 | %endif |
---|
122 | CFLAGS="$RPM_OPT_FLAGS" \ |
---|
123 | ../gdb-%{gdb_version}/configure \ |
---|
124 | --build=%_build --host=%_host \ |
---|
125 | --target=bfin-rtems4.11 \ |
---|
126 | --verbose --disable-nls \ |
---|
127 | --without-included-gettext \ |
---|
128 | --disable-win32-registry \ |
---|
129 | --disable-werror \ |
---|
130 | %{build_sim} \ |
---|
131 | %{?with_system_readline:--with-system-readline} \ |
---|
132 | --with-expat \ |
---|
133 | %{?with_python:--with-python}%{!?with_python:--without-python} \ |
---|
134 | --with-gdb-datadir=%{_datadir}/bfin-rtems4.11-gdb \ |
---|
135 | --prefix=%{_prefix} --bindir=%{_bindir} \ |
---|
136 | --includedir=%{_includedir} --libdir=%{_libdir} \ |
---|
137 | --mandir=%{_mandir} --infodir=%{_infodir} |
---|
138 | |
---|
139 | make %{?_smp_mflags} all |
---|
140 | make info |
---|
141 | cd .. |
---|
142 | |
---|
143 | %install |
---|
144 | export PATH="%{_bindir}:${PATH}" |
---|
145 | rm -rf $RPM_BUILD_ROOT |
---|
146 | |
---|
147 | cd build |
---|
148 | make DESTDIR=$RPM_BUILD_ROOT install |
---|
149 | |
---|
150 | rm -f $RPM_BUILD_ROOT%{_infodir}/dir |
---|
151 | touch $RPM_BUILD_ROOT%{_infodir}/dir |
---|
152 | |
---|
153 | # These come from other packages |
---|
154 | rm -rf $RPM_BUILD_ROOT%{_infodir}/bfd* |
---|
155 | rm -rf $RPM_BUILD_ROOT%{_infodir}/configure* |
---|
156 | rm -rf $RPM_BUILD_ROOT%{_infodir}/standards* |
---|
157 | |
---|
158 | # We don't ship host files |
---|
159 | rm -f ${RPM_BUILD_ROOT}%{_libdir}/libiberty* |
---|
160 | |
---|
161 | # host library, installed to a bogus directory |
---|
162 | rm -f ${RPM_BUILD_ROOT}%{_libdir}/libbfin-rtems4.11-sim.a |
---|
163 | |
---|
164 | # Bug in gdb-7.0, bogusly installs linux-only files |
---|
165 | somethinguseful=0 |
---|
166 | for f in ${RPM_BUILD_ROOT}%{_datadir}/bfin-rtems4.11-gdb/syscalls/*.xml; do |
---|
167 | case $f in |
---|
168 | *linux.xml) rm -f $f;; |
---|
169 | *.xml) somethinguseful=1;; |
---|
170 | esac |
---|
171 | done |
---|
172 | if test $somethinguseful -eq 0; then |
---|
173 | rm -rf "${RPM_BUILD_ROOT}%{_datadir}/bfin-rtems4.11-gdb/syscalls" |
---|
174 | fi |
---|
175 | |
---|
176 | %if "{gdb_version}" >= "7.3" |
---|
177 | %if ! %{with python} |
---|
178 | # gdb-7.3 doesn't honor --without-python correctly |
---|
179 | rm -rf ${RPM_BUILD_ROOT}%{_datadir}/bfin-rtems4.11-gdb/python |
---|
180 | %endif |
---|
181 | %endif |
---|
182 | cd .. |
---|
183 | |
---|
184 | # Extract %%__os_install_post into os_install_post~ |
---|
185 | cat << \EOF > os_install_post~ |
---|
186 | %__os_install_post |
---|
187 | EOF |
---|
188 | |
---|
189 | # Generate customized brp-*scripts |
---|
190 | cat os_install_post~ | while read a x y; do |
---|
191 | case $a in |
---|
192 | # Prevent brp-strip* from trying to handle foreign binaries |
---|
193 | */brp-strip*) |
---|
194 | b=$(basename $a) |
---|
195 | sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b |
---|
196 | chmod a+x $b |
---|
197 | ;; |
---|
198 | # Fix up brp-compress to handle %%_prefix != /usr |
---|
199 | */brp-compress*) |
---|
200 | b=$(basename $a) |
---|
201 | sed -e 's,\./usr/,.%{_prefix}/,g' < $a > $b |
---|
202 | chmod a+x $b |
---|
203 | ;; |
---|
204 | esac |
---|
205 | done |
---|
206 | |
---|
207 | sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \ |
---|
208 | -e 's,^[ ]*/usr/lib/rpm.*/brp-compress,./brp-compress,' \ |
---|
209 | < os_install_post~ > os_install_post |
---|
210 | %define __os_install_post . ./os_install_post |
---|
211 | |
---|
212 | %clean |
---|
213 | rm -rf $RPM_BUILD_ROOT |
---|
214 | |
---|
215 | # ============================================================== |
---|
216 | # bfin-rtems4.11-gdb |
---|
217 | # ============================================================== |
---|
218 | # %package -n rtems-4.11-bfin-rtems4.11-gdb |
---|
219 | # Summary: rtems gdb for bfin-rtems4.11 |
---|
220 | # Group: Development/Tools |
---|
221 | # %if %build_infos |
---|
222 | # Requires: rtems-4.11-gdb-common |
---|
223 | # %endif |
---|
224 | |
---|
225 | %description -n rtems-4.11-bfin-rtems4.11-gdb |
---|
226 | GNU gdb targetting bfin-rtems4.11. |
---|
227 | |
---|
228 | %files -n rtems-4.11-bfin-rtems4.11-gdb |
---|
229 | %defattr(-,root,root) |
---|
230 | %dir %{_prefix} |
---|
231 | %dir %{_prefix}/share |
---|
232 | %{?with_python:%{_datadir}/bfin-rtems4.11-gdb} |
---|
233 | |
---|
234 | %dir %{_mandir} |
---|
235 | %dir %{_mandir}/man1 |
---|
236 | %{_mandir}/man1/bfin-rtems4.11-*.1* |
---|
237 | |
---|
238 | %dir %{_bindir} |
---|
239 | %{_bindir}/bfin-rtems4.11-* |
---|
240 | |
---|
241 | # ============================================================== |
---|
242 | # rtems-4.11-gdb-common |
---|
243 | # ============================================================== |
---|
244 | %package -n rtems-4.11-gdb-common |
---|
245 | Summary: Base package for RTEMS gdbs |
---|
246 | Group: Development/Tools |
---|
247 | Requires(post): /sbin/install-info |
---|
248 | Requires(preun): /sbin/install-info |
---|
249 | %{?_with_noarch_subpackages:BuildArch: noarch} |
---|
250 | |
---|
251 | %description -n rtems-4.11-gdb-common |
---|
252 | |
---|
253 | GDB files shared by all targets. |
---|
254 | |
---|
255 | %post -n rtems-4.11-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.11-gdb-common |
---|
262 | if [ $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 || : |
---|
267 | fi |
---|
268 | |
---|
269 | %files -n rtems-4.11-gdb-common |
---|
270 | %defattr(-,root,root) |
---|
271 | %dir %{_prefix} |
---|
272 | %dir %{_prefix}/share |
---|
273 | |
---|
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 | |
---|