5

I'm building a Debian package that depends on libmysqlcppconn7v5. I'm building it on Ubuntu which has libmysqlcppconn7v5 1.1.9, however it is intended to be installed on Debian which has libmysqlcppconn7v5 1.1.7.

debian/control contains following line:

Depends: ${shlibs:Depends}, ${misc:Depends}, libmysqlcppconn7v5 (>= 1.1.7)

When the package is built it still has dependency libmysqlcppconn7v5 (>= 1.1.9)

How can I force it to have a dependency on lower package version than I have installed when building the package?

Stephen Kitt
  • 434,908
Milan
  • 313

1 Answers1

4

If shlibs:Depends ends up specifying version 1.1.9 or later of libmysqlcppconn7v5, that (theoretically) means that the binary you built uses a symbol which is only available in version 1.1.9 or later. So your package won’t necessarily work on Debian with libmysqlcppconn7v5 1.1.7, even if you override the dependencies. (I’m qualifying this somewhat since the package doesn’t provide symbols or shlibs files, so the heuristics aren’t valid.)

As a general rule, you need to build your package on Debian if you want to install it on Debian. This isn’t all that hard to do on Ubuntu; take a look at debootstrap, sbuild and pbuilder. pbuilder in particular can easily be set up to build on multiple distributions.

If you really want to override shlibs:Depends, you can edit the .substvars file that’s generated during the build, after dpkg-shlibdeps has run:

override_dh_shlibdeps:
    dh_shlibdeps
    sed -i s/1.1.9/1.1.7/g debian/yourpackage.substvars
Stephen Kitt
  • 434,908