# We build this as an arch-specific package so that we can follow /lib
# vs /lib64 differences in the location of the underlying glibc library
# We don't want a -debuginfo package:
%global debug_package %{nil}
# (I tried using _enable_debug_packages but that didn't work for some reason)
Name: gdb-heap
Version: 0.5
Release: 22%{?dist}
Summary: Extensions to gdb for debugging dynamic memory allocation
Group: Development/Libraries
# The code is almost all LGPLv2+, apart from heap/python.py, which is
# Python-licensed:
License: LGPLv2+ and Python
URL: https://fedorahosted.org/gdb-heap/
Source0: https://fedorahosted.org/released/gdb-heap/gdb-heap-%{version}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Patch1: fix-rhbz638662.patch
Requires: python-ply
BuildRequires: python
%global glibc_version 2.22
%global glibc_soversion %{glibc_version}
%global glibc_dso_name ld-%{glibc_soversion}.so
%global gdb_autoload_dir %{_datadir}/gdb/auto-load
%global script_install_dir %{gdb_autoload_dir}/%{_lib}
%global script_install_path %{script_install_dir}/%{glibc_dso_name}-gdb.py
%global module_install_path %{_datadir}/gdb-heap
# This is autoloaded by gdb if the relevant glibc library is in memory.
# To do this, it must be at the correct location on the filesystem
# For this to work, we need a matching glibc version:
Requires: glibc%{_isa} = %{glibc_version}
Requires: gdb
# It is only really usable if that glibc library's debuginfo is available, but
# the user may not have enable the debuginfo repository.
#
# From version 0.3 onwards the code detects missing debuginfo and provides a
# suggestion to the user on how to install it
%description
gdb-heap adds a "heap" command to the gdb debugger, for use in debugging
dynamic memory allocation problems in user space.
%prep
%setup -q
%patch1 -p1
%build
# empty
%install
rm -rf %{buildroot}
mkdir -p %{buildroot}/%{module_install_path}/heap
cp -a heap/*.py %{buildroot}/%{module_install_path}/heap
mkdir -p %{buildroot}/%{script_install_dir}
# Build the auto-loaded entrypoint script, adding module_install_path
# to sys.path:
echo \
"import sys; sys.path.append('%{module_install_path}')" \
> %{buildroot}/%{script_install_path}
cat gdbheap.py \
>> %{buildroot}/%{script_install_path}
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
%doc LICENSE.txt LICENSE-lgpl-2.1.txt LICENSE-python.txt
%{script_install_path}*
%{module_install_path}
%changelog
* Sun Aug 16 2015 Siddhesh Poyarekar <siddhesh@redhat.com> - 0.5-22
- Update glibc version to f23 (2.22).
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-21
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Tue Feb 17 2015 Siddhesh Poyarekar <siddhesh@redhat.com>
- Update glibc version to rawhide (2.21.90).
* Mon Sep 8 2014 Siddhesh Poyarekar <siddhesh@redhat.com>
- Update glibc version to rawhide (2.20.90).
* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Thu May 29 2014 Siddhesh Poyarekar <siddhesh@redhat.com> - 0.5-16
- Update glibc version to rawhide (2.19.90).
* Wed Sep 18 2013 David Malcolm <dmalcolm@redhat.com> - 0.5-15
- update glibc version to rawhide (2.18.90)
* Sat Aug 17 2013 Peter Robinson <pbrobinson@fedoraproject.org> 0.5-14
- update glibc version to rawhide (2.18)
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Fri Jan 25 2013 Kevin Fenzi <kevin@scrye.com> 0.5-12
- Rebuild for latest glibc.
* Wed Oct 31 2012 Tom Callaway <spot@fedoraproject.org> - 0.5-11
- update glibc version to rawhide (2.16.90)
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Tue Feb 7 2012 David Malcolm <dmalcolm@redhat.com> - 0.5-8
- update glibc version to 2.15
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
* Mon Jul 18 2011 David Malcolm <dmalcolm@redhat.com> - 0.5-6
- update glibc version to 2.14.90
* Fri Jun 10 2011 Adam Jackson <ajax@redhat.com> 0.5-5
- Rebuild for new glibc version
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Wed Jan 26 2011 David Malcolm <dmalcolm@redhat.com> - 0.5-3
- update glibc version to 2.13.90
* Wed Sep 29 2010 David Malcolm <dmalcolm@redhat.com> - 0.5-2
- cherrypick fix for rhbz#638662
* Thu Aug 12 2010 David Malcolm <dmalcolm@redhat.com> - 0.5-1
- 0.5
- add requirement on python-ply
* Wed Aug 4 2010 David Malcolm <dmalcolm@redhat.com> - 0.4-1
- 0.4: add licenses and license headers
* Tue Aug 3 2010 David Malcolm <dmalcolm@redhat.com> - 0.3-1
- 0.3: detect and warn about missing debuginfo; disable C++ support for
now (rhbz620930)
* Tue Aug 3 2010 David Malcolm <dmalcolm@redhat.com> - 0.2-2
- use the gdb autoload directory, relative to the glibc.so, rather than the
.debug file
- add requirement on gdb
- bump glibc version to that in F14
* Thu Jul 29 2010 David Malcolm <dmalcolm@redhat.com> - 0.2-1
- 0.2
- install private modules to _datadir rather than _libdir
* Tue Jul 27 2010 David Malcolm <dmalcolm@redhat.com> - 0.1-2
- fix License tag
- require specific glibc package version, rather than a specific file within
glibc-debuginfo
- standardize on buildroot rpm macro rather than RPM_BUILD_ROOT env var
* Mon Jul 26 2010 David Malcolm <dmalcolm@redhat.com> - 0.1-1
- initial packaging