1

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

Davy
  • 429
  • 2
  • 17
  • I've read the documentation and your proposed solution seems valid. When you inspect the resulting `DEBIAN/control` file does it contain any particular version? You said you're building the packge for the latest Debian stable (I assume jessie) which packages `libstdc++6` 4.9.2. Is it necessary under these conditions to relax the version requirement? (In other words wouldn't package targeted for different distribution work better?) – Werkov May 31 '15 at 10:13
  • The resulting DEBIAN/control is what I check after the package is done. I have Jessie which packages lidstdc++4.9.2 as you said. I don't know if it's a good idea but other people said that the software can be built with the version 4.8 so I could relax the version in the package. The package would be thus compatible with other debian-based distributions. – Davy May 31 '15 at 16:40

1 Answers1

0

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.

umläute
  • 28,885
  • 9
  • 68
  • 122