|
226 | 226 | #region main package |
227 | 227 | Name: %{pkg_name_llvm} |
228 | 228 | Version: %{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:~rc%{rc_ver}}%{?llvm_snapshot_version_suffix:~%{llvm_snapshot_version_suffix}} |
229 | | -Release: 5%{?dist} |
| 229 | +Release: 6%{?dist} |
230 | 230 | Summary: The Low Level Virtual Machine |
231 | 231 |
|
232 | 232 | License: Apache-2.0 WITH LLVM-exception OR NCSA |
@@ -1768,37 +1768,25 @@ rmdir %{buildroot}%{install_mandir}/man1 |
1768 | 1768 | rmdir %{buildroot}%{install_mandir} |
1769 | 1769 |
|
1770 | 1770 | %if %{without compat_build} |
| 1771 | +# We don't create directory symlinks, because RPM does not support |
| 1772 | +# switching between a directory and a symlink, causing upgrade/downgrade issues. |
| 1773 | +# Instead, recursively copy the directories while creating symlinks. |
| 1774 | +copy_with_relative_symlinks() { |
| 1775 | + local src="$1" |
| 1776 | + local dest="$2" |
| 1777 | + mkdir -p "$dest" |
| 1778 | + |
| 1779 | + # Change to source directory to simplify relative paths |
| 1780 | + (cd "$src" && \ |
| 1781 | + find * -type d -exec mkdir -p "$dest/{}" \; && \ |
| 1782 | + find * \( -type f -o -type l \) -exec ln -s --relative "$src/{}" "$dest/{}" \;) |
| 1783 | +} |
| 1784 | + |
1771 | 1785 | # Add symlinks for libraries. |
1772 | | -mkdir -p %{buildroot}%{_libdir} |
1773 | | -for f in %{buildroot}%{install_libdir}/*; do |
1774 | | - filename=`basename $f` |
1775 | | - if [ "$filename" != "cmake" ]; then |
1776 | | - ln -s ../../%{install_libdir}/$filename %{buildroot}/%{_libdir}/$filename |
1777 | | - fi |
1778 | | -done |
1779 | | -# Special handling for cmake, as we don't own the cmake directory itself. |
1780 | | -mkdir -p %{buildroot}%{_libdir}/cmake |
1781 | | -for f in %{buildroot}%{install_libdir}/cmake/*; do |
1782 | | - filename=`basename $f` |
1783 | | - ln -s ../../../%{install_libdir}/cmake/$filename %{buildroot}/%{_libdir}/cmake/$filename |
1784 | | -done |
1785 | | -mkdir -p %{buildroot}%{_libexecdir} |
1786 | | -for f in %{buildroot}%{install_libexecdir}/*; do |
1787 | | - filename=`basename $f` |
1788 | | - ln -s ../../%{install_libexecdir}/$filename %{buildroot}/%{_libexecdir}/$filename |
1789 | | -done |
1790 | | -# Add symlinks for include directories. |
1791 | | -mkdir -p %{buildroot}%{_includedir} |
1792 | | -for f in %{buildroot}%{install_includedir}/*; do |
1793 | | - filename=`basename $f` |
1794 | | - ln -s ../../%{install_includedir}/$filename %{buildroot}/%{_includedir}/$filename |
1795 | | -done |
1796 | | -# Add symlinks for data directories. |
1797 | | -mkdir -p %{buildroot}%{_datadir} |
1798 | | -for f in %{buildroot}%{install_datadir}/*; do |
1799 | | - filename=`basename $f` |
1800 | | - ln -s ../../%{install_datadir}/$filename %{buildroot}/%{_datadir}/$filename |
1801 | | -done |
| 1786 | +copy_with_relative_symlinks %{buildroot}%{install_libdir} %{buildroot}%{_libdir} |
| 1787 | +copy_with_relative_symlinks %{buildroot}%{install_libexecdir} %{buildroot}%{_libexecdir} |
| 1788 | +copy_with_relative_symlinks %{buildroot}%{install_includedir} %{buildroot}%{_includedir} |
| 1789 | +copy_with_relative_symlinks %{buildroot}%{install_datadir} %{buildroot}%{_datadir} |
1802 | 1790 | %endif |
1803 | 1791 |
|
1804 | 1792 | # ghost presence for llvm-config, managed by alternatives. |
@@ -2315,58 +2303,6 @@ fi |
2315 | 2303 | %define expand_includes() %{expand_generic -d %{_includedir} -i %{install_includedir} %*} |
2316 | 2304 | %define expand_datas() %{expand_generic -d %{_datadir} -i %{install_datadir} %*} |
2317 | 2305 |
|
2318 | | - |
2319 | | -# The pretrans_rpmmove_dirs macro exists for packages to replace directories |
2320 | | -# with symbolic links which normally is not possible with RPM. The trick is to |
2321 | | -# use the generated scriptlet below to rename existing directories before |
2322 | | -# replacing them with a symbolic link. |
2323 | | -# |
2324 | | -# Make sure you call this macro at the end of a %%files section for a package. |
2325 | | -# This macro will then automatically add the %%ghost entries for the moved |
2326 | | -# paths for you. |
2327 | | -# |
2328 | | -# When building in compat mode, the pretrans_rpmmove_dirs macro does nothing. |
2329 | | -# |
2330 | | -# See this page for a detailed problem description: |
2331 | | -# https://docs.fedoraproject.org/en-US/packaging-guidelines/Directory_Replacement/ |
2332 | | -%if %{with compat_build} |
2333 | | -%define pretrans_rpmmove_dirs(n:) %{nil} |
2334 | | -%else |
2335 | | -%define pretrans_rpmmove_dirs(n:) %{lua: |
2336 | | -local packagename = string.gsub(rpm.expand("%{-n*}"), "%s*", "") |
2337 | | -local paths_str = '"'..string.gsub(rpm.expand("%*"), "%s+", '",\\n"') |
2338 | | -paths_str = string.sub(paths_str,0,-4) |
2339 | | - |
2340 | | -for i = 1, rpm.expand("%#") do |
2341 | | - print('%ghost '..string.gsub(rpm.expand([[%]]..i), "%s+", "")..'.rpmmoved\\n') \ |
2342 | | -end |
2343 | | - |
2344 | | -print("\\n%pretrans -n " .. packagename .. " -p <lua> \\n") |
2345 | | -print("local paths={\\n") |
2346 | | -print(paths_str..'\\n') |
2347 | | -print("}\\n") |
2348 | | -print([[ |
2349 | | -for _, path in ipairs(paths) do |
2350 | | - st = posix.stat(path) |
2351 | | - if st and st.type == "directory" then |
2352 | | - status = os.rename(path, path .. ".rpmmoved") |
2353 | | - if not status then |
2354 | | - suffix = 0 |
2355 | | - while not status do |
2356 | | - suffix = suffix + 1 |
2357 | | - status = os.rename(path .. ".rpmmoved", path .. ".rpmmoved." .. suffix) |
2358 | | - end |
2359 | | - os.rename(path, path .. ".rpmmoved") |
2360 | | - end |
2361 | | - end |
2362 | | -end |
2363 | | -]]) |
2364 | | --- Remove the following "end" and you'll get this error: |
2365 | | --- error: invalid syntax in lua scriptlet: [string "%pretrans"]:20: unexpected symbol near '#' |
2366 | | -print("\\n%end") |
2367 | | -} |
2368 | | -%endif |
2369 | | - |
2370 | 2306 | #region LLVM lit files |
2371 | 2307 | %if %{with python_lit} |
2372 | 2308 | %files -n python%{python3_pkgversion}-lit |
@@ -2537,10 +2473,6 @@ print("\\n%end") |
2537 | 2473 |
|
2538 | 2474 | %expand_datas opt-viewer |
2539 | 2475 |
|
2540 | | -%{pretrans_rpmmove_dirs -n %{pkg_name_llvm} |
2541 | | - %{_datadir}/opt-viewer |
2542 | | -} |
2543 | | - |
2544 | 2476 | %files -n %{pkg_name_llvm}-libs |
2545 | 2477 | %license llvm/LICENSE.TXT |
2546 | 2478 | %{expand_libs %{expand: |
@@ -2579,12 +2511,6 @@ print("\\n%end") |
2579 | 2511 | cmake/llvm |
2580 | 2512 | }} |
2581 | 2513 |
|
2582 | | -%{pretrans_rpmmove_dirs -n %{pkg_name_llvm}-devel |
2583 | | - %{_includedir}/llvm-c |
2584 | | - %{_includedir}/llvm |
2585 | | - %{_libdir}/cmake/llvm |
2586 | | -} |
2587 | | - |
2588 | 2514 | %files -n %{pkg_name_llvm}-doc |
2589 | 2515 | %license llvm/LICENSE.TXT |
2590 | 2516 | %doc %{_pkgdocdir}/html/index.html |
@@ -2624,11 +2550,6 @@ print("\\n%end") |
2624 | 2550 | }} |
2625 | 2551 | %expand_includes llvm-gtest llvm-gmock |
2626 | 2552 |
|
2627 | | -%{pretrans_rpmmove_dirs -n %{pkg_name_llvm}-googletest |
2628 | | - %{_includedir}/llvm-gmock |
2629 | | - %{_includedir}/llvm-gtest |
2630 | | -} |
2631 | | - |
2632 | 2553 | %if %{with snapshot_build} |
2633 | 2554 | %files -n %{pkg_name_llvm}-build-stats |
2634 | 2555 | %{_datadir}/.ninja_log |
@@ -2686,16 +2607,9 @@ print("\\n%end") |
2686 | 2607 | %expand_bins clang-tblgen |
2687 | 2608 | %dir %{install_datadir}/clang/ |
2688 | 2609 | %if %{without compat_build} |
2689 | | -%{_datadir}/clang |
| 2610 | +%dir %{_datadir}/clang |
2690 | 2611 | %endif |
2691 | 2612 |
|
2692 | | -%{pretrans_rpmmove_dirs -n %{pkg_name_clang}-devel |
2693 | | - %{_includedir}/clang-c |
2694 | | - %{_includedir}/clang |
2695 | | - %{_libdir}/cmake/clang |
2696 | | - %{_datadir}/clang |
2697 | | -} |
2698 | | - |
2699 | 2613 | %files -n %{pkg_name_clang}-resource-filesystem |
2700 | 2614 | %license clang/LICENSE.TXT |
2701 | 2615 | %dir %{_prefix}/lib/clang/ |
@@ -2730,11 +2644,6 @@ print("\\n%end") |
2730 | 2644 | %{python3_sitelib}/libscanbuild |
2731 | 2645 | %endif |
2732 | 2646 |
|
2733 | | -%{pretrans_rpmmove_dirs -n %{pkg_name_clang}-analyzer |
2734 | | - %{_datadir}/scan-build |
2735 | | - %{_datadir}/scan-view |
2736 | | -} |
2737 | | - |
2738 | 2647 | %files -n %{pkg_name_clang}-tools-extra |
2739 | 2648 | %license clang-tools-extra/LICENSE.TXT |
2740 | 2649 | %{expand_bins %{expand: |
@@ -2784,25 +2693,22 @@ print("\\n%end") |
2784 | 2693 | %{_emacs_sitestartdir}/clang-include-fixer.el |
2785 | 2694 | %endif |
2786 | 2695 | %expand_mans diagtool extraclangtools |
2787 | | -# Do not use expand_datas here, as we'll create a symlink for the clang dir. |
2788 | | -%{install_datadir}/clang/clang-format.py* |
2789 | | -%{install_datadir}/clang/clang-format-diff.py* |
2790 | | -%{install_datadir}/clang/clang-include-fixer.py* |
2791 | | -%{install_datadir}/clang/clang-tidy-diff.py* |
2792 | | -%{install_datadir}/clang/run-find-all-symbols.py* |
| 2696 | +%{expand_datas %{expand: |
| 2697 | + clang/clang-format.py* |
| 2698 | + clang/clang-format-diff.py* |
| 2699 | + clang/clang-include-fixer.py* |
| 2700 | + clang/clang-tidy-diff.py* |
| 2701 | + clang/run-find-all-symbols.py* |
| 2702 | +}} |
2793 | 2703 | %if %{maj_ver} < 20 |
2794 | | -%{install_datadir}/clang/clang-rename.py* |
| 2704 | +%expand_datas /clang/clang-rename.py* |
2795 | 2705 | %endif |
2796 | 2706 |
|
2797 | 2707 |
|
2798 | 2708 | %files -n %{pkg_name_clang}-tools-extra-devel |
2799 | 2709 | %license clang-tools-extra/LICENSE.TXT |
2800 | 2710 | %expand_includes clang-tidy |
2801 | 2711 |
|
2802 | | -%{pretrans_rpmmove_dirs -n %{pkg_name_clang}-tools-extra-devel |
2803 | | - %{_includedir}/clang-tidy |
2804 | | -} |
2805 | | - |
2806 | 2712 | %files -n git-clang-format%{pkg_suffix} |
2807 | 2713 | %license clang/LICENSE.TXT |
2808 | 2714 | %expand_bins git-clang-format |
@@ -2892,12 +2798,6 @@ print("\\n%end") |
2892 | 2798 | %expand_includes offload |
2893 | 2799 | %endif |
2894 | 2800 | %endif |
2895 | | - |
2896 | | -%{pretrans_rpmmove_dirs -n %{pkg_name_libomp}-devel |
2897 | | - %{_includedir}/offload |
2898 | | - %{_libdir}/cmake/openmp |
2899 | | -} |
2900 | | - |
2901 | 2801 | #endregion OPENMP files |
2902 | 2802 |
|
2903 | 2803 | #region LLD files |
@@ -2927,11 +2827,6 @@ print("\\n%end") |
2927 | 2827 | cmake/lld |
2928 | 2828 | }} |
2929 | 2829 |
|
2930 | | -%{pretrans_rpmmove_dirs -n %{pkg_name_lld}-devel |
2931 | | - %{_includedir}/lld |
2932 | | - %{_libdir}/cmake/lld |
2933 | | -} |
2934 | | - |
2935 | 2830 | %files -n %{pkg_name_lld}-libs |
2936 | 2831 | %license lld/LICENSE.TXT |
2937 | 2832 | %{expand_libs %{expand: |
@@ -2978,10 +2873,6 @@ print("\\n%end") |
2978 | 2873 | %files -n %{pkg_name_lldb}-devel |
2979 | 2874 | %expand_includes lldb |
2980 | 2875 |
|
2981 | | -%{pretrans_rpmmove_dirs -n %{pkg_name_lldb}-devel |
2982 | | - %{_includedir}/lldb |
2983 | | -} |
2984 | | - |
2985 | 2876 | %files -n python%{python3_pkgversion}-lldb |
2986 | 2877 | %{python3_sitearch}/lldb |
2987 | 2878 | %endif |
@@ -3036,12 +2927,6 @@ print("\\n%end") |
3036 | 2927 | libMLIR*.so |
3037 | 2928 | }} |
3038 | 2929 |
|
3039 | | -%{pretrans_rpmmove_dirs -n %{pkg_name_mlir}-devel |
3040 | | - %{_includedir}/mlir-c |
3041 | | - %{_includedir}/mlir |
3042 | | - %{_libdir}/cmake/mlir |
3043 | | -} |
3044 | | - |
3045 | 2930 | %files -n python%{python3_pkgversion}-%{pkg_name_mlir} |
3046 | 2931 | %{python3_sitearch}/mlir/ |
3047 | 2932 | %endif |
@@ -3140,18 +3025,16 @@ print("\\n%end") |
3140 | 3025 | %expand_includes polly |
3141 | 3026 | %expand_libs cmake/polly |
3142 | 3027 |
|
3143 | | -%{pretrans_rpmmove_dirs -n %{pkg_name_polly}-devel |
3144 | | - %{_includedir}/polly |
3145 | | - %{_libdir}/cmake/polly |
3146 | | -} |
3147 | | - |
3148 | 3028 | %endif |
3149 | 3029 | #endregion polly files |
3150 | 3030 |
|
3151 | 3031 | #endregion files |
3152 | 3032 |
|
3153 | 3033 | #region changelog |
3154 | 3034 | %changelog |
| 3035 | +* Tue Feb 04 2025 Nikita Popov <[email protected]> - 19.1.7-6 |
| 3036 | +- Don't use directory symlinks |
| 3037 | + |
3155 | 3038 | * Fri Jan 31 2025 Konrad Kleine <[email protected]> - 19.1.7-5 |
3156 | 3039 | - Address installability issue with directories that were turned into symlinks |
3157 | 3040 |
|
|
0 commit comments