I use the following in gaim for a similar purpose. It is rather ugly
but works.
# Require Binary Compatible glib
# returns bogus value if glib2-devel is not installed in order for
parsing to succeed
# bogus value wont make it into a real package
%define glib_ver %([ -a %{_libdir}/pkgconfig/glib-2.0.pc ] && pkg-config
--modversion glib-2.0 | cut -d. -f 1,2 || echo -n "999")
Requires: glib2 >= %{glib_ver}
BuildRequires: glib2-devel
This way the SRPM can build on any version of glib2, but the package
enforces the install-time version of glib2.
Why not just add BuildRequires: and have the dependencies to shared libs?
I think that should be enough, especially for really core libraries as glib2
that are anyway installed on all machines.
regards,
Florian La Roche