1 Summary: A tool for trace and analyze memory leaks in C++ programs
7 Source0: http://www.andreasen.org/LeakTracer/LeakTracer.tar.gz
8 # Source0-md5: e1cf9d03c12a45d39f253e558d231438
9 Patch0: %{name}-Makefile.patch
10 URL: http://www.andreasen.org/LeakTracer/
11 BuildRequires: libstdc++-devel
12 BuildRequires: sed >= 4.0
14 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
17 LeakTracer is a small tool for checking a C++ program for memory
18 leaks. To use LeakTracer, run your program using the provided
19 LeakCheck script. It uses the LD_PRELOAD feature to "overlay" some
20 functions on top of your functions (no recompile needed). leak-anlyze
21 uses gdb to print out the exact line where the memory was allocated
22 and not freed - this of course means you have to free all dynamically
23 allocated data. LeakTracer also overrides the global operator new and
24 operator delete - this will give problems if you override them as
25 well. LeakTracer traces only new/new[] and delete calls - it does not
26 look at malloc/free/realloc.
33 sed -i "s:SHLIB=.*:SHLIB=%{_libdir}/LeakTracer.so:" LeakCheck
37 CXXFLAGS="%{rpmcflags}"
40 rm -rf $RPM_BUILD_ROOT
41 install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}}
43 install leak-analyze $RPM_BUILD_ROOT%{_bindir}
44 install LeakCheck $RPM_BUILD_ROOT%{_bindir}
45 install LeakTracer.so $RPM_BUILD_ROOT%{_libdir}
48 rm -rf $RPM_BUILD_ROOT
50 %post -p /sbin/ldconfig
51 %postun -p /sbin/ldconfig
54 %defattr(644,root,root,755)
56 %attr(755,root,root) %{_bindir}/*
57 %attr(755,root,root) %{_libdir}/*.so