Skip to content

Commit b40cb52

Browse files
committed
io-libs/adios2: require yaml-cpp by SONAME instead of package 🔗
yaml-cpp in EPEL 10 is regularly updated to versions with a new SONAME, while the previous library moves to a compat package. As AutoReq is disabled for adios2, the dependency was a plain "Requires: yaml-cpp", which does not ensure the library adios2 was linked against stays installed. Determine the SONAME provide of the library behind libyaml-cpp.so at build time and require that instead, matching what rpm's automatic dependency generator would produce. Fall back to the package name if it cannot be determined. Signed-off-by: Adrian Reber <adrian@lisas.de>
1 parent 8827174 commit b40cb52

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎components/io-libs/adios2/SPECS/adios2.spec‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,16 @@ AutoReq: no
3131
BuildRequires: bzip2-devel
3232
BuildRequires: zlib-devel
3333
BuildRequires: yaml-cpp-devel
34+
# AutoReq is disabled, so add the yaml-cpp dependency manually. Depend on the
35+
# SONAME of the library adios2 is linked against instead of on the package
36+
# name: yaml-cpp is regularly updated to versions with a new SONAME and the
37+
# old library is then provided by a compat package.
38+
%global yaml_cpp_soname %(rpm -q --provides -f "$(readlink -f %{_libdir}/libyaml-cpp.so 2>/dev/null)" 2>/dev/null | grep '^libyaml-cpp[.]so' | head -n1)
39+
%if "%{yaml_cpp_soname}" != ""
40+
Requires: %{yaml_cpp_soname}
41+
%else
3442
Requires: yaml-cpp
43+
%endif
3544

3645
BuildRequires: libtool cmake make
3746
Requires: environment(modules)%{PROJ_DELIM}

0 commit comments

Comments
 (0)