Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rpm/precheckin.sh → precheckin.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ for i in ${ARCHES} ; do
else
CROSSTARGET=${i}-${VENDOR}-linux-gnu
fi
cat ./${SPECNAME} | sed -e "s#Name: .*#Name: cross-${i}-${NAME}\n%define crosstarget ${CROSSTARGET}#" > ./cross-${i}-${NAME}.spec
cat ./rpm/${SPECNAME} | sed -e "s#Name: .*#Name: cross-${i}-${NAME}\n%define crosstarget ${CROSSTARGET}#" > ./rpm/cross-${i}-${NAME}.spec
done
139 changes: 74 additions & 65 deletions rpm/cross-aarch64-gdb.spec
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
%global __python %{__python3}

%global ctarch %{crosstarget}__%{_arch}

Name: cross-aarch64-gdb
Expand All @@ -10,35 +8,50 @@ Name: cross-aarch64-gdb
%endif

Summary: A GNU source-level debugger for C, C++, Java and other languages
Version: 12.1.0
Version: 16.3.0
Release: 1
License: GPLv3+
URL: http://gnu.org/software/gdb/
URL: https://github.com/sailfishos/gdb
Source0: %{name}-%{version}.tar.bz2
Source1: gdb-rpmlintrc
Source2: precheckin.sh

# New locating of the matching binaries from the pure core file (build-id).
Patch1: gdb-6.6-buildid-locate.patch
# Fix loading of core files without build-ids but with build-ids in executables.
Patch2: gdb-6.6-buildid-locate-solib-missing-ids.patch
Patch3: gdb-6.6-buildid-locate-rpm.patch
# Workaround librpm BZ 643031 due to its unexpected exit() calls (BZ 642879).
Patch4: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
Patch5: gdb-6.6-buildid-locate-rpm-suse.patch
Patch6: system-gdbinit-missing-parentheses.patch

BuildRequires: pkgconfig(ncurses)
BuildRequires: texinfo
BuildRequires: gettext
BuildRequires: flex
# Update gdb-add-index.sh such that, when the GDB environment
# variable is not set, the script is smarter than just looking for
# 'gdb' in the $PATH.
#
# The actual search order is now: /usr/bin/gdb.minimal, gdb (in the
# $PATH), then /usr/libexec/gdb.
#
# For the rationale of looking for gdb.minimal see:
#
# https://fedoraproject.org/wiki/Changes/Minimal_GDB_in_buildroot
#
#=fedora
Patch002: gdb-add-index.patch

# Not a backport. Add a new script which hooks into GDB and suggests
# RPMs to install when GDB finds an objfile with no debug info.
Patch003: gdb-rpm-suggestion-script.patch

# Backport "Fix another timeout in gdb.base/bg-execution-repeat.exp"
Patch004: gdb-fix-bg-execution-repeat.patch

# Sailfish OS modifications to rpm suggestion script
Patch005: gdb-rpm-suggestion-script-sailfishos.patch

BuildRequires: bison
BuildRequires: expat-devel
BuildRequires: gmp-devel
BuildRequires: python3-devel
BuildRequires: flex
BuildRequires: gettext
BuildRequires: libstdc++
BuildRequires: zlib-devel
BuildRequires: texinfo
BuildRequires: pkgconfig(expat)
BuildRequires: pkgconfig(gmp)
BuildRequires: pkgconfig(mpfr)
BuildRequires: pkgconfig(ncurses)
BuildRequires: pkgconfig(python3)
BuildRequires: pkgconfig(zlib)
Requires: python3-base
Recommends: rpm-python

%description
GDB, the GNU debugger, allows you to debug programs written in C, C++,
Expand All @@ -47,16 +60,10 @@ and printing their data.


%prep
%setup -q -n %{name}-%{version}/upstream
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%autosetup -p1 -n %{name}-%{version}/upstream

cat > gdb/version.in << _FOO
Mer (%{version})
Sailfish OS (%{version})
_FOO

# Remove the info and other generated files added by the FSF release
Expand Down Expand Up @@ -94,7 +101,7 @@ export CFLAGS="$RPM_OPT_FLAGS"
--disable-rpath \
--with-expat \
--enable-tui \
--with-python=%{__python} \
--with-python=%{__python3} \
--without-libunwind \
--enable-64-bit-bfd \
--enable-static \
Expand All @@ -109,8 +116,8 @@ export CFLAGS="$RPM_OPT_FLAGS"
--disable-gprofng \
%{_target_platform}

make %{?_smp_mflags}
make %{?_smp_mflags} info
%make_build
%make_build info


