From 61b88a3e5ce2816e57d58777ddf41a4a5ad717c3 Mon Sep 17 00:00:00 2001 From: liyunfei Date: Wed, 23 Aug 2023 15:36:38 +0800 Subject: [PATCH] Change the install path (cherry picked from commit 846a45e4973110baba9ffd8dbdc081d6855c9d0f) --- libunwind.spec | 47 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 11 deletions(-) diff --git a/libunwind.spec b/libunwind.spec index 886d93a..492d13b 100644 --- a/libunwind.spec +++ b/libunwind.spec @@ -1,11 +1,27 @@ +%bcond_with sys_llvm +%bcond_without check + %global maj_ver 12 %global min_ver 0 %global patch_ver 1 %global debug_package %{nil} -Name: llvm-libunwind -Version: 12.0.1 -Release: 1 +%if %{with sys_llvm} +%global pkg_name llvm-libunwind +%global install_prefix %{_prefix} +%else +%global pkg_name llvm-libunwind%{maj_ver} +%global install_prefix %{_libdir}/llvm%{maj_ver} +%endif + +%global install_libdir %{install_prefix}/%{_lib} +%global install_includedir %{install_prefix}/include + +%global unwind_version %{maj_ver}.%{min_ver}.%{patch_ver} + +Name: %{pkg_name} +Version: %{unwind_version} +Release: 2 Summary: LLVM "libunwind" runtime libraries License: BSD URL: http://llvm.org @@ -17,7 +33,13 @@ BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: cmake BuildRequires: python3 -BuildRequires: llvm-devel +%if %{with sys_llvm} +BuildRequires: llvm-devel = %{version} +BuildRequires: llvm-test = %{version} +%else +BuildRequires: llvm%{maj_ver}-devel = %{version} +BuildRequires: llvm%{maj_ver}-test = %{version} +%endif %description The libunwind-devel package includes the libraries and header files for @@ -40,8 +62,8 @@ mkdir -p _build cd _build cmake \ - -DLLVM_CMAKE_PATH=%{_libdir}/cmake/llvm \ - -DCMAKE_INSTALL_PREFIX=%{_prefix} \ + -DLLVM_CMAKE_PATH=%{install_libdir}/cmake/llvm \ + -DCMAKE_INSTALL_PREFIX=%{install_prefix} \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DLIBUNWIND_ENABLE_STATIC=OFF \ %if 0%{?__isa_bits} == 64 @@ -61,20 +83,23 @@ cd _build # https://gitee.com/src-openeuler/libunwind # ABI wise, even though llvm-libunwind's library is named libunwind, it doesn't # have the exact same ABI has gcc's libunwind (it actually provides a subset). -mkdir -p %{buildroot}/%{_libdir}/llvm-unwind/ -mv %{buildroot}%{_libdir}/libunwind* %{buildroot}/%{_libdir}/llvm-unwind/ +mkdir -p %{buildroot}/%{install_libdir}/llvm-unwind/ +mv %{buildroot}%{install_libdir}/libunwind* %{buildroot}/%{install_libdir}/llvm-unwind/ %files %license LICENSE.TXT -%dir %{_libdir}/llvm-unwind -%{_libdir}/llvm-unwind/libunwind.so.* +%dir %{install_libdir}/llvm-unwind +%{install_libdir}/llvm-unwind/libunwind.so.* %files devel -%{_libdir}/llvm-unwind/libunwind.so +%{install_libdir}/llvm-unwind/libunwind.so %changelog +* Wed Aug 23 2023 liyunfei - 12.0.1-2 +- Change the install path + * Tue Feb 7 2023 Wang Zehong - 12.0.1-1 - update to 12.0.1-1 -- Gitee