0

Lets say I have the following package: zs-boost_1.71.0_armhf.deb. This is custom package that installs boost 1.71 to some custom location (assume /opt/deps).

I also have project that uses this library. It builds and runs fine. Now I'm packaging it. I have the following in debian/control file:

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

I build package using: debuild -b -us -uc -aarmhf. Package can be built and works as expected. My only problem is that its Depends entry in deb's control file is as follows:

Depends: Depends: libc6 (>= 2.9), libpq5 (>= 9.0~), zs-boost, init-system-helpers (>= 1.18~)

Note that zs-boost has no version. How can I fix it? Is it caused by installation to custom directory? I'd assume that if package was identified correctly, then its version should be used as well?

debian/package.substvars contains the following line for shlibs:

shlibs:Depends=libc6 (>= 2.9), libssl1.1 (>= 1.1.0), libuuid1 (>= 2.16), zs-boost

What should I do for the dependencies to be properly versioned? Note that I am not interested in providing version numbers manually, this is only one package and we have 20+ packages that are constantly updated and rebuilt and doing it by hand is out of question.

Thanks in advance.

2
  • Why do you need a versioned dependency? Why do you expect one to be generated? Which version do you expect to b generated then?
    – tripleee
    Commented Feb 19, 2020 at 8:22
  • I need versioned dependency because I version packages and versions change often and our packages won't necessarily work with older versions of packages. I expect that dependency will look like "zs-boost (>= 1.71.0)". I expect that version will generated because it is generated for other libraries/packages. I even tried to to add override_dh_makeshlibs: / dh_makeshlibs -V to "debian/rules", but it does nothing. In fact it seems that DEBIAN/shlibs file should be generated by dh_makeshlibs, but it isn't. Commented Feb 19, 2020 at 8:40

1 Answer 1

1

If you want a versioned dependency, put one in debian/control.

Depends: zs-boost (>= 1.71.0)

The versioned dependency on a specific version of libc6 you see in the generated shlibs is ultimately down to a similar explicit declaration determined (usually conservatively and with great care) by a package maintainer.

5
  • I'm sorry, but I specifically noted that I don't want to create dependencies by hand - version of libc6 for is generated automatically for my package and it definitely isn't determined with great care by package maintainer, as I am this package's maintainer and as you can see I only specified ${shlibs:Depends} in Depends section of my package. I assumed that adding -V to dh_makeshlibs would, as described on program's manpage add pacakge's version automatically, but it isn't so. Commented Feb 19, 2020 at 9:16
  • If the libc6 dependency were blindly generated from whichever version you happened to have installed, you'd see something like (==2.28-10). The >= 2.9 corresponds to an ABI change which the maintainer deemed to be significant enough to warrant prohibiting earlier versions.
    – tripleee
    Commented Feb 19, 2020 at 9:27
  • Ok, sorry, only after experimenting more I realised that you meant not shlibs file in package that lacked dependencies, but shlibs in zs-boost package. After overriding call to dh_makeshlibs and rebuilding package (but earlier gcc 9.2.0, but earlier...), I finally got proper dependencies in my final package. This is great. Thank you. Commented Feb 19, 2020 at 21:22
  • Your edit suggestion was rejected, and I can't say I really want to incorporate it here. Maybe post a separate answer if you think it's important.
    – tripleee
    Commented Feb 20, 2020 at 9:54
  • I thought it is important, because right now your answer is misleading in a sense that if some (like me) is not intimately familiar with deb building, "shlibs" that you mention is assumed (wrongly) to be from "package", not from "zs-boost", so package that "package" depends on. I already know how it works so I don't really care, I just thought that fuller answer will be more useful in the future. Commented Feb 20, 2020 at 10:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.