BinaryBuilder specifying strict dependencies versions

I have a small binary package, that I am building with BinaryBuilder, it links to HDF5 and NetCDF4.
I would like to specify exact versions of these packages, currently I am using following code:

...
Dependency(PackageSpec(;name="HDF5_jll", uuid="0234f1f7-429e-5d53-9886-15a909be8d59"),v"1.12.2+2",compat="1.12.2"),
Dependency(PackageSpec(;name="NetCDF_jll",uuid="7243133f-43d8-5620-bbf4-c2c921802cf3"),v"400.902.5+1",compat="400.902.5"), #
...

However, when I install the package (julia version 1.9.0) it installs HDF5_jll version 1.14.0+0 and NetCDF_jll version 400.902.208+0
Consequently, when I try using my package, I am receiving an error: libhdf5.so.200: cannot open shared object file: No such file or directory

So, what’s the correct way to pin the binary dependency ?

The problem is that hdf5 breaks the ABI nilly willy between minor versions (please direct any complaints about this to the upstream developers, we have no control over that), so you can either be compatible with hdf5 1.12 or 1.14. You don’t have the same problem with netcdf, I think. The compat argument uses the Pkg compat syntax, so you can use

Dependency(PackageSpec(;name="HDF5_jll", uuid="0234f1f7-429e-5d53-9886-15a909be8d59"); compat="~1.14.0"),
Dependency(PackageSpec(;name="NetCDF_jll",uuid="7243133f-43d8-5620-bbf4-c2c921802cf3"); compat="400.902.208"),

Thank you, that works!