Accepting request 823275 from home:tomdevries:branches:devel:gcc-gdb-gdb-multibuild

- Change into multibuild package and add flavour gdb-testsuite.

OBS-URL: https://build.opensuse.org/request/show/823275
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=255
This commit is contained in:
Michael Matz 2020-08-06 12:58:28 +00:00 committed by Git OBS Bridge
parent 45a5ee96ed
commit 9e57144c0c
3 changed files with 94 additions and 19 deletions

3
_multibuild Normal file
View File

@ -0,0 +1,3 @@
<multibuild>
<package>testsuite</package>
</multibuild>

View File

@ -4,6 +4,11 @@ Wed Jul 29 15:44:22 UTC 2020 - Tom de Vries <tdevries@suse.com>
- Fix internal error on aarch64 [swo#26316].
gdb-aarch64-fix-erroneous-use-of-spu-architecture-bfd.patch
-------------------------------------------------------------------
Tue Jul 28 11:29:35 UTC 2020 - Tom de Vries <tdevries@suse.com>
- Change into multibuild package and add flavour gdb-testsuite.
-------------------------------------------------------------------
Fri Jul 24 12:39:06 UTC 2020 - Tom de Vries <tdevries@suse.com>

105
gdb.spec
View File

@ -17,17 +17,52 @@
#
%define flavor @BUILD_FLAVOR@%{nil}
%bcond_with ringdisabled
%if "%flavor" == "testsuite"
%if %{with ringdisabled}
ExclusiveArch: do_not_build
%endif
%if 0%{?qemu_user_space_build}
# In a qemu_user_space_build ptrace is not supported, so we can't test gdb.
%global _without_testsuite 1
ExclusiveArch: do_not_build
%endif
%bcond_without testsuite
%define build_main 0
%define build_testsuite 1
%else
%define build_main 1
%define build_testsuite 0
%endif
%if %{build_testsuite}
%define debug_package %{nil}
%endif
%if %{build_main}
%define name_suffix %{nil}
%else
%if %{build_testsuite}
%define name_suffix -testresults
%else
%define name_suffix -%{flavor}
%endif
%endif
%bcond_without fpc
%if %{build_main}
Summary: A GNU source-level debugger for C, C++, Fortran and other languages
License: GPL-3.0-or-later AND GPL-3.0-with-GCC-exception AND LGPL-2.1-or-later AND LGPL-3.0-or-later
Group: Development/Tools/Debuggers
Name: gdb
License: SUSE-Public-Domain
Group: Development/Languages/C and C++
%endif
%if %{build_testsuite}
Summary: GDB testsuite results
License: SUSE-Public-Domain
Group: Development/Languages/C and C++
%endif
Name: gdb%{name_suffix}
Version: 9.2
Release: 0
@ -46,9 +81,9 @@ Obsoletes: devtoolset-1.0-%{pkg_name}
%endif
# For our convenience
%global gdb_src %{name}-%{version}
%global gdb_src gdb-%{version}
%global gdb_build build-%{_target_platform}
%global gdb_docdir %{_docdir}/%{name}-doc
%global gdb_docdir %{_docdir}/gdb-doc
%global have_inproctrace 0
%ifarch %{ix86} x86_64
@ -96,6 +131,18 @@ Source10: patchlist.pl
Source11: patchname_get.sh
Source12: baselibs.conf
Source13: gdb-rpmlintrc
%if %{build_testsuite}
NoSource: 0
NoSource: 2
NoSource: 3
NoSource: 4
NoSource: 5
NoSource: 7
NoSource: 10
NoSource: 11
NoSource: 12
NoSource: 13
%endif
#Fedora Packages begin
Patch2: gdb-vla-intel-fortran-strides.patch
@ -282,7 +329,7 @@ BuildRequires: cmake
ExclusiveArch: noarch i386 x86_64 ppc ppc64 ia64 s390 s390x
%endif # 0%{?el5:1}
%if %{with testsuite}
%if %{build_testsuite}
# Copied from gcc9/gcc.spec.in
# Ada currently fails to build on a few platforms, enable it only
@ -374,13 +421,15 @@ BuildRequires: binutils-gold
BuildRequires: binutils-gold
%endif
%endif # %%{with testsuite}
%endif # %%{build_testsuite}
%ifarch ia64
BuildRequires: libunwind-devel
Requires: libunwind
%endif
%if %{build_main}
%description
GDB, the GNU debugger, allows you to debug programs written in C, C++,
Java, and other languages, by executing them in a controlled fashion
@ -417,14 +466,12 @@ Java, and other languages, by executing them in a controlled fashion
and printing their data.
This package provides INFO, HTML and PDF user manual for GDB.
%endif
%package testresults
Summary: GDB testsuite results
License: SUSE-Public-Domain
Group: Development/Languages/C and C++
%description testresults
%if %{build_testsuite}
%description
Results from running the GDB testsuite.
%endif
%prep
%setup -q -n %{gdb_src}
@ -790,7 +837,7 @@ fi
# This is a build-time test, but still a test. So, skip if we don't do tests.
# This is relevant for %%qemu_user_space_build == 1 builds, which atm is
# the case for riscv64.
%if %{with testsuite}
%if %{build_testsuite}
if [ "$LIBRPM" != "no" ]; then
cd gdb
cat \
@ -870,7 +917,7 @@ cp $RPM_BUILD_DIR/%{gdb_src}/gdb/NEWS $RPM_BUILD_DIR/%{gdb_src}
# Initially we're in the %%{gdb_src} directory.
cd %{gdb_build}
%if %{without testsuite}
%if !%{build_testsuite}
echo ====================TESTSUITE DISABLED=========================
%else
echo ====================TESTING=========================
@ -1042,11 +1089,24 @@ rm -f $RPM_BUILD_ROOT%{_infodir}/configure*
rm -rf $RPM_BUILD_ROOT%{_includedir}
rm -rf $RPM_BUILD_ROOT/%{_libdir}/lib{bfd*,opcodes*,iberty*}
%if %{build_testsuite}
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/gdbinit
rm -rf $RPM_BUILD_ROOT%{_bindir}
rm -rf $RPM_BUILD_ROOT%{_libdir}
rm -rf $RPM_BUILD_ROOT%{_datadir}/gdb
rm -rf $RPM_BUILD_ROOT%{_infodir}
rm -rf $RPM_BUILD_ROOT%{_mandir}
rm -rf $RPM_BUILD_ROOT/usr/src
%endif
# pstack obsoletion
%if %{build_main}
cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_mandir}/man1/gstack.1
%endif
%endif # 0%{!?_with_upstream:1}
%if %{build_main}
# Packaged GDB is not a cross-target one.
(cd $RPM_BUILD_ROOT%{_datadir}/gdb/syscalls
rm -f mips*.xml
@ -1095,6 +1155,7 @@ rm -f $RPM_BUILD_ROOT%{_infodir}/dir
# build" ( https://sourceware.org/bugzilla/show_bug.cgi?id=24575 ).
rm %{buildroot}/usr/share/man/man1/gdbserver.1
%endif
%endif
%post
# This step is part of the installation of the RPM. Not to be confused
@ -1118,6 +1179,7 @@ then
fi
fi
%if %{build_main}
%files
%defattr(-,root,root)
%doc README NEWS
@ -1140,9 +1202,10 @@ fi
%{_datadir}/gdb
%{_infodir}/annotate.info*
%{_infodir}/gdb.info*
%endif
%if %{with testsuite}
%files testresults
%if %{build_testsuite}
%files
%defattr(-,root,root)
%doc %{gdb_build}/gdb/gdb-*.sum
%doc %{gdb_build}/gdb/gdb-*.log
@ -1150,6 +1213,7 @@ fi
# don't include the files in include, they are part of binutils
%if %{build_main}
%ifnarch riscv64 sparcv9 hppa
%files -n gdbserver
%defattr(-,root,root)
@ -1159,7 +1223,9 @@ fi
%{_libdir}/libinproctrace.so
%endif # %%{have_inproctrace}
%endif
%endif
%if %{build_main}
%post doc
# This step is part of the installation of the RPM. Not to be confused
# with the 'make install ' of the build (rpmbuild) process.
@ -1181,5 +1247,6 @@ then
/sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gdb.info.gz || :
fi
fi
%endif
%changelog