Summary: Valgrind Memory Debugger
Summary(ja): Valgrind メモリデバッガ
Name: valgrind
Version: 3.7.0
Release: 1%{?_dist_release}
License: GPL
URL: http://www.valgrind.org/
Group: Development/Tools
Source: http://valgrind.org/downloads/%{name}-%{version}.tar.bz2
Buildroot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: glibc-devel >= 2.14
Requires: glibc >= 2.14
ExclusiveArch: %{ix86} x86_64 ppc

## from fedora
Patch1: valgrind-3.7.0-cachegrind-improvements.patch
Patch2: valgrind-3.7.0-openat.patch
Patch3: valgrind-3.7.0-helgrind-race-supp.patch
Patch4: valgrind-3.7.0-stat_h.patch
Patch5: valgrind-3.7.0-config_h.patch
Patch6: valgrind-3.7.0-capget.patch
Patch7: valgrind-3.7.0-glibc-2.15.patch
Patch8: valgrind-3.7.0-pie.patch
Patch9: valgrind-3.7.0-tests.patch
Patch10: valgrind-3.7.0-f-sgetown-ex.patch
Patch11: valgrind-3.7.0-scsi-ioctls.patch
Patch12: valgrind-3.7.0-enable-armv5.patch


%description 
Valgrind is a tool to help you find memory-management problems in your
programs. When a program is run under Valgrind's supervision, all
reads and writes of memory are checked, and calls to
malloc/new/free/delete are intercepted. As a result, Valgrind can
detect a lot of problems that are otherwise very hard to
find/diagnose.

%package devel
Summary: Development files for valgrind
Group: Development/Libraries
Requires: valgrind = %{version}-%{release}

%description devel
Header files and libraries for development of valgrind aware programs
or valgrind plugins.


%prep
%setup -q -n %{name}-%{version}
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1 -b .arm


%build
autoconf
%configure
make %{?_smp_mflags}


%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT

rm -rf docs.installed
mkdir docs.installed
mv $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/* docs.installed/

# remove unuse files
rm $RPM_BUILD_ROOT%{_libdir}/%{name}/*.a


%clean
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf ${RPM_BUILD_ROOT}

%files
%defattr(-,root,root)
%doc AUTHORS COPYING FAQ.txt NEWS README*
%doc docs.installed/html docs.installed/valgrind_manual.{pdf,ps}
%{_bindir}/*
%dir %{_libdir}/%{name}
%{_libdir}/%{name}/*
%{_mandir}/man1/*

%files devel
%defattr(-,root,root)
%{_includedir}/%{name}
%{_libdir}/pkgconfig/%{name}.pc


%changelog
* Wed Apr 18 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.7.0-1
- updated valgrind to 3.7.0
- replace all Patches (from fedora)

* Thu Nov 11 2010 Shu KONNO <owa@bg.wakwak.com> 3.6.0-1
- updated valgrind to 3.6.0
- updated BR: glibc-devel <= 2.12
- added BR: gcc <= 4.5
- added RQ: glibc <= 2.12

* Tue Oct 05 2010 Shu KONNO <owa@bg.wakwak.com> 3.5.0-1
- updated valgrind to 3.5.0
- added BR: glibc-devel >= 2.11
- split %{name}-devel
- added patches (from fedora core 12)
  - valgrind-3.5.0-cachegrind-improvements.patch
  - valgrind-3.5.0-openat.patch
  - valgrind-3.5.0-glibc-2.10.1.patch
  - valgrind-3.5.0-ifunc.patch
  - valgrind-3.5.0-inotify-init1.patch
  - valgrind-3.5.0-mmap-mprotect.patch
  - valgrind-3.5.0-dwarf3.patch
  - valgrind-3.5.0-pr40659.patch
  - valgrind-3.5.0-helgrind-race-supp.patch
  - valgrind-3.5.0-ppc-tests.patch
  - valgrind-3.5.0-amd64-loopnel.patch
  - valgrind-3.5.0-ppc-dwarf3.patch
  - valgrind-3.5.0-amd64-adcsbb.patch
  - valgrind-3.5.0-syscalls.patch
  - valgrind-3.5.0-preadv.patch
  - valgrind-3.5.0-glibc-2.11.patch

* Sun Apr 19 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 3.4.1-1vl5
- new upstream release
- changed Group to Development/Tools

* Sun Aug 24 2008 Shu KONNO <owa@bg.wakwak.com> 3.3.1-1vl5
- packaged new

