From 82abc5d4f5fc31a40eebb107cc7c9bdad5679d33 Mon Sep 17 00:00:00 2001 From: liyunfei Date: Tue, 25 Feb 2025 20:47:08 +0800 Subject: [PATCH] Bugfix for package name (cherry picked from commit 388a978e7611bd4702ac80323528467b89690a69) --- llvm-toolset-17.spec | 67 ++++++++++++++++++-------------------------- 1 file changed, 28 insertions(+), 39 deletions(-) diff --git a/llvm-toolset-17.spec b/llvm-toolset-17.spec index 24cfba0..bf3846d 100644 --- a/llvm-toolset-17.spec +++ b/llvm-toolset-17.spec @@ -115,7 +115,7 @@ #region LLD globals -%global pkg_name_libomp %{?scl_prefix}libomp +%global pkg_name_libomp %{?scl_prefix}openmp %global so_suffix %{maj_ver}.%{min_ver} @@ -137,7 +137,7 @@ #endregion globals #region MLIR globals -%global pkg_name_mlir %{?scl_prefix}mlir +%global pkg_name_mlir %{?scl_prefix}llvm-mlir #endregion MLIR globals #region libcxx globals @@ -150,7 +150,7 @@ #region main package Name: llvm-toolset-%{maj_ver} Version: %{maj_ver}.%{min_ver}.%{patch_ver} -Release: 3 +Release: 4 Summary: The Low Level Virtual Machine License: NCSA @@ -447,13 +447,13 @@ Development header files for clang tools. # Put git-clang-format in its own package, because it Requires git # and we don't want to force users to install all those dependenices if they # just want clang. -%package -n %{?scl_prefix}git-clang-format%{?pkg_suffix} +%package -n %{?scl_prefix}git-clang-format Summary: Integration of clang-format for git Requires: %{pkg_name_clang}-tools-extra = %{version}-%{release} Requires: git Requires: python3 -%description -n %{?scl_prefix}git-clang-format%{pkg_suffix} +%description -n %{?scl_prefix}git-clang-format clang-format integration for git. %if %{with sys_llvm} @@ -1417,7 +1417,7 @@ popd %endif #endregion libcxx installation -%if %{without sys_llvm} +%if %{without sys_llvm} && %{os_version} < 2403 # Add version suffix to binaries. Do this at the end so it includes any # additional binaries that may be been added by other steps. for f in %{buildroot}/%{install_bindir}/*; do @@ -1447,7 +1447,7 @@ touch %{buildroot}%{_bindir}/llvm-config-%{maj_ver} %else -rm %{buildroot}%{_bindir}/llvm-config%{exec_suffix} +rm -f %{buildroot}%{_bindir}/llvm-config%{exec_suffix} (cd %{buildroot}/%{install_bindir} ; ln -s llvm-config llvm-config%{exec_suffix}-%{__isa_bits} ) %endif @@ -1466,7 +1466,7 @@ install -m 0755 ../llvm-compat-libs/lib/liblldb.so.%{compat_maj_ver}* %{buildroo cat < %{buildroot}%{_scl_scripts}/enable # General environment variables export PATH=%{install_bindir}\${PATH:+:\${PATH}} -export MANPATH=%{install_datadir}:\${MANPATH} +export MANPATH=%{_mandir}:\${MANPATH} export PCP_DIR=%{_scl_root} # bz847911 workaround: @@ -1482,23 +1482,6 @@ export LD_LIBRARY_PATH=%{_scl_root}\$rpmlibdir\$rpmlibdir32:%{_scl_root}\$rpmlib EOF chmod 755 %{buildroot}%{_scl_scripts}/enable - -cat < %{buildroot}%{install_bindir}/sudo -#! /bin/sh -# TODO: parse & pass-through sudo options from \$@ -sudo_options="-E" - -for arg in "\$@" -do - case "\$arg" in - *\'*) - arg=`echo "\$arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - cmd_options="\$cmd_options '\$arg'" -done -exec /usr/bin/sudo \$sudo_options LD_LIBRARY_PATH=\$LD_LIBRARY_PATH PATH=\$PATH scl enable %{scl} "\$cmd_options" -EOF -chmod 775 %{buildroot}%{install_bindir}/sudo %endif #endregion install @@ -1912,11 +1895,11 @@ fi #endregion LLVM lit files #region LLVM files +%files -n llvm-toolset-%{maj_ver} +%{_scl_scripts}/enable %files -n %{pkg_name_llvm} %license llvm/LICENSE.TXT -%{_scl_scripts}/enable -%{install_bindir}/sudo %exclude %{_mandir}/man1/llvm-config* %{_mandir}/man1/bugpoint%{exec_suffix}.1.gz @@ -2073,7 +2056,7 @@ fi %{install_bindir}/llvm-tapi-diff %endif -%if %{without sys_llvm} +%if %{without sys_llvm} && %{os_version} < 2403 # This is for all the binaries with the version suffix. %{_bindir}/bugpoint%{exec_suffix} %{_bindir}/dsymutil%{exec_suffix} @@ -2247,7 +2230,7 @@ fi %{install_bindir}/lli-child-target %{install_bindir}/llvm-isel-fuzzer %{install_bindir}/llvm-opt-fuzzer -%if %{without sys_llvm} +%if %{without sys_llvm} && %{os_version} < 2403 %{_bindir}/not%{exec_suffix} %{_bindir}/count%{exec_suffix} %{_bindir}/yaml-bench%{exec_suffix} @@ -2287,7 +2270,8 @@ fi %if %{with sys_llvm} %{_mandir}/man1/clang.1.gz %{_mandir}/man1/clang++.1.gz -%else +%endif +%if %{without sys_llvm} && %{os_version} < 2403 %{_bindir}/clang-%{maj_ver} %{_bindir}/clang++-%{maj_ver} %{_bindir}/clang-cl-%{maj_ver} @@ -2308,7 +2292,7 @@ fi %{install_includedir}/clang-c/ %{install_libdir}/cmake/clang %{install_bindir}/clang-tblgen -%if %{without sys_llvm} +%if %{without sys_llvm} && %{os_version} < 2403 %{_bindir}/clang-tblgen-%{maj_ver} %endif %dir %{install_datadir}/clang/ @@ -2329,7 +2313,7 @@ fi %{install_bindir}/analyze-build %{install_bindir}/intercept-build %{install_bindir}/scan-build-py -%if %{without sys_llvm} +%if %{without sys_llvm} && %{os_version} < 2403 %{_bindir}/scan-view-%{maj_ver} %{_bindir}/scan-build-%{maj_ver} %{_bindir}/analyze-build-%{maj_ver} @@ -2388,7 +2372,7 @@ fi %{install_bindir}/clang-pseudo %{install_bindir}/clang-rename %endif -%if %{without sys_llvm} +%if %{without sys_llvm} && %{os_version} < 2403 %{_bindir}/amdgpu-arch-%{maj_ver} %{_bindir}/clang-apply-replacements-%{maj_ver} %{_bindir}/clang-change-namespace-%{maj_ver} @@ -2425,7 +2409,8 @@ fi %{_bindir}/clang-pseudo-%{maj_ver} %{_bindir}/clang-rename-%{maj_ver} %endif -%else +%endif +%if %{with sys_llvm} %{_emacs_sitestartdir}/clang-format.el %if %{maj_ver} < 20 %{_emacs_sitestartdir}/clang-rename.el @@ -2447,10 +2432,10 @@ fi %license clang-tools-extra/LICENSE.TXT %{install_includedir}/clang-tidy/ -%files -n %{?scl_prefix}git-clang-format%{pkg_suffix} +%files -n %{?scl_prefix}git-clang-format %license clang/LICENSE.TXT %{install_bindir}/git-clang-format -%if %{without sys_llvm} +%if %{without sys_llvm} && %{os_version} < 2403 %{_bindir}/git-clang-format-%{maj_ver} %endif @@ -2567,7 +2552,8 @@ fi %{install_bindir}/wasm-ld %if %{with sys_llvm} %{_mandir}/man1/ld.lld.1* -%else +%endif +%if %{without sys_llvm} && %{os_version} < 2403 %{_bindir}/lld%{exec_suffix} %{_bindir}/lld-link%{exec_suffix} %{_bindir}/ld.lld%{exec_suffix} @@ -2609,7 +2595,7 @@ fi %files -n %{pkg_name_lldb} %license lldb/LICENSE.TXT %{install_bindir}/lldb* -%if %{without sys_llvm} +%if %{without sys_llvm} && %{os_version} < 2403 %{_bindir}/lldb* %endif # Usually, *.so symlinks are kept in devel subpackages. However, the python @@ -2666,7 +2652,7 @@ fi %if %{maj_ver} >= 20 %{install_bindir}/mlir-rewrite %endif -%if %{without sys_llvm} +%if %{without sys_llvm} && %{os_version} < 2403 %{_bindir}/mlir-tblgen-%{maj_ver} %{_bindir}/mlir-pdll-%{maj_ver} %{_bindir}/mlir-cpu-runner-%{maj_ver} @@ -2764,6 +2750,9 @@ fi #endregion files %changelog +* Tue Feb 25 2025 liyunfei - 17.0.6-4 +- Bugfix for package name & clang-17 conflict + * Fri Feb 21 2025 laokz - 17.0.6-3 - riscv64: exclude packaging non-supported liborc_rt.a -- Gitee