30e226
# rpmbuild parameters:
30e226
# --without check: Do not run the testsuite.  Default is to run it.
30e226
30e226
Summary: An unwinding library
30e226
Name: libunwind
14df22
Epoch: 2
0ce454
Version: 1.2
0ce454
Release: 2%{?dist}
30e226
License: BSD
30e226
Group: Development/Debuggers
30e226
Source: http://download.savannah.gnu.org/releases/libunwind/libunwind-%{version}.tar.gz
0ce454
0ce454
Patch2: 0002-Fix-rpmdiff-failure.patch
0ce454
30e226
URL: http://savannah.nongnu.org/projects/libunwind
0ce454
ExclusiveArch: %{arm} aarch64 %{ix86} x86_64 %{power64}
30e226
30e226
BuildRequires: automake libtool autoconf
30e226
30e226
# host != target would cause REMOTE_ONLY build even if building i386 on x86_64.
30e226
%global _host %{_target_platform}
30e226
30e226
%description
30e226
Libunwind provides a C ABI to determine the call-chain of a program.
30e226
30e226
%package devel
30e226
Summary: Development package for libunwind
30e226
Group: Development/Debuggers
14df22
Requires: libunwind = %{epoch}:%{version}-%{release}
30e226
30e226
%description devel
30e226
The libunwind-devel package includes the libraries and header files for
30e226
libunwind.
30e226
30e226
%prep
30e226
%setup -q
0ce454
30e226
%patch2 -p1
30e226
30e226
%build
30e226
aclocal
30e226
libtoolize --force
30e226
autoheader
30e226
automake --add-missing
30e226
autoconf
0ce454
%configure --enable-static --enable-shared --disable-setjmp
30e226
make %{?_smp_mflags}
30e226
30e226
%install
30e226
make install DESTDIR=$RPM_BUILD_ROOT
30e226
find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
30e226
30e226
# /usr/include/libunwind-ptrace.h
30e226
# [...] aren't really part of the libunwind API.  They are implemented in
30e226
# a archive library called libunwind-ptrace.a.
30e226
mv -f $RPM_BUILD_ROOT%{_libdir}/libunwind-ptrace.a $RPM_BUILD_ROOT%{_libdir}/libunwind-ptrace.a-save
30e226
rm -f $RPM_BUILD_ROOT%{_libdir}/libunwind*.a
30e226
mv -f $RPM_BUILD_ROOT%{_libdir}/libunwind-ptrace.a-save $RPM_BUILD_ROOT%{_libdir}/libunwind-ptrace.a
30e226
rm -f $RPM_BUILD_ROOT%{_libdir}/libunwind-ptrace*.so*
30e226
0ce454
#Copy doc files manually as we do not have latex2man in Red Hat Enterprise Linux
0ce454
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man3
0ce454
cd doc
0ce454
for fn in *.man; do
0ce454
  install -c -m 644 $fn $RPM_BUILD_ROOT%{_mandir}/man3/${fn%.man}.3
0ce454
done
0ce454
cd ..
0ce454
30e226
%check
30e226
%if 0%{?_with_check:1} || 0%{?_with_testsuite:1}
30e226
echo ====================TESTING=========================
30e226
make check || true
30e226
echo ====================TESTING END=====================
30e226
%else
30e226
echo ====================TESTSUITE DISABLED=========================
30e226
%endif
30e226
30e226
%post -p /sbin/ldconfig
30e226
30e226
%postun -p /sbin/ldconfig
30e226
30e226
%files
30e226
%defattr(-,root,root,-)
30e226
%doc COPYING README NEWS
30e226
%{_libdir}/libunwind*.so.*
30e226
30e226
%files devel
30e226
%defattr(-,root,root,-)
30e226
%{_libdir}/libunwind*.so
30e226
%{_libdir}/libunwind-ptrace.a
30e226
%{_libdir}/pkgconfig/libunwind*.pc
0ce454
%{_mandir}/man3/*
30e226
# <unwind.h> does not get installed for REMOTE_ONLY targets - check it.
30e226
%{_includedir}/unwind.h
30e226
%{_includedir}/libunwind*.h
30e226
30e226
%changelog
0ce454
* Mon Feb 27 2017 Miroslav Rezanina <mrezanin@redhat.com> 1.2-2.el7
0ce454
- Rebase to 1.2 [bz#1384435]
0ce454
- Resolves: bz#1384435
0ce454
  (Rebase libunwind package (and add for ppc64le): libunwind)
0ce454
0ce454
* Thu Jan 28 2016 Miroslav Rezanina <mrezanin@redhat.com> 1.1-6.el7
14df22
- Fix update from EPEL version [bz#1289950]
14df22
- Resolves: bz#1289950
14df22
  (libunwind in RHEL 7.2 has a smaller release than the last libunwind package in EPEL-7)
14df22
0ce454
* Wed Jul 29 2015 Miroslav Rezanina <mrezanin@redhat.com> 1.1-5
30e226
- Version bumped [bz#1238864]
30e226
- Resolves: bz#1238864
30e226
  libunwind: bump version to win against existing branches
30e226
30e226
* Fri Jun 19 2015 Miroslav Rezanina <mrezanin@redhat.com> 1.1-2
30e226
- lu-Fix-rpmdiff-failure.patch [bz#1229359]
30e226
- lu-Fix-buffer-overflow-reported-by-Coverity.patch [bz#1233114]
30e226
- Resolves: bz#1229359
30e226
  (Fix multilib support)
30e226
- Resolves: bz#1233114
30e226
  (fix off-by-one in dwarf_to_unw_regnum (CVE-2015-3239))
30e226
30e226
* Tue Jun 02 2015 Miroslav Rezanina <mrezanin@redhat.com> 1.1-1
30e226
- Import to RHEL