]>
Commit | Line | Data |
---|---|---|
96e48a11 PS |
1 | Summary: A tool for trace and analyze memory leaks in C++ programs |
2 | Name: LeakTracer | |
3 | Version: 2.3 | |
4 | Release: 1 | |
5 | License: Public Domain | |
6 | Group: Applications | |
e23bdcbe | 7 | Source0: http://www.andreasen.org/LeakTracer/LeakTracer.tar.gz |
96e48a11 PS |
8 | # Source0-md5: e1cf9d03c12a45d39f253e558d231438 |
9 | Patch0: %{name}-Makefile.patch | |
c8cfd0aa PS |
10 | Patch1: %{name}-64bit.patch |
11 | Patch2: %{name}-caller_addr.patch | |
96e48a11 PS |
12 | URL: http://www.andreasen.org/LeakTracer/ |
13 | BuildRequires: sed >= 4.0 | |
14 | Requires: gdb | |
15 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
16 | ||
17 | %description | |
18 | LeakTracer is a small tool for checking a C++ program for memory | |
19 | leaks. To use LeakTracer, run your program using the provided | |
20 | LeakCheck script. It uses the LD_PRELOAD feature to "overlay" some | |
21 | functions on top of your functions (no recompile needed). leak-anlyze | |
22 | uses gdb to print out the exact line where the memory was allocated | |
23 | and not freed - this of course means you have to free all dynamically | |
24 | allocated data. LeakTracer also overrides the global operator new and | |
25 | operator delete - this will give problems if you override them as | |
26 | well. LeakTracer traces only new/new[] and delete calls - it does not | |
27 | look at malloc/free/realloc. | |
28 | ||
29 | %prep | |
30 | %setup -q -n %{name} | |
31 | %patch0 -p1 | |
c8cfd0aa PS |
32 | %patch1 -p0 |
33 | %patch2 -p0 | |
96e48a11 PS |
34 | |
35 | %build | |
36 | sed -i "s:SHLIB=.*:SHLIB=%{_libdir}/LeakTracer.so:" LeakCheck | |
37 | ||
38 | %{__make} \ | |
39 | CXX="%{__cxx}" \ | |
dc4b537c | 40 | CXXFLAGS="%{rpmcxxflags} -nodefaultlibs" |
96e48a11 PS |
41 | |
42 | %install | |
43 | rm -rf $RPM_BUILD_ROOT | |
44 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}} | |
45 | ||
46 | install leak-analyze $RPM_BUILD_ROOT%{_bindir} | |
47 | install LeakCheck $RPM_BUILD_ROOT%{_bindir} | |
48 | install LeakTracer.so $RPM_BUILD_ROOT%{_libdir} | |
49 | ||
50 | %clean | |
51 | rm -rf $RPM_BUILD_ROOT | |
52 | ||
53 | %post -p /sbin/ldconfig | |
54 | %postun -p /sbin/ldconfig | |
55 | ||
56 | %files | |
57 | %defattr(644,root,root,755) | |
58 | %doc README | |
59 | %attr(755,root,root) %{_bindir}/* | |
60 | %attr(755,root,root) %{_libdir}/*.so |