Debian package creation with debhelper: change dependency version

565 Views Asked by At

I'm creating a Debian package using DebHelper, under the latest stable version of Debian.

The "debian/control" file comprises these lines:

Depends:
 ${shlibs:Depends},
 ${misc:Depends}

The dependencies are thus automatically set in the created package. However, the version required of libstdc++ is too strict. The package requires libstdc++6 (>= 4.9) and I want it to be set as libstdc++6 (>= 4.8).

For this purpose and at the reading of this page and this page, I edited the "debian/rules" file which now looks like:

#!/usr/bin/make -f

DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

%:
    dh $@ 

override_dh_makeshlibs:
    dh_makeshlibs -V 'libstdc++6 (>= 4.8)'

The last two lines however did not make the job. Has anyone already did this kind of customization on a Debian package?

Thanks

1

There are 1 best solutions below

0
On

In general, debhelper does a very good job at detecting dependencies.

If it says that your packages requires libstdc++6 (>= 4.9), than your package most likely does require this specific version and will fail with e.g. libstdc++6-4.8. (If you don't believe me, try it out; force-install your package on a system that has only libstdc++6-4.8 installed, and see whether everything works)

If some people claim that it can be build with libstd++6-4.8 (or rather gcc-4.8), then I see to possibilities:

  • either those people are mistaken
  • OR the binary (in your package) will be slightly different, depending on whether it was built against libstdc++6-4.8 or 4.9

Most likely the second point is the case.

This can have numerous reasons, e.g.: - your package automatically enables features if it detects libstdc++6-4.9 - some implementation detail in libstdc++6 has changed which makes the resulting binaries incompatible (or at least: not backwards compatible)

If you want a package that can be used with libstdc++6 == 4.8, than you should use libstdc++6-4.8 (or most likely: the entire g++4.8 toolchain) for building the package.