Add clang-resource-filesystem sub-package

Packages that need to read or write files from the clang resource
directory should Require this sub-package.  This will ensure that we
won't have packages continuing to use older versions of the clang
resource directory when clang is updated.
This commit is contained in:
Tom Stellard 2020-10-28 14:12:38 +00:00
parent bf527b3382
commit 5bff53b37b

View File

@ -4,7 +4,7 @@
%global min_ver 0 %global min_ver 0
%global patch_ver 0 %global patch_ver 0
#%%global rc_ver 6 #%%global rc_ver 6
%global baserelease 1 %global baserelease 2
%global clang_tools_binaries \ %global clang_tools_binaries \
%{_bindir}/clang-apply-replacements \ %{_bindir}/clang-apply-replacements \
@ -51,6 +51,7 @@
%else %else
%global pkg_name clang %global pkg_name clang
%global install_prefix /usr %global install_prefix /usr
%global pkg_libdir %{_libdir}
%endif %endif
%if 0%{?fedora} || 0%{?rhel} > 7 %if 0%{?fedora} || 0%{?rhel} > 7
@ -173,6 +174,7 @@ as libraries and designed to be loosely-coupled and extensible.
%package libs %package libs
Summary: Runtime library for clang Summary: Runtime library for clang
Requires: %{name}-resource-filesystem%{?_isa} = %{version}
Recommends: compiler-rt%{?_isa} = %{version} Recommends: compiler-rt%{?_isa} = %{version}
# libomp-devel is required, so clang can find the omp.h header when compiling # libomp-devel is required, so clang can find the omp.h header when compiling
# with -fopenmp. # with -fopenmp.
@ -194,6 +196,13 @@ Requires: %{name}-libs = %{version}-%{release}
%description devel %description devel
Development header files for clang. Development header files for clang.
%package resource-filesystem
Summary: Filesystem package that owns the clang resource directory
Provides: %{name}-resource-filesystem(major) = %{maj_ver}
%description resource-filesystem
This package owns the clang resouce directory: $libdir/clang/$version/
%if !0%{?compat_build} %if !0%{?compat_build}
%package analyzer %package analyzer
Summary: A source code analysis framework Summary: A source code analysis framework
@ -407,6 +416,10 @@ pushd %{buildroot}%{_libdir}/clang/
ln -s %{version} %{maj_ver} ln -s %{version} %{maj_ver}
popd popd
# Create sub-directories in the clang resource directory that will be
# populated by other packages
mkdir -p %{buildroot}%{_libdir}/clang/%{version}/{include,lib,share}/
%endif %endif
# Remove clang-tidy headers. We don't ship the libraries for these. # Remove clang-tidy headers. We don't ship the libraries for these.
@ -459,6 +472,15 @@ false
%{pkg_libdir}/cmake/ %{pkg_libdir}/cmake/
%endif %endif
%files resource-filesystem
%dir %{pkg_libdir}/clang/%{version}/
%dir %{pkg_libdir}/clang/%{version}/include/
%dir %{pkg_libdir}/clang/%{version}/lib/
%dir %{pkg_libdir}/clang/%{version}/share/
%if !0%{?compat_build}
%{pkg_libdir}/clang/%{maj_ver}
%endif
%if !0%{?compat_build} %if !0%{?compat_build}
%files analyzer %files analyzer
%{_bindir}/scan-view %{_bindir}/scan-view
@ -495,6 +517,9 @@ false
%endif %endif
%changelog %changelog
* Wed Oct 28 2020 Tom Stellard <tstellar@redhat.com> - 11.0.0-2
- Add clang-resource-filesystem sub-package
* Thu Oct 15 2020 sguelton@redhat.com - 11.0.0-1 * Thu Oct 15 2020 sguelton@redhat.com - 11.0.0-1
- Fix NVR - Fix NVR