]> git.pld-linux.org Git - packages/gdb.git/blob - gdb.spec
rebuild with python 3.10
[packages/gdb.git] / gdb.spec
1 # NOTE: -lib package is used by fpc.spec
2
3 # TODO
4 # - rpm5 librpm support (gdb/configure.ac checks for 4.x or so)
5 # - change install msg to poldek in buildid-locate-rpm-pld.patch when poldek allows it. LP#493922
6 # - reenable guile after https://sourceware.org/bugzilla/show_bug.cgi?id=21104 is fixed
7 #
8 # Conditional build:
9 %bcond_with     guile           # Guile embedded scripting
10 %bcond_without  python          # build without python support
11
12 Summary:        A GNU source-level debugger for C, C++ and Fortran
13 Summary(de.UTF-8):      Symbolischer Debugger für C und andere Sprachen
14 Summary(es.UTF-8):      Depurador de programas C y otras lenguajes
15 Summary(fr.UTF-8):      Débugger symbolique pour C et d'autres langages
16 Summary(pl.UTF-8):      Symboliczny odpluskwiacz dla C i innych języków
17 Summary(pt_BR.UTF-8):   Depurador de programas C e outras linguagens
18 Summary(ru.UTF-8):      Символический отладчик для C и других языков
19 Summary(tr.UTF-8):      C ve diğer diller için sembolik hata ayıklayıcı
20 Summary(uk.UTF-8):      Символьний відладчик для С та інших мов
21 Summary(zh_CN.UTF-8):   [开发]C和其他语言的调试器
22 Summary(zh_TW.UTF-8):   [.-A開發]C和.$)B其.-A他語.$)B言的調試器
23 Name:           gdb
24 Version:        11.2
25 Release:        2
26 License:        GPL v3+
27 Group:          Development/Debuggers
28 Source0:        https://ftp.gnu.org/gnu/gdb/%{name}-%{version}.tar.xz
29 # Source0-md5:  433bd0904caa31c247b1b1867f2f911d
30 Source1:        http://www.mif.pg.gda.pl/homepages/ankry/man-PLD/%{name}-non-english-man-pages.tar.bz2
31 # Source1-md5:  2e8a48939ae282c12bbacdd54e398247
32 Source3:        %{name}-gstack.man
33 Patch1:         x32.patch
34 Patch100:       gdb-6.6-buildid-locate.patch
35 Patch101:       gdb-6.6-buildid-locate-solib-missing-ids.patch
36 Patch102:       gdb-6.6-buildid-locate-rpm.patch
37 Patch104:       gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
38 Patch105:       gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch
39 Patch106:       gdb-6.6-buildid-locate-rpm-scl.patch
40 Patch110:       gdb-6.3-gstack-20050411.patch
41
42 Patch114:       gdb-vla-intel-stringbt-fix.patch
43 Patch115:       gdb-vla-intel-tests.patch
44 Patch1000:      %{name}-readline.patch
45 Patch1001:      %{name}-info.patch
46 Patch1002:      %{name}-passflags.patch
47 Patch1005:      %{name}-pretty-print-by-default.patch
48 Patch1006:      buildid-locate-rpm-pld.patch
49 URL:            http://www.gnu.org/software/gdb/
50 BuildRequires:  autoconf >= 2.69
51 BuildRequires:  automake
52 BuildRequires:  bison
53 BuildRequires:  babeltrace-devel >= 1.1.0
54 BuildRequires:  expat-devel
55 BuildRequires:  flex >= 2.6.4
56 BuildRequires:  gettext-tools >= 0.12.1
57 BuildRequires:  gmp-devel
58 %if %{with guile}
59 BuildRequires:  guile-devel >= 2.0
60 BuildRequires:  guile-devel < 3.2
61 %endif
62 %ifarch %{ix86} %{x8664}
63 BuildRequires:  libipt-devel
64 %endif
65 BuildRequires:  libmpc-devel
66 BuildRequires:  libselinux-devel
67 BuildRequires:  libstdc++-devel >= 6:4.8
68 BuildRequires:  libtool
69 BuildRequires:  make >= 3.81
70 BuildRequires:  mpfr-devel
71 BuildRequires:  ncurses-devel >= 5.2
72 BuildRequires:  pkgconfig
73 BuildRequires:  readline-devel
74 BuildRequires:  rpmbuild(macros) >= 1.219
75 BuildRequires:  source-highlight-devel >= 3.0
76 BuildRequires:  tar >= 1:1.22
77 BuildRequires:  texinfo >= 4.4
78 BuildRequires:  xxHash-devel
79 BuildRequires:  xz
80 BuildRequires:  xz-devel
81 BuildRequires:  zlib-devel
82 %if %{with python}
83 BuildRequires:  python3-devel
84 BuildRequires:  rpm-pythonprov
85 Obsoletes:      python-gdb < 7.3
86 # for traceback module
87 Requires:       python3-modules
88 %endif
89 %{?with_guile:Requires: guile >= 2.0.12}
90 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
91
92 %define         autoconf_ver    %(rpm -q --qf='%%{VERSION}' autoconf)
93
94 %description
95 Gdb is a full featured, command driven debugger. Gdb allows you to
96 trace the execution of programs and examine their internal state at
97 any time. Gdb works for C and C++ compiled with the GNU C compiler
98 gcc.
99
100 %description -l de.UTF-8
101 dem Sie die Ausführung von Programmen verfolgen und jederzeit den
102 inneren Zustand überprüfen können. Er funktioniert für C und mit GNU C
103 kompiliertes C++.
104
105 %description -l es.UTF-8
106 Este es un debugger orientado a comandos repleto de características.
107 Te permite rastrear la ejecución de programas y examinar su estado
108 interno a cualquier momento. Funciona para C y C++ compilado con el
109 compilador GNU C.
110
111 %description -l fr.UTF-8
112 Débugger complet, piloté par commandes. Permet de tracer l'exécution
113 des programmes et d'examiner à tout moment leur état interne.
114 Fonctionne avec les binaires C et C++ compilés avec le compilateur C
115 de GNU, gcc.
116
117 %description -l pl.UTF-8
118 Gdb jest rozbudowanym odpluskwiaczem (debuggerem), pozwalającym
119 śledzić wykonywanie programu i badać jego stan wewnętrzny. Gdb
120 umożliwia odpluskwianie programów napisanych w C/C++ i skompilowanych
121 przy pomocy kompilatora GNU (gcc).
122
123 %description -l pt_BR.UTF-8
124 Este é um debugger orientado a comandos repleto de características.
125 Ele permite à você rastrear a execução de programas e examinar o seu
126 estado interno a qualquer momento. Ele funciona para para C e C++
127 compilado com o compilador GNU C.
128
129 %description -l ru.UTF-8
130 Это полноценный отладчик, управляемый командами. Он позволяет
131 трассировать исполнение программ и изучать их внутреннее состояние в
132 любой момент времени. Работает с программами на C и C++,
133 скомпилированными GNU компилятором C (gcc, egcs, pgcc).
134
135 %description -l tr.UTF-8
136 Bir komut arayüzü üzerinden programcıya programını adım adım izleme
137 (trace) ve herhangi bir anda programın durumunu inceleme olanağı
138 verir.
139
140 %description -l uk.UTF-8
141 Це повноцінний відладчик, що керується командами. Він дозволяє
142 трасувати виконання програм та вивчати їх внутрішній стан в довільний
143 момент часу. Працює з програмами на C та C++, зкомпільованими
144 компіляторами GNU C (gcc, egcs, pgcc).
145
146 %package gdbserver
147 Summary:        A standalone server for GDB (the GNU source-level debugger)
148 Summary(pl.UTF-8):      Samodzielny serwer GDB (debuggera GNU)
149 Group:          Development/Debuggers
150
151 %description gdbserver
152 GDB, the GNU debugger, allows you to debug programs written in C, C++,
153 Java, and other languages, by executing them in a controlled fashion
154 and printing their data.
155
156 This package provides a program that allows you to run GDB on a
157 different machine than the one which is running the program being
158 debugged.
159
160 %description gdbserver -l pl.UTF-8
161 GDB (GNU debugger) pozwala śledzić programy napisane w C, C++, Javie i
162 innych językach programowania poprzez wykonywanie ich w sposób
163 kontrolowany oraz wypisywanie ich danych.
164
165 Ten pakiet zawiera program pozwalający uruchamiać GDB na innej
166 maszynie niż ta, na której działa śledzony program.
167
168 %package lib
169 Summary:        GDB in the form of a static library
170 Summary(pl.UTF-8):      GDB w postaci biblioteki statycznej
171 Group:          Development/Debuggers
172 # libraries that needs to be linked to fulfill libgdb.a symbol requirements
173 Requires:       binutils-devel >= 2.17.50
174 Requires:       expat-devel
175 Requires:       libselinux-devel
176 Requires:       libsepol-devel
177 Requires:       ncurses-devel
178 Requires:       python3-devel
179 Requires:       readline-devel
180 Requires:       xz-devel
181 Requires:       zlib-devel
182
183 %description lib
184 GDB in the form of a static library.
185
186 %description lib -l pl.UTF-8
187 GDB w postaci biblioteki statycznej.
188
189 %prep
190 %setup -q
191
192 # Files have `# <number> <file>' statements breaking VPATH / find-debuginfo.sh .
193 %{__rm} gdb/ada-exp.c gdb/ada-lex.c gdb/c-exp.c gdb/cp-name-parser.c gdb/f-exp.c
194 %{__rm} gdb/m2-exp.c gdb/p-exp.c
195
196 %patch1 -p1
197 %patch100 -p1
198 %patch101 -p1
199 %patch102 -p1
200 %patch104 -p1
201 %patch105 -p1
202 %patch106 -p1
203 %patch110 -p1
204
205 %patch114 -p1
206 %patch115 -p1
207
208 %patch1000 -p1
209 %patch1001 -p1
210 %patch1002 -p1
211 %patch1005 -p1
212 %patch1006 -p1
213
214 # Change the version that gets printed at GDB startup, so it is PLD Linux specific.
215 cat > gdb/version.in << EOF
216 %{version}-%{release} (PLD Linux)
217 EOF
218
219 sed -E -i -e '1s,#!\s*/usr/bin/env\s+python2(\s|$),#!%{__python}\1,' -e '1s,#!\s*/usr/bin/env\s+python(\s|$),#!%{__python3}\1,' -e '1s,#!\s*/usr/bin/python(\s|$),#!%{__python3}\1,' \
220       contrib/dg-extract-results.py \
221       gdb/contrib/test_pubnames_and_indexes.py \
222       gdb/testsuite/analyze-racy-logs.py \
223       gdb/testsuite/print-ts.py
224
225 sed -E -i -e '1s,#!\s*/usr/bin/env\s+python3(\s|$),#!%{__python3}\1,' \
226       gdb/copyright.py
227
228 sed -E -i -e '1s,#!\s*/usr/bin/env\s+(.*),#!%{__bindir}\1,' \
229       gdb/contrib/cc-with-tweaks.sh \
230       gdb/gcore \
231       gdb/gcore.in \
232       src-release.sh
233
234 sed -i -e 's/\[2\.69\]/[%{autoconf_ver}]/' config/override.m4
235
236 %build
237 # omit hand-written gdb/testsuite aclocal.m4
238 for dir in gdb gdbserver ; do
239         olddir=$(pwd)
240         cd $dir
241         %{__rm} aclocal.m4
242         %{__aclocal} $(grep '^ACLOCAL_AMFLAGS' Makefile.in | sed -e 's/.*=//')
243         cd $olddir
244 done
245 for dir in $(find gdb -name 'configure.in' -o -name 'configure.ac'); do
246         dir=$(dirname "$dir")
247         olddir=$(pwd)
248         cd $dir
249         %{__autoconf}
250         grep -q AC_CONFIG_HEADER configure.* && %{__autoheader}
251         cd $olddir
252 done
253 cp -f /usr/share/automake/config.* .
254 install -d build && cd build
255 # don't --enable-shared here, there would be libs version mismatch with binutils
256 ../%configure \
257         --disable-gdbtk \
258         --disable-shared \
259         --disable-silent-rules \
260         --enable-gdbcli \
261         --enable-gdbmi \
262         --enable-multi-ice \
263         --enable-netrom \
264         --enable-nls \
265         --enable-tui \
266         --with-cpu=%{_target_cpu} \
267         --with-gdb-datadir=%{_datadir}/gdb \
268         --with-guile%{!?with_guile:=no} \
269 %ifnarch alpha
270         --with-mmalloc \
271 %endif
272 %if %{with python}
273         --with-python="%{__python3}" \
274         --with-pythondir=%{py3_sitescriptdir} \
275 %else
276         --without-python \
277 %endif
278         --with-separate-debug-dir=/usr/lib/debug \
279         --with-system-readline \
280         --without-included-gettext \
281         --without-included-regex \
282         --without-x
283
284 # V=1 because only some subdirs honour --enable-silent-rules
285 %{__make} \
286         V=1
287
288 %{__make} -j1 info
289
290 # gdb/ChangeLog: Build gdb directly from *.o files not using libgdb.a.
291 %{__make} -C gdb libgdb.a \
292         V=1
293
294 %install
295 rm -rf $RPM_BUILD_ROOT
296 install -d $RPM_BUILD_ROOT%{_infodir}
297
298 %{__make} -C build -j1 install install-info \
299         DESTDIR=$RPM_BUILD_ROOT
300
301 cp -a build/gdb/libgdb.a $RPM_BUILD_ROOT%{_libdir}
302
303 # gdbtui seems all identical to gdb except when invoked as gdbtui, ncurses
304 # window is created too.
305 echo ".so gdb.1" > $RPM_BUILD_ROOT%{_mandir}/man1/gdbtui.1
306 ln -f $RPM_BUILD_ROOT%{_bindir}/{gdb,gdbtui}
307
308 bzip2 -dc %{SOURCE1} | tar xf - -C $RPM_BUILD_ROOT%{_mandir}
309 %{__rm} $RPM_BUILD_ROOT%{_mandir}/README.gdb-non-english-man-pages
310
311 rm -f $RPM_BUILD_ROOT%{_infodir}/dir
312
313 %if %{with python}
314 # Temporarily now:
315 for LIB in lib lib64 libx32; do
316         LIBPATH="$RPM_BUILD_ROOT%{_datadir}/gdb/auto-load%{_prefix}/$LIB"
317         install -d $LIBPATH
318 done
319
320 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitescriptdir}
321 %py3_comp $RPM_BUILD_ROOT%{py3_sitescriptdir}
322 %endif
323
324 cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_mandir}/man1/gstack.1
325
326 cp -p build/libdecnumber/libdecnumber.a $RPM_BUILD_ROOT%{_libdir}
327
328 # Remove the files that are part of a gdb build but that are owned and provided by other packages.
329 # These are part of binutils:
330 %{__rm} $RPM_BUILD_ROOT%{_localedir}/*/LC_MESSAGES/{bfd,opcodes}.mo
331 %{__rm} $RPM_BUILD_ROOT%{_infodir}/bfd.info*
332 %{__rm} $RPM_BUILD_ROOT%{_includedir}/{ansidecl,bfd,bfdlink,ctf,ctf-api,diagnostics,dis-asm,symcat,plugin-api}.h
333 %{__rm} $RPM_BUILD_ROOT%{_libdir}/lib{bfd,ctf,ctf-nobfd,opcodes}.la
334 %{__rm} $RPM_BUILD_ROOT%{_libdir}/lib{bfd,ctf,ctf-nobfd,opcodes}.a
335
336 %clean
337 rm -rf $RPM_BUILD_ROOT
338
339 %post   -p /sbin/postshell
340 -/usr/sbin/fix-info-dir -c %{_infodir}
341
342 %postun -p /sbin/postshell
343 -/usr/sbin/fix-info-dir -c %{_infodir}
344
345 %files
346 %defattr(644,root,root,755)
347 %doc gdb/{ChangeLog,NEWS,PROBLEMS,README}
348 %attr(755,root,root) %{_bindir}/gdb
349 %attr(755,root,root) %{_bindir}/gdbtui
350 %attr(755,root,root) %{_bindir}/gdb-add-index
351 %attr(755,root,root) %{_bindir}/gstack
352 %attr(755,root,root) %{_bindir}/gcore
353 %dir %{_datadir}/gdb
354 %dir %{_datadir}/gdb/auto-load
355 %dir %{_datadir}/gdb/auto-load%{_prefix}
356 %dir %{_datadir}/gdb/auto-load%{_prefix}/lib
357 %ifarch %{x8664} x32
358 %dir %{_datadir}/gdb/auto-load%{_prefix}/lib64
359 %dir %{_datadir}/gdb/auto-load%{_prefix}/libx32
360 %endif
361 %ifarch aarch64
362 %dir %{_datadir}/gdb/auto-load%{_prefix}/lib64
363 %endif
364 %{?with_guile:%{_datadir}/gdb/guile}
365 %{_datadir}/gdb/syscalls
366 %{_datadir}/gdb/system-gdbinit
367 %{_datadir}/gdb/python
368 %{_mandir}/man1/gdb.1*
369 %{_mandir}/man1/gdbtui.1*
370 %{_mandir}/man1/gdb-add-index.1*
371 %{_mandir}/man1/gstack.1*
372 %{_mandir}/man1/gcore.1*
373 %{_mandir}/man5/gdbinit.5*
374 %lang(es) %{_mandir}/es/man1/*
375 %lang(fr) %{_mandir}/fr/man1/*
376 %lang(hu) %{_mandir}/hu/man1/*
377 %lang(ja) %{_mandir}/ja/man1/*
378 %lang(pl) %{_mandir}/pl/man1/*
379 %{_infodir}/annotate.info*
380 %{_infodir}/gdb.info*
381 %{_infodir}/stabs.info*
382
383 %files gdbserver
384 %defattr(644,root,root,755)
385 %attr(755,root,root) %{_bindir}/gdbserver
386 %{_mandir}/man1/gdbserver.1*
387 %ifnarch %{arm}
388 %attr(755,root,root) %{_libdir}/libinproctrace.so
389 %endif
390
391 %files lib
392 %defattr(644,root,root,755)
393 %{_libdir}/libdecnumber.a
394 %{_libdir}/libgdb.a
395 %{_includedir}/gdb
396 # -devel?
397 %{_includedir}/sim
This page took 0.11114 seconds and 4 git commands to generate.