File google-breakpad.spec of Package google-breakpad

#
# spec file for package google-breakpad
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

%define toolsdir src/tools/linux
%define procdir src/processor
%define rtime 1512075600
%define rhash a61afe

Name:           google-breakpad
Version:        0+git%{rtime}.%{rhash}
Release:        0
Summary:        Breakpad is a library and tool suite that allows record crashes
License:        BSD-3-Clause
Group:          Development/Tools/Debuggers
Url:            http://code.google.com/p/google-breakpad
# curl https://chromium.googlesource.com/breakpad/breakpad/+archive/refs/heads/master.tar.gz -o breakpad-master.tar.gz
Source:         breakpad-master.tar.gz
# curl https://chromium.googlesource.com/linux-syscall-support/+archive/master.tar.gz -o linux-syscall-support-refs-heads-master.tar.gz
Source1:        linux-syscall-support-refs-heads-master.tar.gz
BuildRequires:  gcc-c++
BuildRequires:  glibc-devel

%description
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
crashed.

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.

%prep
%setup -q -T -D -c -n breakpad/src/third_party/lss -a 1
%setup -q -D -c -n breakpad

%build
%if 0%{?suse_version} > 1500 || 0%{?fedora_version} == 35
export CFLAGS="%{optflags} -fPIE -ffat-lto-objects"
export CXXFLAGS="$CFLAGS -Wno-error=deprecated -Wno-error=array-bounds -Wno-error=parentheses -Wno-error=mismatched-dealloc -Wno-error=maybe-uninitialized"
%else
%if 0%{?fedora_version} >= 36
export CFLAGS="%{optflags} -fPIE -ffat-lto-objects"
export CXXFLAGS="$CFLAGS -Wno-error=deprecated -Wno-error=array-bounds -Wno-error=parentheses -Wno-error=mismatched-dealloc -Wno-error=maybe-uninitialized -Wno-error=stringop-overflow"
%else
export CFLAGS="%{optflags} -fPIE"
export CXXFLAGS="$CFLAGS -Wno-error=deprecated -Wno-error=array-bounds -Wno-error=parentheses"
%endif
%endif
%configure
make %{?_smp_mflags} V=1

%install
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_libdir}
mkdir -p %{buildroot}%{_includedir}/google_breakpad

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

cp src/client/linux/libbreakpad_client.a %{buildroot}%{_libdir}
cp src/libbreakpad.a %{buildroot}%{_libdir}

copy_headers()
{
    srcdir=$1

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

cd src
copy_headers ./client/linux
copy_headers ./third_party/lss
copy_headers ./third_party
copy_headers ./common
copy_headers ./processor
copy_headers ./tools
cd google_breakpad
copy_headers ./

%post
%postun

%files
%defattr(-,root,root)
%doc AUTHORS LICENSE README.md
%{_bindir}/breakpad-*

%files devel
%defattr(-,root,root)
%{_libdir}/libbreakpad_client.a
%{_libdir}/libbreakpad.a
%dir %{_includedir}/google_breakpad
%{_includedir}/google_breakpad/*

%changelog
* Sun Nov 6 2022 Dmitry Ivanov <dm.vl.ivanov@gmail.com>
- Support for Fedora 36

* Wed Mar 14 2018 Dmitry Ivanov <dm.vl.ivanov@gmail.com>
- Add missing libbreakpad.a library

* Thu Nov 30 2017 - egdfree@opensuse.org
- initial
openSUSE Build Service is sponsored by