File google-breakpad.spec of Package google-breakpad

%define toolsdir src/tools/linux
%define procdir src/processor
%define includedir %{_includedir}/google_breakpad

Summary: A multi-platform crash reporting system
Name: google-breakpad
Version: r913
License: BSD
Release: 1
Group: Development/Tools/Debuggers
Source: %{name}-%{version}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: gcc-c++ glibc-devel

Breakpad is a library and tool suite that allows you to distribute an
application to users with compiler-provided debugging information
removed, record crashes in compact "minidump" files, send them back to
your server, and produce C and C++ stack traces from these minidumps.
Breakpad can also write minidumps on request for programs that have not

Breakpad is currently used by Google Chrome, Firefox, Google Picasa,
Camino, Google Earth, and other projects.

%package        devel
Summary:        Development package google-breakpad
Group:          Development/Libraries/C and C++

%description    devel
This package contains all that is needed to develop/compile
applications that use the google breakpad libraries.

%setup -n %{name}

LIBS='-ldl' configure \
    --bindir=%{_bindir} \
    --libdir=%{_libdir} \

mkdir -p $RPM_BUILD_ROOT%{_bindir}
mkdir -p $RPM_BUILD_ROOT%{_libdir}
mkdir -p $RPM_BUILD_ROOT%{includedir}

cp %{toolsdir}/core2md/core2md $RPM_BUILD_ROOT/%{_bindir}/breakpad-core2md
cp %{toolsdir}/dump_syms/dump_syms $RPM_BUILD_ROOT/%{_bindir}/breakpad-dumpsyms
cp %{toolsdir}/md2core/minidump-2-core $RPM_BUILD_ROOT/%{_bindir}/breakpad-md2core
cp %{toolsdir}/symupload/minidump_upload $RPM_BUILD_ROOT/%{_bindir}/breakpad-mdupload
cp %{toolsdir}/symupload/sym_upload $RPM_BUILD_ROOT/%{_bindir}/breakpad-symupload
cp %{procdir}/minidump_stackwalk $RPM_BUILD_ROOT/%{_bindir}/breakpad-stackwalk
cp %{procdir}/minidump_dump $RPM_BUILD_ROOT/%{_bindir}/breakpad-dump

cp src/client/linux/libbreakpad_client.a $RPM_BUILD_ROOT%{_libdir}


    for i in $(find $srcdir -name "*.h");
	destdir=$(echo $RPM_BUILD_ROOT%{includedir}/$(dirname $i) | sed "s|\./||")
	mkdir -p $destdir
	cp $i $destdir

cd src
copy_headers ./client/linux
copy_headers ./processor
cd google_breakpad
copy_headers ./

make clean


%files devel
%dir %{includedir}