%install
Expand All @@ -128,6 +135,7 @@ mkdir -p "%{buildroot}%{_docdir}/%{name}-%{version}"
install -m 0644 -t "%{buildroot}%{_docdir}/%{name}-%{version}" README gdb/NEWS
rm "%{buildroot}%{_infodir}"/bfd*
rm -f "%{buildroot}%{_infodir}"/ctf-spec*
rm -f "%{buildroot}%{_infodir}"/sframe-spec*
%else
rm -r "%{buildroot}%{_infodir}/"
rm -r "%{buildroot}%{_mandir}/"
Expand All @@ -137,18 +145,6 @@ rm -r "%{buildroot}%{_mandir}/"
%if "%{?crosstarget}" == ""
#### NON-CROSS PACS

%files
%defattr(-,root,root,-)
%license COPYING COPYING.LIB
%{_bindir}/gcore
%{_bindir}/gdb
%{_bindir}/gdb-add-index
%{_datadir}/gdb
%if "%{_arch}" == "aarch64"
%{_libdir}/libinproctrace.so
%endif


%package gdbserver
Summary: A standalone server for GDB (the GNU source-level debugger)
%ifarch %{ix86} x86_64
Expand All @@ -164,19 +160,6 @@ and printing their data.
This package provides a program that allows you to run GDB on a different
machine than the one which is running the program being debugged.

%ifarch %{ix86} x86_64
%post gdbserver -p /sbin/ldconfig
%postun gdbserver -p /sbin/ldconfig
%endif

%files gdbserver
%defattr(-,root,root,-)
%{_bindir}/gdbserver
%ifarch %{ix86} x86_64
%{_libdir}/libinproctrace.so
%endif


%package doc
Summary: Documentation for %{name}
Requires: %{name} = %{version}-%{release}
Expand All @@ -186,6 +169,11 @@ Requires(postun): /sbin/install-info
%description doc
Man and info pages for %{name}.

%ifarch %{ix86} x86_64
%post gdbserver -p /sbin/ldconfig
%postun gdbserver -p /sbin/ldconfig
%endif

%post doc
%install_info --info-dir=%{_infodir} %{_infodir}/annotate.info.gz
%install_info --info-dir=%{_infodir} %{_infodir}/gdb.info.gz
Expand All @@ -201,37 +189,58 @@ then
%install_info_delete --info-dir=%{_infodir} %{_infodir}/stabs.info.gz
fi


%files
%license COPYING3 COPYING3.LIB
%{_bindir}/gcore
%{_bindir}/gdb
%{_bindir}/gdb-add-index
%{_bindir}/gstack
%{_datadir}/gdb
%if "%{_arch}" == "aarch64"
%{_libdir}/libinproctrace.so
%endif

%files gdbserver
%{_bindir}/gdbserver
%ifarch %{ix86} x86_64
%{_libdir}/libinproctrace.so
%endif

%files doc
%defattr(-,root,root,-)
%{_mandir}/*/gdb.1*
%{_mandir}/*/gdbserver.1*
%{_mandir}/man1/gcore.1.gz
%{_mandir}/man1/gdb-add-index.1.gz
%{_mandir}/man1/gstack.1.gz
%{_mandir}/man5/gdbinit.5.gz
%{_infodir}/annotate.info.gz
%{_infodir}/gdb.info.gz
%{_infodir}/stabs.info.gz
%{_docdir}/%{name}-%{version}


%else # crosstarget
%else
# crosstarget
#### CROSS PACS

%files
%defattr(-,root,root,-)
/opt/cross/share/%{crosstarget}-gdb
%if "%{ctarch}" == "aarch64-meego-linux-gnu__aarch64" || "%{ctarch}" == "i486-meego-linux-gnu__i386" || "%{ctarch}" == "armv7hl-meego-linux-gnueabi__arm"
%if "%{ctarch}" == "aarch64-meego-linux-gnu__aarch64" || "%{ctarch}" == "i486-meego-linux-gnu__i386" || "%{ctarch}" == "armv7hl-meego-linux-gnueabi__arm" || "%{ctarch}" == "x86_64-meego-linux-gnu__x86_64"
/opt/cross/bin/gcore
/opt/cross/bin/gdb
/opt/cross/bin/gdb-add-index
/opt/cross/bin/gdbserver
/opt/cross/bin/gstack
%else
/opt/cross/bin/%{crosstarget}-gdb
/opt/cross/bin/%{crosstarget}-gdb-add-index
/opt/cross/bin/%{crosstarget}-gstack
%endif

%if "%{ctarch}" == "aarch64-meego-linux-gnu__aarch64" || "%{ctarch}" == "i486-meego-linux-gnu__i386"
%if "%{ctarch}" == "aarch64-meego-linux-gnu__aarch64" || "%{ctarch}" == "i486-meego-linux-gnu__i386" || "%{ctarch}" == "x86_64-meego-linux-gnu__x86_64"
/opt/cross/%{_lib}/libinproctrace.so
%endif

%endif # crosstarget
# crosstarget
%endif
Loading