# We're dropping things into the debug location; 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.1 Release: 1%{?dist} Summary: Extensions to gdb for debugging dynamic memory allocation # We build this arch-specific so that we can follow /lib vs /lib64 differences # in the location of the underlying glibc library Group: Development/Libraries License: LGPLv2.1+ and PSF # Made from upstream 853132392ba48695af4d2ce3cda2b646ba1fad88 # git clone git://git.fedorahosted.org/gdb-heap.git # mv gdb-heap gdb-heap-0.1 # tar cfvj gdb-heap-0.1.tar.bz2 gdb-heap-0.1 URL: https://fedorahosted.org/gdb-heap/ Source0: https://fedorahosted.org/released/gdb-heap/gdb-heap-0.1.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: python %global glibc_soversion 2.11.2 %global glibc_dso_name ld-%{glibc_soversion}.so %global glibc_debug_dir %{_prefix}/lib/debug/%{_lib} %global glibc_debug_dso_path %{glibc_debug_dir}/%{glibc_dso_name}.debug %global script_install_path %{glibc_debug_dso_path}-gdb.py %global module_install_path %{_libdir}/gdb-heap # This is autoloaded by gdb if the relevant glibc library is in memory. # It is only usable if that glibc library's debuginfo is available. # To do this, it must be at the correct location on the filesystem Requires: %{glibc_debug_dso_path} %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 $RPM_BUILD_ROOT mkdir -p %{buildroot}/%{glibc_debug_dir} mkdir -p %{buildroot}/%{module_install_path}/heap cp -a heap/*.py %{buildroot}/%{module_install_path}/heap # 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 $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %doc LICENSE.txt %{script_install_path}* %{module_install_path} %changelog * Mon Jul 26 2010 David Malcolm - 0.1-1 - initial packaging