3e3d98c3bb152dbdc1d64e2867dde2edce89644f
[platform/upstream/libunwind.git] / packaging / libunwind.spec
1 %define keepstatic 1
2 %define testsdir %{_libdir}/libunwind
3
4 Name:           libunwind
5 BuildRequires:  gcc-c++
6 BuildRequires:  libtool
7 BuildRequires:  pkg-config
8 Url:            http://savannah.nongnu.org/projects/libunwind/
9 Summary:        Unwind Library
10 License:        MIT
11 Group:          System/Libraries
12 Version:        1.1
13 Release:        0
14 VCS:            profile/base/libunwind#upstream/1.1-0-g0349587-dirty
15 Source:         libunwind-%{version}.tar.gz
16 Source1001:     libunwind.manifest
17 ExclusiveArch:  %ix86 x86_64 %arm aarch64
18
19 %description
20 A portable and efficient C programming interface (API) to determine the
21 call chain of a program.
22
23 %package devel
24 Summary:        Unwind library
25 Group:          Development/Libraries
26 Requires:       libunwind = %{version}-%{release}
27 Provides:       libunwind:%{_libdir}/libunwind.so
28
29 %description devel
30 A portable and efficient C programming interface (API) to determine the
31 call-chain of a program.
32
33 %package tests
34 Summary:        Package with binaries and data for libunwind tests
35
36 %description tests
37 This package contains installable tests in Bash.
38
39 %prep
40 %setup -q
41 cp %{SOURCE1001} .
42
43 %build
44 %if "%{asan}" == "1"
45 %restore_fcommon
46 %endif
47 autoreconf -fi
48 export CFLAGS="%optflags -U_FORTIFY_SOURCE"
49 %configure
50 make %{?_smp_mflags}
51 make -C tests test-ptrace
52
53
54 %install
55 %make_install
56 mkdir -p $RPM_BUILD_ROOT/%{_lib}
57 ln -sf /%{_libdir}/libunwind.so.8 $RPM_BUILD_ROOT%{_libdir}/libunwind.so
58 # Check that ln did not create a dangling link
59 stat %{buildroot}/$(readlink -f "%{buildroot}/%{_libdir}/libunwind.so");
60
61 mkdir -p %{buildroot}%{testsdir}
62 install -m 750 tests/.libs/test-ptrace %{buildroot}%{testsdir}
63 install -m 750 tests/test-ptrace-misc %{buildroot}%{testsdir}
64 install -m 750 tests/run-ptrace-misc %{buildroot}%{testsdir}
65
66 %post -p /sbin/ldconfig
67
68 %postun -p /sbin/ldconfig
69
70 %files
71 %manifest %{name}.manifest
72 %license COPYING
73 %defattr(-, root, root)
74 %_libdir/lib*
75 %{_libdir}/lib*.so.*
76 %{_libdir}/libunwind.so
77
78 %files devel
79 %manifest %{name}.manifest
80 %defattr(-, root, root)
81 %{_prefix}/include/*
82 %{_libdir}/lib*.a
83 %{_libdir}/libunwind-*.so
84 %{_libdir}/pkgconfig/libunwind-generic.pc
85 %{_libdir}/pkgconfig/libunwind-ptrace.pc
86 %{_libdir}/pkgconfig/libunwind-setjmp.pc
87 %{_libdir}/pkgconfig/libunwind.pc
88 %ifarch %arm %ix86 x86_64 aarch64
89 %{_libdir}/pkgconfig/libunwind-coredump.pc
90 %endif
91 %doc %{_mandir}/man?/*
92
93 %changelog
94
95 %files tests
96 %{testsdir}/*