# 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.4 Release: 1%{?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) BuildRequires: python %global glibc_version 2.12.90 %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 %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 * Wed Aug 4 2010 David Malcolm - 0.4-1 - 0.4: add licenses and license headers * Tue Aug 3 2010 David Malcolm - 0.3-1 - 0.3: detect and warn about missing debuginfo; disable C++ support for now (rhbz620930) * Tue Aug 3 2010 David Malcolm - 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 - 0.2-1 - 0.2 - install private modules to _datadir rather than _libdir * Tue Jul 27 2010 David Malcolm - 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 - 0.1-1 - initial packaging