From 53c7502341de95eee4c716a50ed1c5f027350af4 Mon Sep 17 00:00:00 2001 From: liyunfei Date: Mon, 28 Apr 2025 19:52:14 +0800 Subject: [PATCH] replace os_version with dist --- llvm-toolset-19.spec | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/llvm-toolset-19.spec b/llvm-toolset-19.spec index bee9d20..58ce720 100644 --- a/llvm-toolset-19.spec +++ b/llvm-toolset-19.spec @@ -4,19 +4,21 @@ %global min_ver 1 %global patch_ver 7 -%global os_version %{lua: print(tonumber(rpm.expand("%{dist}"):match("oe(%d+)") or 9999))} +%if "%dist" == "%nil" +%global dist .oe2403 +%endif # Build sys_llvm packages or compat packages %bcond_with sys_llvm %bcond_with check -%if %{os_version} <= 2203 +%if "%dist" < ".oe2403" %bcond_with toolchain_clang %else %bcond_without toolchain_clang %endif # mlir requires pybind11-2.9 but 22.03 only have pybind11-2.8 -%if %{os_version} <= 2203 +%if "%dist" < ".oe2403" %bcond_with mlir %else %bcond_without mlir @@ -79,7 +81,7 @@ %global llvm_triple %{_host} %global build_src_dir %{_builddir}/%{src_tarball_dir} -%if %{os_version} <= 2203 +%if "%dist" < ".oe2503" %global build_dir _build %else %global build_dir llvm/%{_vpath_builddir} @@ -149,7 +151,7 @@ #region main package Name: llvm-toolset-%{maj_ver} Version: %{maj_ver}.%{min_ver}.%{patch_ver} -Release: 6 +Release: 7 Summary: The Low Level Virtual Machine License: NCSA @@ -979,7 +981,7 @@ export ASMFLAGS="%{build_cflags}" extra_cmake_args='' #endregion cmake options -%if %{os_version} <= 2203 +%if "%dist" < ".oe2503" mkdir _build cd _build %define __cmake_in_source_build 1 @@ -1126,7 +1128,7 @@ cd %{build_src_dir}/_build_compiler-rt -DCMAKE_SKIP_RPATH:BOOL=ON \ -DCOMPILER_RT_INCLUDE_TESTS:BOOL=OFF # could be on? -%if %{os_version} <= 2203 +%if "%dist" < ".oe2403" %make_build %else %build_tool @@ -1140,7 +1142,7 @@ cd %{build_src_dir} %install #region LLVM installation -%if %{os_version} <= 2203 +%if "%dist" < ".oe2403" cd %{build_src_dir}/%{build_dir} %else cd %{build_src_dir}/llvm @@ -1156,7 +1158,7 @@ cd %{build_src_dir}/_build_openmp %install_tool cd %{build_src_dir}/_build_compiler-rt -%if %{os_version} > 2203 +%if "%dist" >= ".oe2403" %install_tool %else %make_install @@ -1377,7 +1379,7 @@ rm -rf %{buildroot}/%{install_datadir}/gdb %ifnarch %{ix86} # Remove files that we don't package, yet. -%if %{os_version} > 2203 +%if "%dist" >= ".oe2403" %if %{maj_ver} >= 20 rm %{buildroot}%{install_bindir}/llvm-offload-device-info %else @@ -2655,7 +2657,7 @@ fi %{install_libdir}/liblldb*.so %{install_libdir}/liblldb.so.* %{install_libdir}/liblldbIntelFeatures.so.* -%if %{os_version} > 2203 +%if "%dist" >= ".oe2403" %{_mandir}/man1/lldb-server%{exec_suffix}.1.gz %{_mandir}/man1/lldb%{exec_suffix}.1.gz %endif @@ -2814,6 +2816,10 @@ fi #endregion files %changelog +* Fri Apr 25 2025 liyunfei - 19.1.7-7 +- replace os_version with dist +- default dist to .oe2403 + * Tue Mar 11 2025 jchzhou - 19.1.7-6 - Fix two minor packaging issues -- Gitee