Fix llvm-config install

This commit is contained in:
serge-sans-paille 2021-04-27 11:08:22 +02:00
parent ad503c449d
commit 5ebc8337ce

View File

@ -31,6 +31,7 @@
%global pkg_name llvm %global pkg_name llvm
%global install_prefix /usr %global install_prefix /usr
%global install_libdir %{_libdir} %global install_libdir %{_libdir}
%global pkg_bindir %{_bindir}
%global pkg_libdir %{install_libdir} %global pkg_libdir %{install_libdir}
%endif %endif
@ -46,7 +47,7 @@
Name: %{pkg_name} Name: %{pkg_name}
Version: %{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:~rc%{rc_ver}} Version: %{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:~rc%{rc_ver}}
Release: 2%{?dist} Release: 3%{?dist}
Summary: The Low Level Virtual Machine Summary: The Low Level Virtual Machine
License: NCSA License: NCSA
@ -281,14 +282,14 @@ pathfix.py -i %{__python3} -pn \
%install %install
%cmake_install %cmake_install
%if %{without compat_build}
mkdir -p %{buildroot}/%{_bindir} mkdir -p %{buildroot}/%{_bindir}
mv %{buildroot}/%{_bindir}/llvm-config %{buildroot}/%{_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} mv %{buildroot}/%{pkg_bindir}/llvm-config %{buildroot}/%{pkg_bindir}/llvm-config%{exec_suffix}-%{__isa_bits}
# ghost presence # ghost presence
touch %{buildroot}%{_bindir}/llvm-config%{exec_suffix} touch %{buildroot}%{_bindir}/llvm-config%{exec_suffix}
%if %{without compat_build}
# Fix some man pages # Fix some man pages
ln -s llvm-config.1 %{buildroot}%{_mandir}/man1/llvm-config%{exec_suffix}-%{__isa_bits}.1 ln -s llvm-config.1 %{buildroot}%{_mandir}/man1/llvm-config%{exec_suffix}-%{__isa_bits}.1
mv %{buildroot}%{_mandir}/man1/*tblgen.1 %{buildroot}%{_mandir}/man1/llvm-tblgen.1 mv %{buildroot}%{_mandir}/man1/*tblgen.1 %{buildroot}%{_mandir}/man1/llvm-tblgen.1
@ -394,7 +395,6 @@ ln -s ../../../%{install_includedir}/llvm %{buildroot}/%{pkg_includedir}/llvm
ln -s ../../../%{install_includedir}/llvm-c %{buildroot}/%{pkg_includedir}/llvm-c ln -s ../../../%{install_includedir}/llvm-c %{buildroot}/%{pkg_includedir}/llvm-c
# Fix multi-lib # Fix multi-lib
mv %{buildroot}%{_bindir}/llvm-config{%{exec_suffix},%{exec_suffix}-%{__isa_bits}}
%multilib_fix_c_header --file %{install_includedir}/llvm/Config/llvm-config.h %multilib_fix_c_header --file %{install_includedir}/llvm/Config/llvm-config.h
# Create ld.so.conf.d entry # Create ld.so.conf.d entry
@ -431,11 +431,11 @@ LD_LIBRARY_PATH=%{buildroot}/%{pkg_libdir} %{__ninja} check-all -C %{_vpath_bui
%ldconfig_scriptlets libs %ldconfig_scriptlets libs
%post devel %post devel
%{_sbindir}/update-alternatives --install %{_bindir}/llvm-config%{exec_suffix} llvm-config%{exec_suffix} %{_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} %{__isa_bits} %{_sbindir}/update-alternatives --install %{_bindir}/llvm-config%{exec_suffix} llvm-config%{exec_suffix} %{pkg_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} %{__isa_bits}
%postun devel %postun devel
if [ $1 -eq 0 ]; then if [ $1 -eq 0 ]; then
%{_sbindir}/update-alternatives --remove llvm-config%{exec_suffix} %{_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} %{_sbindir}/update-alternatives --remove llvm-config%{exec_suffix} %{pkg_bindir}/llvm-config%{exec_suffix}-%{__isa_bits}
fi fi
%files %files
@ -444,7 +444,7 @@ fi
%{_mandir}/man1/* %{_mandir}/man1/*
%{_bindir}/* %{_bindir}/*
%exclude %{_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} %exclude %{pkg_bindir}/llvm-config%{exec_suffix}-%{__isa_bits}
%if %{without compat_build} %if %{without compat_build}
%exclude %{_bindir}/not %exclude %{_bindir}/not
@ -455,7 +455,6 @@ fi
%exclude %{_bindir}/llvm-opt-fuzzer %exclude %{_bindir}/llvm-opt-fuzzer
%{_datadir}/opt-viewer %{_datadir}/opt-viewer
%else %else
%exclude %{pkg_bindir}/llvm-config%{exec_suffix}-%{__isa_bits}
%{pkg_bindir} %{pkg_bindir}
%endif %endif
@ -484,7 +483,7 @@ fi
%license LICENSE.TXT %license LICENSE.TXT
%ghost %{_bindir}/llvm-config%{exec_suffix} %ghost %{_bindir}/llvm-config%{exec_suffix}
%{_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} %{pkg_bindir}/llvm-config%{exec_suffix}-%{__isa_bits}
%{_mandir}/man1/llvm-config* %{_mandir}/man1/llvm-config*
%if %{without compat_build} %if %{without compat_build}
@ -493,7 +492,6 @@ fi
%{_libdir}/libLLVM.so %{_libdir}/libLLVM.so
%{_libdir}/cmake/llvm %{_libdir}/cmake/llvm
%else %else
%{pkg_bindir}/llvm-config%{exec_suffix}-%{__isa_bits}
%{install_includedir}/llvm %{install_includedir}/llvm
%{install_includedir}/llvm-c %{install_includedir}/llvm-c
%{pkg_includedir}/llvm %{pkg_includedir}/llvm
@ -545,6 +543,9 @@ fi
%endif %endif
%changelog %changelog
* Tue Apr 27 2021 sguelton@redhat.com - 12.0.0-3
- Fix llvm-config install
* Tue Apr 20 2021 sguelton@redhat.com - 12.0.0-2 * Tue Apr 20 2021 sguelton@redhat.com - 12.0.0-2
- Backport compat package fix - Backport compat package fix