packaging: build for riscv64
[platform/upstream/libunwind.git] / packaging / libunwind.spec
index 40163a7..ddcb6c9 100644 (file)
@@ -1,18 +1,20 @@
 %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
+Version:        1.6.2
 Release:        0
-VCS:            profile/base/libunwind#upstream/1.1-0-g0349587-dirty
 Source:         libunwind-%{version}.tar.gz
-ExclusiveArch:  %ix86 x86_64 %arm 
+Source1001:    libunwind.manifest
+ExclusiveArch:  %ix86 x86_64 %arm aarch64 riscv64
+
+BuildRequires:  gcc-c++
+BuildRequires:  libtool
+BuildRequires:  pkg-config
 
 %description
 A portable and efficient C programming interface (API) to determine the
@@ -22,52 +24,65 @@ call chain of a program.
 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
+%if "%{hwasan}" == "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
+%{_libdir}/libunwind.so.*
+%{_libdir}/libunwind-*.so.*
 
 %files devel
+%manifest %{name}.manifest
 %defattr(-, root, root)
 %{_prefix}/include/*
-%{_libdir}/lib*.a
-%{_libdir}/libunwind-*.so
+%{_libdir}/libunwind*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
 %{_libdir}/pkgconfig/libunwind-coredump.pc
-%endif
-%doc %{_mandir}/man?/*
 
 %changelog
+
+%files tests
+%{testsdir}/*