2 # - Do not remove -lib package, it is required by FPC
5 # - change install msg to poldek in buildid-locate-rpm-pld.patch when poldek allows it. LP#493922
8 %bcond_without python # build without python support
10 Summary: A GNU source-level debugger for C, C++ and Fortran
11 Summary(de.UTF-8): Symbolischer Debugger für C und andere Sprachen
12 Summary(es.UTF-8): Depurador de programas C y otras lenguajes
13 Summary(fr.UTF-8): Débugger symbolique pour C et d'autres langages
14 Summary(pl.UTF-8): Symboliczny odpluskwiacz dla C i innych języków
15 Summary(pt_BR.UTF-8): Depurador de programas C e outras linguagens
16 Summary(ru.UTF-8): Символический отладчик для C и других языков
17 Summary(tr.UTF-8): C ve diğer diller için sembolik hata ayıklayıcı
18 Summary(uk.UTF-8): Символьний відладчик для С та інших мов
19 Summary(zh_CN.UTF-8): [开发]C和其他语言的调试器
20 Summary(zh_TW.UTF-8): [.-A開發]C和.$)B其.-A他語.$)B言的調試器
25 Group: Development/Debuggers
26 Source0: http://ftp.gnu.org/gnu/gdb/%{name}-%{version}.tar.bz2
27 # Source0-md5: 64260e6c56979ee750a01055f16091a5
28 Source1: http://www.mif.pg.gda.pl/homepages/ankry/man-PLD/%{name}-non-english-man-pages.tar.bz2
29 # Source1-md5: 2e8a48939ae282c12bbacdd54e398247
30 Source3: %{name}-gstack.man
32 # FEDORA -- use the same numbering that they do
33 # don't ever modify these patches, apply secondary patch to alter it pld way
34 # use:'<,'>!grep -vE '^(\#|$)' in vim to filterout comments, spaces
36 Patch1: %{name}-6.3-rh-dummykfail-20041202.patch
37 Patch2: %{name}-6.3-rh-testversion-20041202.patch
38 Patch3: %{name}-6.3-rh-testlibunwind-20041202.patch
39 Patch104: %{name}-6.3-ppcdotsolib-20041022.patch
40 Patch105: %{name}-6.3-ppc64syscall-20040622.patch
41 Patch106: %{name}-6.3-framepczero-20040927.patch
42 Patch111: %{name}-6.3-ppc64displaysymbol-20041124.patch
43 Patch112: %{name}-6.6-scheduler_locking-step-sw-watchpoints2.patch
44 Patch260: %{name}-6.6-scheduler_locking-step-is-default.patch
45 Patch118: %{name}-6.3-gstack-20050411.patch
46 Patch122: %{name}-6.3-test-pie-20050107.patch
47 Patch389: %{name}-archer-pie-addons.patch
48 Patch394: %{name}-archer-pie-addons-keep-disabled.patch
49 Patch125: %{name}-6.3-test-self-20050110.patch
50 Patch133: %{name}-6.3-test-dtorfix-20050121.patch
51 Patch136: %{name}-6.3-test-movedir-20050125.patch
52 Patch140: %{name}-6.3-gcore-thread-20050204.patch
53 Patch141: %{name}-6.6-step-thread-exit.patch
54 Patch259: %{name}-6.3-step-thread-exit-20050211-test.patch
55 Patch142: %{name}-6.3-terminal-fix-20050214.patch
56 Patch145: %{name}-6.3-threaded-watchpoints2-20050225.patch
57 Patch148: %{name}-6.3-inheritance-20050324.patch
58 Patch153: %{name}-6.3-ia64-gcore-page0-20050421.patch
59 Patch157: %{name}-6.3-security-errata-20050610.patch
60 Patch158: %{name}-6.3-ia64-sigtramp-frame-20050708.patch
61 Patch160: %{name}-6.3-ia64-gcore-speedup-20050714.patch
62 Patch161: %{name}-6.3-inferior-notification-20050721.patch
63 Patch162: %{name}-6.3-ia64-info-frame-fix-20050725.patch
64 Patch163: %{name}-6.3-inheritancetest-20050726.patch
65 Patch164: %{name}-6.3-readnever-20050907.patch
66 Patch169: %{name}-6.3-ia64-sigill-20051115.patch
67 Patch170: %{name}-6.3-bt-past-zero-20051201.patch
68 Patch176: %{name}-6.3-large-core-20051206.patch
69 Patch188: %{name}-6.5-bz203661-emit-relocs.patch
70 Patch190: %{name}-6.5-dwarf-stack-overflow.patch
71 Patch194: %{name}-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch
72 Patch196: %{name}-6.5-sharedlibrary-path.patch
73 Patch199: %{name}-6.5-bz190810-gdbserver-arch-advice.patch
74 Patch211: %{name}-6.5-last-address-space-byte-test.patch
75 Patch208: %{name}-6.5-BEA-testsuite.patch
76 Patch209: %{name}-6.5-readline-long-line-crash.patch
77 Patch213: %{name}-6.5-readline-long-line-crash-test.patch
78 Patch214: %{name}-6.5-bz216711-clone-is-outermost.patch
79 Patch216: %{name}-6.5-bz218379-ppc-solib-trampoline-test.patch
80 Patch217: %{name}-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch
81 Patch225: %{name}-6.5-bz109921-DW_AT_decl_file-test.patch
82 Patch229: %{name}-6.3-bz140532-ppc-unwinding-test.patch
83 Patch231: %{name}-6.3-bz202689-exec-from-pthread-test.patch
84 Patch232: %{name}-upstream.patch
85 Patch234: %{name}-6.6-bz230000-power6-disassembly-test.patch
86 Patch235: %{name}-6.3-bz231832-obstack-2gb.patch
87 Patch241: %{name}-6.6-bz225783-gdb-debuginfo-paths.patch
88 Patch245: %{name}-6.6-bz229517-gcore-without-terminal.patch
89 Patch247: %{name}-6.6-bz235197-fork-detach-info.patch
90 Patch254: %{name}-6.6-testsuite-timeouts.patch
91 Patch258: %{name}-6.6-bz237572-ppc-atomic-sequence-test.patch
92 Patch261: %{name}-6.6-readline-system.patch
93 Patch263: %{name}-6.3-attach-see-vdso-test.patch
94 Patch265: %{name}-6.6-bz247354-leader-exit-fix.patch
95 Patch266: %{name}-6.6-bz247354-leader-exit-test.patch
96 Patch271: %{name}-6.5-bz243845-stale-testing-zombie-test.patch
97 Patch274: %{name}-6.6-buildid-locate.patch
98 Patch353: %{name}-6.6-buildid-locate-rpm.patch
99 Patch415: %{name}-6.6-buildid-locate-core-as-arg.patch
100 Patch282: %{name}-6.7-charsign-test.patch
101 Patch284: %{name}-6.7-ppc-clobbered-registers-O2-test.patch
102 Patch287: %{name}-6.7-testsuite-stable-results.patch
103 Patch289: %{name}-6.5-ia64-libunwind-leak-test.patch
104 Patch290: %{name}-6.5-missed-trap-on-step-test.patch
105 Patch293: %{name}-6.7-bz426600-DW_TAG_interface_type-fix.patch
106 Patch294: %{name}-6.7-bz426600-DW_TAG_interface_type-test.patch
107 Patch296: %{name}-6.5-gcore-buffer-limit-test.patch
108 Patch298: %{name}-6.6-threads-static-test.patch
109 Patch304: %{name}-6.7-kernel-headers-compat.patch
110 Patch309: %{name}-6.3-mapping-zero-inode-test.patch
111 Patch311: %{name}-6.3-focus-cmd-prev-test.patch
112 Patch315: %{name}-6.8-bz442765-threaded-exec-test.patch
113 Patch317: %{name}-6.8-sparc64-silence-memcpy-check.patch
114 Patch318: %{name}-6.8-gcc35998-ada-memory-trash.patch
115 Patch320: %{name}-6.5-section-num-fixup-test.patch
116 Patch324: %{name}-6.8-glibc-headers-compat.patch
117 Patch326: %{name}-6.8-tui-singlebinary.patch
118 Patch329: %{name}-6.8-bz254229-gcore-prpsinfo.patch
119 Patch330: %{name}-6.8-bz436037-reg-no-longer-active.patch
120 Patch331: %{name}-6.8-quit-never-aborts.patch
121 Patch332: %{name}-6.8-fortran-tag-constant.patch
122 Patch337: %{name}-6.8-attach-signalled-detach-stopped.patch
123 Patch343: %{name}-6.8-watchpoint-conditionals-test.patch
124 Patch348: %{name}-6.8-bz466901-backtrace-full-prelinked.patch
125 Patch349: %{name}-archer.patch
126 Patch420: %{name}-archer-ada.patch
127 Patch360: %{name}-6.8-bz457187-largefile-test.patch
128 Patch381: %{name}-simultaneous-step-resume-breakpoint-test.patch
129 Patch382: %{name}-core-open-vdso-warning.patch
130 Patch391: %{name}-x86_64-i386-syscall-restart.patch
131 Patch392: %{name}-bz533176-fortran-omp-step.patch
132 Patch397: %{name}-follow-child-stale-parent.patch
133 Patch403: %{name}-ccache-workaround.patch
134 Patch404: %{name}-fortran-common-reduce.patch
135 Patch405: %{name}-fortran-common.patch
136 Patch407: %{name}-lineno-makeup-test.patch
137 Patch408: %{name}-ppc-power7-test.patch
138 Patch412: %{name}-unused-revert.patch
139 Patch417: %{name}-bz541866-rwatch-before-run.patch
140 Patch451: %{name}-bz575292-delayed-physname.patch
141 Patch454: %{name}-bz539590-gnu-ifunc-fix-cond.patch
142 Patch459: %{name}-moribund-utrace-workaround.patch
143 Patch461: %{name}-bz594560-core-vs-process.patch
144 Patch470: %{name}-archer-next-over-throw-cxx-exec.patch
145 Patch475: %{name}-bz601887-dwarf4-rh-test.patch
146 Patch486: %{name}-bz562763-pretty-print-2d-vectors.patch
147 Patch489: %{name}-bz614659-prelink-dynbss.patch
148 Patch491: %{name}-gdb-add-index-script.patch
149 Patch493: %{name}-bz555076-gcore-small-height.patch
150 Patch496: %{name}-bz568248-oom-is-error.patch
151 Patch497: %{name}-false-gcc-warning.patch
152 Patch499: %{name}-bz631575-gdb-index-nobits.patch
153 Patch500: %{name}-bz631158-cxx-this-lookup.patch
154 Patch501: %{name}-gdbindex-ada-regression.patch
155 Patch502: %{name}-bz634660-gdbpy-load-on-attach.patch
156 Patch503: %{name}-pr12028-double-free.patch
157 Patch504: %{name}-bz623749-gcore-relro.patch
158 Patch506: %{name}-bz627432-loop-static-self-class.patch
159 Patch507: %{name}-bz592031-siginfo-lost-1of5.patch
160 Patch508: %{name}-bz592031-siginfo-lost-2of5.patch
161 Patch509: %{name}-bz592031-siginfo-lost-3of5.patch
162 Patch510: %{name}-bz592031-siginfo-lost-4of5.patch
163 Patch511: %{name}-bz592031-siginfo-lost-5of5.patch
164 Patch512: %{name}-gdbindex-bigendian.patch
165 Patch513: %{name}-bz637770-ifunc-watchpoint-delete.patch
168 Patch1000: %{name}-readline.patch
169 Patch1001: %{name}-info.patch
170 Patch1002: %{name}-passflags.patch
171 Patch1005: %{name}-pretty-print-by-default.patch
172 Patch1006: buildid-locate-rpm-pld.patch
174 URL: http://www.gnu.org/software/gdb/
175 BuildRequires: autoconf >= 2.68
176 BuildRequires: automake
178 BuildRequires: expat-devel
180 BuildRequires: gettext-devel
181 BuildRequires: libtool
182 BuildRequires: ncurses-devel >= 5.2
183 BuildRequires: pkgconfig
184 BuildRequires: readline-devel
185 BuildRequires: rpmbuild(macros) >= 1.219
186 BuildRequires: texinfo >= 4.4
187 BuildRequires: zlib-devel
189 BuildRequires: python-devel
190 BuildRequires: rpm-pythonprov
192 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
195 Gdb is a full featured, command driven debugger. Gdb allows you to
196 trace the execution of programs and examine their internal state at
197 any time. Gdb works for C and C++ compiled with the GNU C compiler
200 %description -l de.UTF-8
201 dem Sie die Ausführung von Programmen verfolgen und jederzeit den
202 inneren Zustand überprüfen können. Er funktioniert für C und mit GNU C
205 %description -l es.UTF-8
206 Este es un debugger orientado a comandos repleto de características.
207 Te permite rastrear la ejecución de programas y examinar su estado
208 interno a cualquier momento. Funciona para C y C++ compilado con el
211 %description -l fr.UTF-8
212 Débugger complet, piloté par commandes. Permet de tracer l'exécution
213 des programmes et d'examiner à tout moment leur état interne.
214 Fonctionne avec les binaires C et C++ compilés avec le compilateur C
217 %description -l pl.UTF-8
218 Gdb jest rozbudowanym odpluskwiaczem (debuggerem), pozwalającym
219 śledzić wykonywanie programu i badać jego stan wewnętrzny. Gdb
220 umożliwia odpluskwianie programów napisanych w C/C++ i skompilowanych
221 przy pomocy kompilatora GNU (gcc).
223 %description -l pt_BR.UTF-8
224 Este é um debugger orientado a comandos repleto de características.
225 Ele permite à você rastrear a execução de programas e examinar o seu
226 estado interno a qualquer momento. Ele funciona para para C e C++
227 compilado com o compilador GNU C.
229 %description -l ru.UTF-8
230 Это полноценный отладчик, управляемый командами. Он позволяет
231 трассировать исполнение программ и изучать их внутреннее состояние в
232 любой момент времени. Работает с программами на C и C++,
233 скомпилированными GNU компилятором C (gcc, egcs, pgcc).
235 %description -l tr.UTF-8
236 Bir komut arayüzü üzerinden programcıya programını adım adım izleme
237 (trace) ve herhangi bir anda programın durumunu inceleme olanağı
240 %description -l uk.UTF-8
241 Це повноцінний відладчик, що керується командами. Він дозволяє
242 трасувати виконання програм та вивчати їх внутрішній стан в довільний
243 момент часу. Працює з програмами на C та C++, зкомпільованими
244 компіляторами GNU C (gcc, egcs, pgcc).
247 Summary: A standalone server for GDB (the GNU source-level debugger)
248 Summary(pl.UTF-8): Samodzielny serwer GDB (debuggera GNU)
249 Group: Development/Debuggers
251 %description gdbserver
252 GDB, the GNU debugger, allows you to debug programs written in C, C++,
253 Java, and other languages, by executing them in a controlled fashion
254 and printing their data.
256 This package provides a program that allows you to run GDB on a
257 different machine than the one which is running the program being
260 %description gdbserver -l pl.UTF-8
261 GDB (GNU debugger) pozwala śledzić programy napisane w C, C++, Javie
262 i innych językach programowania poprzez wykonywanie ich w sposób
263 kontrolowany oraz wypisywanie ich danych.
265 Ten pakiet zawiera program pozwalający uruchamiać GDB na innej
266 maszynie niż ta, na której działa śledzony program.
268 %package -n python-%{name}
269 Summary: GDB Python bindings
270 Summary(pl.UTF-8): Wiązania GDB dla Pythona
271 Group: Development/Languages/Python
272 Requires: python-libs
274 %description -n python-%{name}
277 %description -n python-%{name} -l pl.UTF-8
278 Wiązania GDB dla Pythona.
281 Summary: GDB in the form of a static library
282 Summary(pl.UTF-8): GDB w postaci biblioteki statycznej
283 Group: Development/Debuggers
284 #Requires: binutils-devel >= 2.17.50
287 GDB in the form of a static library.
289 %description lib -l pl.UTF-8
290 GDB w postaci biblioteki statycznej.
295 # Files have `# <number> <file>' statements breaking VPATH / find-debuginfo.sh .
296 rm -f gdb/ada-exp.c gdb/ada-lex.c gdb/c-exp.c gdb/cp-name-parser.c gdb/f-exp.c
297 rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c
299 # FEDORA PATCHES -- keep them in same order they do
438 # Change the version that gets printed at GDB startup, so it is PLD Linux specific.
439 cat > gdb/version.in << EOF
440 PLD Linux (%{version}-%{release})
443 sed -i -e 's#_GCC_AUTOCONF_VERSION\], \[2\.64\]#_GCC_AUTOCONF_VERSION], [2.68]#g' config/override.m4
446 for dir in $(find gdb -name 'configure.in' -o -name 'configure.ac'); do
447 dir=$(dirname "$dir")
451 %{__aclocal} `[ -d config ] && echo "-I config"` `[ -d m4 ] && echo "-I m4"` `[ -d gnulib/m4 ] && echo "-I gnulib/m4"`
453 grep -q AC_CONFIG_HEADER configure.* && %{__autoheader}
456 cp -f /usr/share/automake/config.* .
457 # don't --enable-shared here, there would be libs version mismatch with binutils
459 --with-gdb-datadir=%{_datadir}/gdb \
460 --with-separate-debug-dir=/usr/lib/debug \
463 --with-pythondir=%{py_sitescriptdir} \
475 --with-system-readline \
476 --with-cpu=%{_target_cpu} \
480 --without-included-gettext \
481 --without-included-regex \
488 rm -rf $RPM_BUILD_ROOT
489 install -d $RPM_BUILD_ROOT%{_infodir}
491 %{__make} -j1 install install-info \
492 DESTDIR=$RPM_BUILD_ROOT
494 # gdbtui seems all identical to gdb except when invoked as gdbtio, ncurses
495 # window is created too.
496 echo ".so gdb.1" > $RPM_BUILD_ROOT%{_mandir}/man1/gdbtui.1
497 ln -f $RPM_BUILD_ROOT%{_bindir}/{gdb,gdbtui}
499 bzip2 -dc %{SOURCE1} | tar xf - -C $RPM_BUILD_ROOT%{_mandir}
500 cp -a gdb/libgdb.a $RPM_BUILD_ROOT%{_libdir}
502 rm -f $RPM_BUILD_ROOT%{_infodir}/dir
503 rm -f $RPM_BUILD_ROOT%{_mandir}/README.gdb-non-english-man-pages
507 for LIB in lib lib64; do
508 LIBPATH="$RPM_BUILD_ROOT%{_datadir}/gdb/auto-load%{_prefix}/$LIB"
512 %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
513 %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
517 cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_mandir}/man1/gstack.1
519 # Remove the files that are part of a gdb build but that are owned and provided by other packages.
520 # These are part of binutils
521 rm -rf $RPM_BUILD_ROOT%{_datadir}/locale
522 rm -f $RPM_BUILD_ROOT%{_infodir}/bfd*
523 rm -f $RPM_BUILD_ROOT%{_infodir}/standard*
524 rm -f $RPM_BUILD_ROOT%{_infodir}/mmalloc*
525 rm -f $RPM_BUILD_ROOT%{_infodir}/configure*
526 rm -rf $RPM_BUILD_ROOT%{_includedir}
527 rm -rf $RPM_BUILD_ROOT%{_libdir}/lib{bfd*,opcodes*,iberty*,mmalloc*}
530 rm -rf $RPM_BUILD_ROOT
532 %post -p /sbin/postshell
533 -/usr/sbin/fix-info-dir -c %{_infodir}
535 %postun -p /sbin/postshell
536 -/usr/sbin/fix-info-dir -c %{_infodir}
539 %defattr(644,root,root,755)
540 %doc gdb/{ChangeLog,NEWS,PROBLEMS,README}
541 %attr(755,root,root) %{_bindir}/gdb
542 %attr(755,root,root) %{_bindir}/gdbtui
543 %attr(755,root,root) %{_bindir}/gdb-add-index
544 %attr(755,root,root) %{_bindir}/gstack
546 %{_datadir}/gdb/syscalls
547 %{_mandir}/man1/gdb.1*
548 %{_mandir}/man1/gdbtui.1*
549 %{_mandir}/man1/gstack.1*
550 %lang(es) %{_mandir}/es/man1/*
551 %lang(fr) %{_mandir}/fr/man1/*
552 %lang(hu) %{_mandir}/hu/man1/*
553 %lang(ja) %{_mandir}/ja/man1/*
554 %lang(pl) %{_mandir}/pl/man1/*
555 %{_infodir}/annotate.info*
556 %{_infodir}/gdb.info*
557 %{_infodir}/gdbint.info*
558 %{_infodir}/stabs.info*
561 %defattr(644,root,root,755)
562 %attr(755,root,root) %{_bindir}/gdbserver
563 %{_mandir}/man1/gdbserver.1*
564 %attr(755,root,root) %{_libdir}/libinproctrace.so
567 %files -n python-%{name}
568 %defattr(644,root,root,755)
569 %dir %{py_sitescriptdir}/gdb
570 %{py_sitescriptdir}/gdb/*.py[co]
571 %dir %{py_sitescriptdir}/gdb/command
572 %{py_sitescriptdir}/gdb/command/*.py[co]
573 %dir %{py_sitescriptdir}/gdb/function
574 %{py_sitescriptdir}/gdb/function/*.py[co]
575 # container for 3-rd party stuff.
576 %{_datadir}/gdb/auto-load
580 %defattr(644,root,root,755)