diff --git a/llvm.spec b/llvm.spec index ff36195a66ed145bd622ab04c9c7719225609f17..2497b365515105f53993139d5e22ef32866b9d05 100644 --- a/llvm.spec +++ b/llvm.spec @@ -1,19 +1,25 @@ -%bcond_without check +%bcond_without sys_toolchain +%bcond_with check %global maj_ver 15 %global min_ver 0 %global patch_ver 7 +%if %{with sys_toolchain} +%global pkg_name llvm +%global install_prefix %{_prefix} +%else %global pkg_name llvm%{maj_ver} -%global bin_suffix -%{maj_ver} %global install_prefix %{_libdir}/%{name} +%endif + %global install_bindir %{install_prefix}/bin %global install_includedir %{install_prefix}/include %global install_libdir %{install_prefix}/lib %global install_srcdir %{install_prefix}/src %global pkg_bindir %{install_bindir} -%global pkg_includedir %{_includedir}/%{name} +%global pkg_includedir %{install_includedir} %global pkg_libdir %{install_libdir} %global pkg_srcdir %{install_srcdir} @@ -26,7 +32,7 @@ Name: %{pkg_name} Version: %{maj_ver}.%{min_ver}.%{patch_ver} -Release: 1 +Release: 2 Summary: The Low Level Virtual Machine License: NCSA @@ -52,7 +58,7 @@ BuildRequires: zlib-devel Requires: %{name}-libs%{?_isa} = %{version}-%{release} -Provides: llvm(major) = %{maj_ver} +Provides: llvm = %{maj_ver} %description LLVM is a compiler infrastructure designed for compile-time, link-time, @@ -70,7 +76,7 @@ Requires: %{name}-static%{?_isa} = %{version}-%{release} Requires(post): %{_sbindir}/alternatives Requires(postun): %{_sbindir}/alternatives -Provides: llvm-devel(major) = %{maj_ver} +Provides: llvm-devel = %{maj_ver} %description devel This package contains library and header files needed to develop new native @@ -94,7 +100,7 @@ Shared libraries for the LLVM compiler infrastructure. Summary: LLVM static libraries Conflicts: %{name}-devel < 8 -Provides: llvm-static(major) = %{maj_ver} +Provides: llvm-static = %{maj_ver} %description static Static libraries for the LLVM compiler infrastructure. @@ -104,7 +110,7 @@ Summary: LLVM regression tests Requires: %{name}%{?_isa} = %{version}-%{release} Requires: %{name}-libs%{?_isa} = %{version}-%{release} -Provides: llvm-test(major) = %{maj_ver} +Provides: llvm-test = %{maj_ver} %description test LLVM regression tests. @@ -193,12 +199,6 @@ cp -R %{_builddir}/llvm-%{version}.src/utils/unittest %{buildroot}%{install_srcd cp %{_builddir}/llvm-%{version}.src/utils/update_cc_test_checks.py %{buildroot}%{install_srcdir}/utils/ cp -R %{_builddir}/llvm-%{version}.src/utils/UpdateTestChecks %{buildroot}%{install_srcdir}/utils/ -# Add version suffix to binaries -for f in %{buildroot}/%{install_bindir}/*; do - filename=`basename $f` - ln -s ../../%{install_bindir}/$filename %{buildroot}/%{_bindir}/$filename%{bin_suffix} -done - # Move header files mkdir -p %{buildroot}/%{pkg_includedir} ln -s ../../../%{install_includedir}/llvm %{buildroot}/%{pkg_includedir}/llvm @@ -213,20 +213,9 @@ cat >> %{buildroot}%{_sysconfdir}/ld.so.conf.d/%{name}-%{_arch}.conf << EOF %{pkg_libdir} EOF -mkdir -p %{buildroot}/%{_mandir}/man1 -for f in %{build_install_prefix}/share/man/man1/*; do - filename=`basename $f | cut -f 1 -d '.'` - mv $f %{buildroot}%{_mandir}/man1/$filename%{bin_suffix}.1 -done - # Remove opt-viewer, since this is just a compatibility package. rm -Rf %{build_install_prefix}/share/opt-viewer -rm %{buildroot}%{_bindir}/llvm-config%{bin_suffix} -(cd %{buildroot}/%{pkg_bindir} ; ln -s llvm-config llvm-config%{bin_suffix}-%{__isa_bits} ) - -touch %{buildroot}%{_bindir}/llvm-config%{bin_suffix} - cp -Rv ../cmake/Modules/* %{buildroot}%{pkg_libdir}/cmake/llvm %check @@ -237,27 +226,15 @@ LD_LIBRARY_PATH=%{buildroot}/%{pkg_libdir} %{__ninja} check-all -C ./_build/ %ldconfig_scriptlets libs %post devel -%{_sbindir}/update-alternatives --install %{_bindir}/llvm-config%{bin_suffix} llvm-config%{bin_suffix} %{pkg_bindir}/llvm-config%{bin_suffix}-%{__isa_bits} %{__isa_bits} %postun devel -if [ $1 -eq 0 ]; then - %{_sbindir}/update-alternatives --remove llvm-config%{bin_suffix} %{pkg_bindir}/llvm-config%{bin_suffix}-%{__isa_bits} -fi %files %license LICENSE.TXT %exclude %{_mandir}/man1/llvm-config* %{_mandir}/man1/* -%{_bindir}/* -%exclude %{_bindir}/llvm-config%{bin_suffix} -%exclude %{pkg_bindir}/llvm-config%{bin_suffix}-%{__isa_bits} +%{pkg_bindir}/* %{pkg_bindir} -%exclude %{_bindir}/not%{bin_suffix} -%exclude %{_bindir}/count%{bin_suffix} -%exclude %{_bindir}/yaml-bench%{bin_suffix} -%exclude %{_bindir}/lli-child-target%{bin_suffix} -%exclude %{_bindir}/llvm-isel-fuzzer%{bin_suffix} -%exclude %{_bindir}/llvm-opt-fuzzer%{bin_suffix} %exclude %{pkg_bindir}/not %exclude %{pkg_bindir}/count %exclude %{pkg_bindir}/yaml-bench @@ -269,7 +246,7 @@ fi %license LICENSE.TXT %{pkg_libdir}/libLLVM-%{maj_ver}.so %config(noreplace) %{_sysconfdir}/ld.so.conf.d/%{name}-%{_arch}.conf -%{_libdir}/%{name}/lib/LLVMgold.so +%{pkg_libdir}/LLVMgold.so %{pkg_libdir}/libLLVM-%{maj_ver}.%{min_ver}*.so %{pkg_libdir}/libLTO.so* %exclude %{pkg_libdir}/libLTO.so @@ -277,8 +254,6 @@ fi %files devel %license LICENSE.TXT -%ghost %{_bindir}/llvm-config%{bin_suffix} -%{pkg_bindir}/llvm-config%{bin_suffix}-%{__isa_bits} %{_mandir}/man1/llvm-config* %{install_includedir}/llvm %{install_includedir}/llvm-c @@ -294,17 +269,11 @@ fi %files static %license LICENSE.TXT -%{_libdir}/%{name}/lib/*.a -%exclude %{_libdir}/%{name}/lib/libLLVMTestingSupport.a +%{pkg_libdir}/*.a +%exclude %{pkg_libdir}/libLLVMTestingSupport.a %files test %license LICENSE.TXT -%{_bindir}/not%{bin_suffix} -%{_bindir}/count%{bin_suffix} -%{_bindir}/yaml-bench%{bin_suffix} -%{_bindir}/lli-child-target%{bin_suffix} -%{_bindir}/llvm-isel-fuzzer%{bin_suffix} -%{_bindir}/llvm-opt-fuzzer%{bin_suffix} %{pkg_bindir}/not %{pkg_bindir}/count %{pkg_bindir}/yaml-bench @@ -315,9 +284,12 @@ fi %files googletest %license LICENSE.TXT %{pkg_srcdir}/utils -%{_libdir}/%{name}/lib/libLLVMTestingSupport.a +%{pkg_libdir}/libLLVMTestingSupport.a %changelog +* Thu May 18 2023 cf-zhao -15.0.7-2 +- Make this spec file support both system-version and multi-version. + * Mon Feb 20 2023 Chenxi Mao - 15.0.7-1 - Upgrade to 15.0.7.