[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Dependency from a specific binary version



Le 07/10/11 10:16, Ole Streicher a écrit :
> Hi,
> 
> in a library that I want to package for Debian, there is a runtime check
> that another library has the same version number as at compile time:
> 
> -------------------------------8<-------------------------------------
> float cfitsio_version;
> const float cfitsio_version_diff = fits_get_version(&cfitsio_version)
>     - (CPL_CFITSIO_VERSION);
> 
> if (cfitsio_version_diff < -100.0 * FLT_EPSILON) {
>    // set error
> } else if (cfitsio_version_diff > 100.0 * FLT_EPSILON) {
>   // set error
> }
> -------------------------------8<-------------------------------------
> 
> This looks ugly enough to me :-) and should probably go into the package
> dependency. How should one do that? The easiest way would be to put the
> cfitsion version number directly into the control file:
> 
> -------------------------------8<-------------------------------------
> Build-Depends: debhelper (>= 7.0.50), autotools-dev, libcfitsio3-dev (= 3.280)
> ....
> Package: libcplcore12
> Depends: ${misc:Depends}, ${shlibs:Depends}, libcfitsio3 (= 3.280)
> ....
> -------------------------------8<-------------------------------------

I believe you may be looking for ${binary:Version} and ${source:Version}
(see [1]).

Build-Depends: debhelper (>= 7.0.50), autotools-dev, libcfitsio3-dev (=
${source:Version})

Package: libcplcore12
Depends: ${misc:Depends}, ${shlibs:Depends}, libcfitsio3 (= 3.280)


Package: libcplcore12
Depends: ${misc:Depends}, ${shlibs:Depends}, libcfitsio3 (=
${binary:Version})


But since your two packages are not built from the same source, this may
not work perfectly (or not at all). In perticular, binNMUs will be
tricky (they will be tricky also if you do the same thing manually.

Anyway, with "=" you will need to put the exact version, including the
Debian revision: 3.280-12 for instance.

If this is an option for you and the CFITSIO maintainer, you could
bundle the two as a single source package. In that case, using
${binary:Version} and ${source:Version} will be much easier.

Regards, Thibaut.

[1]
http://www.debian.org/doc/debian-policy/ch-sharedlibs.html#s-sharedlibs-intradeps


Reply to: