summaryrefslogtreecommitdiff
path: root/packaging/libunwind.spec
blob: 3e3d98c3bb152dbdc1d64e2867dde2edce89644f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
%define keepstatic 1
%define testsdir %{_libdir}/libunwind

Name:           libunwind
BuildRequires:  gcc-c++
BuildRequires:  libtool
BuildRequires:  pkg-config
Url:            http://savannah.nongnu.org/projects/libunwind/
Summary:        Unwind Library
License:        MIT
Group:          System/Libraries
Version:        1.1
Release:        0
VCS:            profile/base/libunwind#upstream/1.1-0-g0349587-dirty
Source:         libunwind-%{version}.tar.gz
Source1001: 	libunwind.manifest
ExclusiveArch:  %ix86 x86_64 %arm 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
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.

%package tests
Summary:	Package with binaries and data for libunwind tests

%description tests
This package contains installable tests in Bash.

%prep
%setup -q
cp %{SOURCE1001} .

%build
%if "%{asan}" == "1"
%restore_fcommon
%endif
autoreconf -fi
export CFLAGS="%optflags -U_FORTIFY_SOURCE"
%configure
make %{?_smp_mflags}
make -C tests test-ptrace


%install
%make_install
mkdir -p $RPM_BUILD_ROOT/%{_lib}
ln -sf /%{_libdir}/libunwind.so.8 $RPM_BUILD_ROOT%{_libdir}/libunwind.so
# Check that ln did not create a dangling link
stat %{buildroot}/$(readlink -f "%{buildroot}/%{_libdir}/libunwind.so");

mkdir -p %{buildroot}%{testsdir}
install -m 750 tests/.libs/test-ptrace %{buildroot}%{testsdir}
install -m 750 tests/test-ptrace-misc %{buildroot}%{testsdir}
install -m 750 tests/run-ptrace-misc %{buildroot}%{testsdir}

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%manifest %{name}.manifest
%license COPYING
%defattr(-, root, root)
%_libdir/lib*
%{_libdir}/lib*.so.*
%{_libdir}/libunwind.so

%files devel
%manifest %{name}.manifest
%defattr(-, root, root)
%{_prefix}/include/*
%{_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

%files tests
%{testsdir}/*