llvm/llvm.spec

255 lines
8.2 KiB
RPMSpec
Raw Normal View History

2024-08-28 11:21:20 +00:00
# We assume that we're building a snapshot if the if the build happens
# in Copr and the project has this prefix: @fedora-llvm-team/llvm-snapshots-
%global copr_snapshot_build_detected %(/bin/bash -fc 'if [[ "%{?copr_username}/%{?copr_projectname}" == @fedora-llvm-team/llvm-snapshots-* ]];
then
echo "yes"
else
echo "no"
fi')
%if "%{copr_snapshot_build_detected}" == "yes"
%bcond_without snapshot_build
%else
2024-08-28 11:21:20 +00:00
%bcond_with snapshot_build
%endif
2024-08-28 11:21:20 +00:00
%global maj_ver 19
%global min_ver 1
2024-08-28 11:21:20 +00:00
%global patch_ver 0
2024-09-19 05:50:05 +00:00
#global rc_ver 4
Update to LLVM 17.0.0 RC1 This is also a squashed merge commit from upstream-snapshot (commit ID 340b9e8ea37dcbca) into rawhide whose most important commits from upstream-snapshot are: Konrad Kleine (50): Prepare for snapshot build Fix RPM build errors: File not found: /builddir/build/BUILDROOT/llvm-14.0.0~pre20211103.g1febf42f03f664-1.fc34.x86_64/usr/lib64/libLLVM-14.so Added back patch file Rebased with new patches from rawhide that weren't yet in the streamline branch Fix RPM build errors: File not found: /builddir/build/BUILDROOT/llvm-14.0.0~pre20211103.g1febf42f03f664-1.fc34.x86_64/usr/lib64/libLLVM-14.so Disable LTO for anything older than Fedora 34 Use llvm_snapshot_version_suffix Remove patch for https://reviews.llvm.org/D108332 which is already upstream Only package cmake-devel when building a snapshot package and when NOT building in compat mode Fix RPM build Fix Macro expanded in comment on line 586: %{_libdir}/libLLVM-%{maj_ver} Fix rpm build warning/error: absolute symlink Default to DWARF4 Merge remote-tracking branch 'upstream/rawhide' into upstream-snapshot Rebased patched on pagure/streamline Merge remote-tracking branch 'upstream/rawhide' into upstream-snapshot Added 0004-PATCH-clang-Revert-cmake-Don-t-install-plugins-used-.patch Revert "Added 0004-PATCH-clang-Revert-cmake-Don-t-install-plugins-used-.patch" Workaround linker error: memory exhausted Merge remote-tracking branch 'upstream/rawhide' into upstream-snapshot Added pgo_instrumented_build cmake args Fix /usr/bin/ld: cannot find /usr/lib64/clang/13.0.0/lib/linux/libclang_rt.profile-x86_64.a: No such file or directory Move bcond in cmake down in case we want to override stuff Make llvm use the llvm-snapshot-builder as well Use %{llvm_snapshot_extra_source_tags} macro Merge remote-tracking branch 'upstream/rawhide' into upstream-snapshot Merge remote-tracking branch 'upstream/rawhide' into upstream-snapshot Patch renewal from rebased llvm-project pagure/streamline branch Try to lock llvm* and clang* packages so that we don't install LLVM from a previous copr build Revert "Try to lock llvm* and clang* packages so that we don't install LLVM from a previous copr build" Rebase onto pagure/main Merge remote-tracking branch 'upstream/rawhide' into upstream-snapshot use llvm+cmake tarballs instead of big llvm-project and close unclosed %if Fixup: clang->cmake Move globals down for them to be expanded correctly Fix merge issue with patch Test without some patches Compiles and installs again Adapt to standalone third-party dir bring back files to llvm-googletest package fixing path to unittest Manually add https://reviews.llvm.org/D137890 Add missing patch files Apply patchfiles independently for llvm and third-party dir List third-party gmock/gtest files in install Merge remote-tracking branch 'origin/rawhide' into upstream-snapshot Re-enable patches for gtest Disable LTO to speed up builds Added libLLVMTestingAnnotations.a to googletest subpackage Merge remote-tracking branch 'origin/rawhide' into upstream-snapshot Nikita Popov (1): Sync with rawhide Tom Stellard (13): Add patch to fix some lit test failures Revert "Add patch to fix some lit test failures" Add a patch from main branch to fix some lit tests Revert "Add a patch from main branch to fix some lit tests" Remove patch applied upstream Remove another upstreamed patch Add llvm-googletest dependency to llvm-devel Add JITLink patch to fix clang failures on aarch64 with libgcc-13 Revert "Add JITLink patch to fix clang failures on aarch64 with libgcc-13" Fix a test failure on s390x Revert "Fix a test failure on s390x" copr: Install llvm-snapshot-builder from the local COPR project Sync with rawhide sergesanspaille (1): Rebase downstream patches
2023-08-09 14:47:38 +00:00
%if %{with snapshot_build}
2024-08-28 11:21:20 +00:00
%include %{_sourcedir}/version.spec.inc
Update to LLVM 17.0.0 RC1 This is also a squashed merge commit from upstream-snapshot (commit ID 340b9e8ea37dcbca) into rawhide whose most important commits from upstream-snapshot are: Konrad Kleine (50): Prepare for snapshot build Fix RPM build errors: File not found: /builddir/build/BUILDROOT/llvm-14.0.0~pre20211103.g1febf42f03f664-1.fc34.x86_64/usr/lib64/libLLVM-14.so Added back patch file Rebased with new patches from rawhide that weren't yet in the streamline branch Fix RPM build errors: File not found: /builddir/build/BUILDROOT/llvm-14.0.0~pre20211103.g1febf42f03f664-1.fc34.x86_64/usr/lib64/libLLVM-14.so Disable LTO for anything older than Fedora 34 Use llvm_snapshot_version_suffix Remove patch for https://reviews.llvm.org/D108332 which is already upstream Only package cmake-devel when building a snapshot package and when NOT building in compat mode Fix RPM build Fix Macro expanded in comment on line 586: %{_libdir}/libLLVM-%{maj_ver} Fix rpm build warning/error: absolute symlink Default to DWARF4 Merge remote-tracking branch 'upstream/rawhide' into upstream-snapshot Rebased patched on pagure/streamline Merge remote-tracking branch 'upstream/rawhide' into upstream-snapshot Added 0004-PATCH-clang-Revert-cmake-Don-t-install-plugins-used-.patch Revert "Added 0004-PATCH-clang-Revert-cmake-Don-t-install-plugins-used-.patch" Workaround linker error: memory exhausted Merge remote-tracking branch 'upstream/rawhide' into upstream-snapshot Added pgo_instrumented_build cmake args Fix /usr/bin/ld: cannot find /usr/lib64/clang/13.0.0/lib/linux/libclang_rt.profile-x86_64.a: No such file or directory Move bcond in cmake down in case we want to override stuff Make llvm use the llvm-snapshot-builder as well Use %{llvm_snapshot_extra_source_tags} macro Merge remote-tracking branch 'upstream/rawhide' into upstream-snapshot Merge remote-tracking branch 'upstream/rawhide' into upstream-snapshot Patch renewal from rebased llvm-project pagure/streamline branch Try to lock llvm* and clang* packages so that we don't install LLVM from a previous copr build Revert "Try to lock llvm* and clang* packages so that we don't install LLVM from a previous copr build" Rebase onto pagure/main Merge remote-tracking branch 'upstream/rawhide' into upstream-snapshot use llvm+cmake tarballs instead of big llvm-project and close unclosed %if Fixup: clang->cmake Move globals down for them to be expanded correctly Fix merge issue with patch Test without some patches Compiles and installs again Adapt to standalone third-party dir bring back files to llvm-googletest package fixing path to unittest Manually add https://reviews.llvm.org/D137890 Add missing patch files Apply patchfiles independently for llvm and third-party dir List third-party gmock/gtest files in install Merge remote-tracking branch 'origin/rawhide' into upstream-snapshot Re-enable patches for gtest Disable LTO to speed up builds Added libLLVMTestingAnnotations.a to googletest subpackage Merge remote-tracking branch 'origin/rawhide' into upstream-snapshot Nikita Popov (1): Sync with rawhide Tom Stellard (13): Add patch to fix some lit test failures Revert "Add patch to fix some lit test failures" Add a patch from main branch to fix some lit tests Revert "Add a patch from main branch to fix some lit tests" Remove patch applied upstream Remove another upstreamed patch Add llvm-googletest dependency to llvm-devel Add JITLink patch to fix clang failures on aarch64 with libgcc-13 Revert "Add JITLink patch to fix clang failures on aarch64 with libgcc-13" Fix a test failure on s390x Revert "Fix a test failure on s390x" copr: Install llvm-snapshot-builder from the local COPR project Sync with rawhide sergesanspaille (1): Rebase downstream patches
2023-08-09 14:47:38 +00:00
%endif
2024-08-28 11:21:20 +00:00
%include %{_sourcedir}/globals.spec.inc
2024-08-28 11:21:20 +00:00
Name: %{pkg_name_llvm}
Version: %{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:~rc%{rc_ver}}%{?llvm_snapshot_version_suffix:~%{llvm_snapshot_version_suffix}}
2024-08-28 11:21:20 +00:00
Release: 1%{?dist}
2016-01-27 15:23:13 +00:00
Summary: The Low Level Virtual Machine
License: Apache-2.0 WITH LLVM-exception OR NCSA
2016-01-27 15:23:13 +00:00
URL: http://llvm.org
%if %{with snapshot_build}
Source0: https://github.com/llvm/llvm-project/archive/%{llvm_snapshot_git_revision}.tar.gz
%else
Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:-rc%{rc_ver}}/%{src_tarball_dir}.tar.xz
Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:-rc%{rc_ver}}/%{src_tarball_dir}.tar.xz.sig
%endif
2024-08-28 11:21:20 +00:00
Source6: release-keys.asc
%if %{without compat_build}
Source2005: macros.%{pkg_name_clang}
%endif
2024-08-28 11:21:20 +00:00
%if %{with bundle_compat_lib}
Source3000: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{compat_ver}/llvm-project-%{compat_ver}.src.tar.xz
Source3001: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{compat_ver}/llvm-project-%{compat_ver}.src.tar.xz.sig
%endif
# Sources we use to split up the main spec file in sections so that we can more
# easily see what specfile sections are touched by a patch.
%if %{with snapshot_build}
Source1000: version.spec.inc
%endif
Source1001: build.spec.inc
Source1002: changelog.spec.inc
Source1003: check.spec.inc
Source1004: files.spec.inc
Source1005: globals.spec.inc
Source1006: install.spec.inc
Source1007: prep.spec.inc
Source1008: packages.spec.inc
#region CLANG patches
Patch2001: 0001-PATCH-clang-Make-funwind-tables-the-default-on-all-a.patch
Patch2002: 0003-PATCH-clang-Don-t-install-static-libraries.patch
#endregion
# Workaround a bug in ORC on ppc64le.
# More info is available here: https://reviews.llvm.org/D159115#4641826
Patch2005: 0001-Workaround-a-bug-in-ORC-on-ppc64le.patch
#region LLD patches
Patch3002: 0001-Always-build-shared-libs-for-LLD.patch
#endregion
#region RHEL patches
# All RHEL
Patch9001: 0001-Remove-myst_parser-dependency-for-RHEL.patch
2024-08-28 11:21:20 +00:00
# RHEL 8 only
Patch9002: 0001-Fix-page-size-constant-on-aarch64-and-ppc64le.patch
#endregion
merge llvm, clang, compiler-rt and libomp repos * %check: export LD_LIBRARY_PATH because runtimes use external cmake projects that wouldn't find libclang++.so * %check: use LLVM's LIT_XFAIL to mark tests that are expected to fail and don't just delete them * clang: bring over *.patch files * clang: remove build requires tags from clang package that are already defined by main llvm package * clang: remove duplicates found in llvm globals and use %{pkg_datadir} instead of %{install_datadir} * clang: rename and use pkg_name -> pkg_name_clang * clang: use %{pkg_name_clang} instead of %{name} * compiler-rt and libomp: wrap in %if %{without compat_build} * libomp: also build libomp for s390x (See https://github.com/llvm/llvm-project/pull/66081) * libomp: exclude libomp-devel on s390x just like libomp itself * libomp: introduce pkg_name_libomp and cleanup the globals * libomp: remove gdb-plugin (NEED TO CONFIRM IF THIS IS REALLY TRUE) * libomp: filter out flaky libomp test: ompt/teams/distribute_dispatch.c * llvm: add BuildRequires: graphviz to llvm-doc * llvm: use %{pkg_name_llvm} instead of %{name} * make: added temporary Makefile so I can more easily run srpm or rpm builds locally * make: Added local-tmt-vm target (not really useful yet) * rpm: for non-RHEL add prefix like "Jan 05 16:17:06" to every log line This should help in finding out how long things take to build/install/... * rpm: fully specify %files for top-level packages * rpm: make all packages fully qualified * rpm: obsolete llvm-snapshot-builder * rpm: remove BuildRequires: python3-lit because we have it in-tree * rpm: remove BuildRequires: tags for clang and llvm specifics as we're building in-tree * rpm: rename %llvm_srcdir -> %srcdir_llvm * rpm: rename %pkg_name -> %pkg_name_llvm * rpm: use full qualified name in %description * rpm: use region comments in spec file to group by package. This allows editors to fold text to get a better overview * rpmlint: update rc file to reflect clang and compiler-rt (libomp has no rpmlint rc file) * use python-lit from within tree
2023-10-12 09:15:14 +00:00
2024-08-28 11:21:20 +00:00
%if 0%{?rhel} == 8
%global python3_pkgversion 3.12
%global __python3 /usr/bin/python3.12
%endif
2018-12-04 15:10:41 +00:00
BuildRequires: gcc
BuildRequires: gcc-c++
2021-04-23 21:10:27 +00:00
BuildRequires: clang
2016-01-27 15:23:13 +00:00
BuildRequires: cmake
BuildRequires: ninja-build
2016-01-27 15:23:13 +00:00
BuildRequires: zlib-devel
2018-12-04 15:10:41 +00:00
BuildRequires: libffi-devel
BuildRequires: ncurses-devel
2024-08-28 11:21:20 +00:00
# This intentionally does not use python3_pkgversion. RHEL 8 does not have
# python3.12-sphinx, and we are only using it as a binary anyway.
2016-01-27 15:23:13 +00:00
BuildRequires: python3-sphinx
2024-08-28 11:21:20 +00:00
%if 0%{?rhel} != 8
# RHEL 8 does not have these packages for python3.12. However, they are only
# needed for LLDB tests.
BuildRequires: python%{python3_pkgversion}-psutil
BuildRequires: python%{python3_pkgversion}-pexpect
%endif
%if %{undefined rhel}
2024-08-28 11:21:20 +00:00
BuildRequires: python%{python3_pkgversion}-myst-parser
%endif
merge llvm, clang, compiler-rt and libomp repos * %check: export LD_LIBRARY_PATH because runtimes use external cmake projects that wouldn't find libclang++.so * %check: use LLVM's LIT_XFAIL to mark tests that are expected to fail and don't just delete them * clang: bring over *.patch files * clang: remove build requires tags from clang package that are already defined by main llvm package * clang: remove duplicates found in llvm globals and use %{pkg_datadir} instead of %{install_datadir} * clang: rename and use pkg_name -> pkg_name_clang * clang: use %{pkg_name_clang} instead of %{name} * compiler-rt and libomp: wrap in %if %{without compat_build} * libomp: also build libomp for s390x (See https://github.com/llvm/llvm-project/pull/66081) * libomp: exclude libomp-devel on s390x just like libomp itself * libomp: introduce pkg_name_libomp and cleanup the globals * libomp: remove gdb-plugin (NEED TO CONFIRM IF THIS IS REALLY TRUE) * libomp: filter out flaky libomp test: ompt/teams/distribute_dispatch.c * llvm: add BuildRequires: graphviz to llvm-doc * llvm: use %{pkg_name_llvm} instead of %{name} * make: added temporary Makefile so I can more easily run srpm or rpm builds locally * make: Added local-tmt-vm target (not really useful yet) * rpm: for non-RHEL add prefix like "Jan 05 16:17:06" to every log line This should help in finding out how long things take to build/install/... * rpm: fully specify %files for top-level packages * rpm: make all packages fully qualified * rpm: obsolete llvm-snapshot-builder * rpm: remove BuildRequires: python3-lit because we have it in-tree * rpm: remove BuildRequires: tags for clang and llvm specifics as we're building in-tree * rpm: rename %llvm_srcdir -> %srcdir_llvm * rpm: rename %pkg_name -> %pkg_name_llvm * rpm: use full qualified name in %description * rpm: use region comments in spec file to group by package. This allows editors to fold text to get a better overview * rpmlint: update rc file to reflect clang and compiler-rt (libomp has no rpmlint rc file) * use python-lit from within tree
2023-10-12 09:15:14 +00:00
# Needed for %%multilib_fix_c_header
2017-04-03 19:24:44 +00:00
BuildRequires: multilib-rpm-config
%if %{with gold}
2018-12-04 15:10:41 +00:00
BuildRequires: binutils-devel
%endif
%ifarch %{valgrind_arches}
# Enable extra functionality when run the LLVM JIT under valgrind.
2018-12-04 15:10:41 +00:00
BuildRequires: valgrind-devel
%endif
# LLVM's LineEditor library will use libedit if it is available.
2018-12-04 15:10:41 +00:00
BuildRequires: libedit-devel
# We need python3-devel for %%py3_shebang_fix
2024-08-28 11:21:20 +00:00
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-setuptools
%if 0%{?rhel} == 8
BuildRequires: python%{python3_pkgversion}-rpm-macros
%endif
2008-01-21 17:33:11 +00:00
# For gpg source verification
BuildRequires: gnupg2
BuildRequires: swig
BuildRequires: libxml2-devel
BuildRequires: doxygen
# For clang-offload-packager
BuildRequires: elfutils-libelf-devel
BuildRequires: perl
BuildRequires: perl-Data-Dumper
BuildRequires: perl-Encode
BuildRequires: libffi-devel
BuildRequires: perl-generators
# According to https://fedoraproject.org/wiki/Packaging:Emacs a package
# should BuildRequires: emacs if it packages emacs integration files.
BuildRequires: emacs
BuildRequires: libatomic
# scan-build uses these perl modules so they need to be installed in order
# to run the tests.
BuildRequires: perl(Digest::MD5)
BuildRequires: perl(File::Copy)
BuildRequires: perl(File::Find)
BuildRequires: perl(File::Path)
BuildRequires: perl(File::Temp)
BuildRequires: perl(FindBin)
BuildRequires: perl(Hash::Util)
BuildRequires: perl(lib)
BuildRequires: perl(Term::ANSIColor)
BuildRequires: perl(Text::ParseWords)
BuildRequires: perl(Sys::Hostname)
BuildRequires: graphviz
# This is required because we need "ps" when running LLDB tests
BuildRequires: procps-ng
# For reproducible pyc file generation
# See https://docs.fedoraproject.org/en-US/packaging-guidelines/Python_Appendix/#_byte_compilation_reproducibility
2024-07-16 10:29:26 +00:00
# Since Fedora 41 this happens automatically, and RHEL 8 does not support this.
%if (%{defined fedora} && 0%{?fedora} < 41) || 0%{?rhel} == 9 || 0%{?rhel} == 10
BuildRequires: /usr/bin/marshalparser
%global py_reproducible_pyc_path %{buildroot}%{python3_sitelib}
%endif
merge llvm, clang, compiler-rt and libomp repos * %check: export LD_LIBRARY_PATH because runtimes use external cmake projects that wouldn't find libclang++.so * %check: use LLVM's LIT_XFAIL to mark tests that are expected to fail and don't just delete them * clang: bring over *.patch files * clang: remove build requires tags from clang package that are already defined by main llvm package * clang: remove duplicates found in llvm globals and use %{pkg_datadir} instead of %{install_datadir} * clang: rename and use pkg_name -> pkg_name_clang * clang: use %{pkg_name_clang} instead of %{name} * compiler-rt and libomp: wrap in %if %{without compat_build} * libomp: also build libomp for s390x (See https://github.com/llvm/llvm-project/pull/66081) * libomp: exclude libomp-devel on s390x just like libomp itself * libomp: introduce pkg_name_libomp and cleanup the globals * libomp: remove gdb-plugin (NEED TO CONFIRM IF THIS IS REALLY TRUE) * libomp: filter out flaky libomp test: ompt/teams/distribute_dispatch.c * llvm: add BuildRequires: graphviz to llvm-doc * llvm: use %{pkg_name_llvm} instead of %{name} * make: added temporary Makefile so I can more easily run srpm or rpm builds locally * make: Added local-tmt-vm target (not really useful yet) * rpm: for non-RHEL add prefix like "Jan 05 16:17:06" to every log line This should help in finding out how long things take to build/install/... * rpm: fully specify %files for top-level packages * rpm: make all packages fully qualified * rpm: obsolete llvm-snapshot-builder * rpm: remove BuildRequires: python3-lit because we have it in-tree * rpm: remove BuildRequires: tags for clang and llvm specifics as we're building in-tree * rpm: rename %llvm_srcdir -> %srcdir_llvm * rpm: rename %pkg_name -> %pkg_name_llvm * rpm: use full qualified name in %description * rpm: use region comments in spec file to group by package. This allows editors to fold text to get a better overview * rpmlint: update rc file to reflect clang and compiler-rt (libomp has no rpmlint rc file) * use python-lit from within tree
2023-10-12 09:15:14 +00:00
Requires: %{pkg_name_llvm}-libs%{?_isa} = %{version}-%{release}
2008-01-21 17:33:11 +00:00
Provides: llvm(major) = %{maj_ver}
2016-01-27 15:23:13 +00:00
%description
LLVM is a compiler infrastructure designed for compile-time, link-time,
runtime, and idle-time optimization of programs from arbitrary programming
languages. The compiler infrastructure includes mirror sets of programming
tools as well as libraries with equivalent functionality.
2008-01-21 17:33:11 +00:00
2024-08-28 11:21:20 +00:00
%include %{_sourcedir}/packages.spec.inc
2008-01-21 17:33:11 +00:00
%prep
2024-08-28 11:21:20 +00:00
%include %{_sourcedir}/prep.spec.inc
2008-01-21 17:33:11 +00:00
%build
2024-08-28 11:21:20 +00:00
%include %{_sourcedir}/build.spec.inc
2008-01-21 17:33:11 +00:00
%install
2024-08-28 11:21:20 +00:00
%include %{_sourcedir}/install.spec.inc
2022-11-09 18:22:27 +00:00
%check
merge llvm, clang, compiler-rt and libomp repos * %check: export LD_LIBRARY_PATH because runtimes use external cmake projects that wouldn't find libclang++.so * %check: use LLVM's LIT_XFAIL to mark tests that are expected to fail and don't just delete them * clang: bring over *.patch files * clang: remove build requires tags from clang package that are already defined by main llvm package * clang: remove duplicates found in llvm globals and use %{pkg_datadir} instead of %{install_datadir} * clang: rename and use pkg_name -> pkg_name_clang * clang: use %{pkg_name_clang} instead of %{name} * compiler-rt and libomp: wrap in %if %{without compat_build} * libomp: also build libomp for s390x (See https://github.com/llvm/llvm-project/pull/66081) * libomp: exclude libomp-devel on s390x just like libomp itself * libomp: introduce pkg_name_libomp and cleanup the globals * libomp: remove gdb-plugin (NEED TO CONFIRM IF THIS IS REALLY TRUE) * libomp: filter out flaky libomp test: ompt/teams/distribute_dispatch.c * llvm: add BuildRequires: graphviz to llvm-doc * llvm: use %{pkg_name_llvm} instead of %{name} * make: added temporary Makefile so I can more easily run srpm or rpm builds locally * make: Added local-tmt-vm target (not really useful yet) * rpm: for non-RHEL add prefix like "Jan 05 16:17:06" to every log line This should help in finding out how long things take to build/install/... * rpm: fully specify %files for top-level packages * rpm: make all packages fully qualified * rpm: obsolete llvm-snapshot-builder * rpm: remove BuildRequires: python3-lit because we have it in-tree * rpm: remove BuildRequires: tags for clang and llvm specifics as we're building in-tree * rpm: rename %llvm_srcdir -> %srcdir_llvm * rpm: rename %pkg_name -> %pkg_name_llvm * rpm: use full qualified name in %description * rpm: use region comments in spec file to group by package. This allows editors to fold text to get a better overview * rpmlint: update rc file to reflect clang and compiler-rt (libomp has no rpmlint rc file) * use python-lit from within tree
2023-10-12 09:15:14 +00:00
%include %{_sourcedir}/check.spec.inc
2024-08-28 11:21:20 +00:00
%ldconfig_scriptlets -n %{pkg_name-llvm}-libs
2024-08-28 11:21:20 +00:00
%if %{without compat_build}
%ldconfig_scriptlets -n %{pkg_name_lld}-libs
%endif
2024-08-28 11:21:20 +00:00
%post -n %{pkg_name_llvm}-devel
%{_sbindir}/update-alternatives --install %{_bindir}/llvm-config%{exec_suffix} llvm-config%{exec_suffix} %{install_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} %{__isa_bits}
%if %{without compat_build}
%{_sbindir}/update-alternatives --install %{_bindir}/llvm-config-%{maj_ver} llvm-config-%{maj_ver} %{install_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} %{__isa_bits}
# During the upgrade from LLVM 16 (F38) to LLVM 17 (F39), we found out the
# main llvm-devel package was leaving entries in the alternatives system.
# Try to remove them now.
for v in 14 15 16; do
if [[ -e %{_bindir}/llvm-config-$v
&& "x$(%{_bindir}/llvm-config-$v --version | awk -F . '{ print $1 }')" != "x$v" ]]; then
%{_sbindir}/update-alternatives --remove llvm-config-$v %{install_bindir}/llvm-config%{exec_suffix}-%{__isa_bits}
fi
done
%endif
2024-08-28 11:21:20 +00:00
%postun -n %{pkg_name_llvm}-devel
if [ $1 -eq 0 ]; then
2024-08-28 11:21:20 +00:00
%{_sbindir}/update-alternatives --remove llvm-config%{exec_suffix} %{install_bindir}/llvm-config%{exec_suffix}-%{__isa_bits}
fi
%if %{without compat_build}
# When upgrading between minor versions (i.e. from x.y.1 to x.y.2), we must
# not remove the alternative.
# However, during a major version upgrade (i.e. from 16.x.y to 17.z.w), the
# alternative must be removed in order to give priority to a newly installed
# compat package.
if [[ $1 -eq 0
2024-08-28 11:21:20 +00:00
|| "x$(%{_bindir}/llvm-config-%{maj_ver} --version | awk -F . '{ print $1 }')" != "x%{maj_ver}" ]]; then
%{_sbindir}/update-alternatives --remove llvm-config-%{maj_ver} %{install_bindir}/llvm-config%{exec_suffix}-%{__isa_bits}
fi
%endif
%if %{without compat_build}
%post -n %{pkg_name_lld}
%{_sbindir}/update-alternatives --install %{_bindir}/ld ld %{_bindir}/ld.lld 1
%postun -n %{pkg_name_lld}
if [ $1 -eq 0 ] ; then
%{_sbindir}/update-alternatives --remove ld %{_bindir}/ld.lld
fi
%endif
2024-08-28 11:21:20 +00:00
%include %{_sourcedir}/files.spec.inc
2008-01-21 17:33:11 +00:00
%changelog
2024-08-28 11:21:20 +00:00
%include %{_sourcedir}/changelog.spec.inc