File libunwind.spec of Package libunwind

#
# spec file for package libunwind
#
# Copyright (c) 2016 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/
#


Name:           libunwind
Version:        1.1
Release:        0
Summary:        Unwind Library
License:        MIT
Group:          System/Base
Url:            http://savannah.nongnu.org/projects/libunwind/
Source0:        http://download.savannah.gnu.org/releases/libunwind/libunwind-%{version}.tar.gz
Source1:        http://download.savannah.gnu.org/releases/libunwind/libunwind-%{version}.tar.gz.sig
Source2:        %{name}.keyring
Source3:        baselibs.conf
Patch0:         libunwind-1.1-tests.diff
#PATCH-FIX-UPSTREAM: upstream commit ae3dd9417a3d178cf51ce744d85b695dbf025b44
Patch1:         libunwind-1.1-expected-fails.patch
# PATCH-FIX-UPSTREAM: upstream commit ac6c0a6
Patch2:         libunwind-aarch64.patch
# PATCH-FIX-UPSTREAM: uweigand@de.ibm.com -- submitted to libunwind-devel
Patch3:         libunwind-ppc64le.patch
# PATCH-FIX-UPSTREAM: bnc#936786 CVE-2015-3239
Patch4:         libunwind-CVE-2015-3239.patch
# PATCH-FIX-UPSTREAM: boo#976955
Patch5:         0001-Mark-run-ptrace-mapper-and-run-ptrace-misc-as-XFAIL-.patch
# PATCH-FIX-UPSTREAM: boo#976955
Patch6:         0002-Mark-run-ptrace-mapper-and-run-ptrace-misc-as-XFAIL-.patch
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  gcc-c++
BuildRequires:  libatomic_ops-devel
BuildRequires:  libtool
BuildRequires:  pkg-config
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
ExclusiveArch:  %ix86 ia64 x86_64 %arm ppc ppc64 ppc64le aarch64

%description
A portable and efficient C programming interface (API) to determine the
call chain of a program.

%package devel
Summary:        Unwind library
Group:          Development/Libraries/C and C++
Requires:       libunwind = %{version}-%{release}
Provides:       libunwind:%{_libdir}/libunwind.so

%description devel
A portable and efficient C programming interface (API) to determine the
call-chain of a program.

%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1

%build
autoreconf -fvi
%configure
make %{?_smp_mflags}

%check
%if ! 0%{?qemu_user_space_build:1}
make check %{?_smp_mflags} || :
%endif

%install
make DESTDIR=%{buildroot} install %{?_smp_mflags}
find %{buildroot} -type f -name "*.la" -delete -print
mkdir -p %{buildroot}/%{_lib}
mv %{buildroot}%{_libdir}/libunwind.so.8* %{buildroot}/%{_lib}
ln -sf /%{_lib}/libunwind.so.8 %{buildroot}%{_libdir}/libunwind.so
# Check that ln did not create a dangling link
stat %{buildroot}/$(readlink -f "%{buildroot}/%{_libdir}/libunwind.so");

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-, root, root)
/%{_lib}/lib*
%{_libdir}/lib*.so.*
%{_libdir}/libunwind.so

%files devel
%defattr(-, root, root)
%{_includedir}/*
%{_libdir}/lib*.a
%{_libdir}/libunwind-*.so
%{_libdir}/pkgconfig/libunwind-generic.pc
%{_libdir}/pkgconfig/libunwind-ptrace.pc
%{_libdir}/pkgconfig/libunwind-setjmp.pc
%{_libdir}/pkgconfig/libunwind.pc
%ifarch %arm %ix86 x86_64 aarch64
%{_libdir}/pkgconfig/libunwind-coredump.pc
%endif
%doc %{_mandir}/man?/*

%changelog
openSUSE Build Service is sponsored by