0

I am new to packaging and I'm trying to package a library that one of my programs uses. The library is called Plytapus and it's used by the PerfectTIN program. You can find source code for both of them on my GitHub site, https://github.com/phma/, and on the PerfectTIN site, http://bezitopo.org/perfecttin/download.html . The source packages are on https://launchpad.net/~phma-a/+archive/ubuntu/testing .

I tried to build the PerfectTIN package after adding plytapus-dev to the build requirements (with only plytapus installed, it built without plytapus) and got a failure. It turned out that the plytapus package is missing the .so file. I edited the files in the debian directory and tried again.

changelog

plytapus (0.6.0-3) focal; urgency=medium

  * Remove extra asterisk from plytapus1.install

 -- Pierre Abbat <[email protected]>  Sun, 20 Dec 2020 14:02:52 -0500

plytapus (0.6.0-2) focal; urgency=medium

  * Add cmake as dependency

 -- Pierre Abbat <[email protected]>  Mon, 23 Nov 2020 03:42:16 -0500

plytapus (0.6.0-1) focal; urgency=medium

  * Initial release

 -- Pierre Abbat <[email protected]>  Tue, 17 Nov 2020 02:18:06 -0500

plytapus1.install

usr/lib/lib*.so.*
usr/lib/lib*.a

control

Source: plytapus
Priority: optional
Maintainer: Pierre Abbat <[email protected]>
Build-Depends: debhelper-compat (= 12), cmake (>= 3.4)
Standards-Version: 4.4.0
Section: libs
Homepage: https://github.com/phma/plytapus
#Vcs-Browser: https://salsa.debian.org/debian/plytapus
#Vcs-Git: https://salsa.debian.org/debian/plytapus.git

Package: plytapus-dev
Section: libdevel
Architecture: any
Multi-Arch: same
Depends: plytapus (= ${binary:Version}), ${misc:Depends}
Description: Library for reading and writing PLY files
 Plytapus is a C++ library for reading and writing PLY (Stanford polygon)
 files.
 .
 This package provides the header files.

Package: plytapus
Architecture: any
Multi-Arch: same
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: Library for reading and writing PLY files
 Plytapus is a C++ library for reading and writing PLY (Stanford polygon)
 files.
 .
 This package provides the shared and static library.

Here is the relevant section of the build log:

make[2]: Leaving directory '/home/phma/package/plytapus-0.6.0/obj-x86_64-linux-gnu'
Install the project...
/usr/bin/cmake -P cmake_install.cmake
-- Install configuration: "None"
-- Installing: /home/phma/package/plytapus-0.6.0/debian/tmp/usr/lib/libplytapus.so.0.6.0
-- Installing: /home/phma/package/plytapus-0.6.0/debian/tmp/usr/lib/libplytapus.so
-- Installing: /home/phma/package/plytapus-0.6.0/debian/tmp/usr/lib/libplytapus.a
-- Installing: /home/phma/package/plytapus-0.6.0/debian/tmp/usr/include/plytapus.h
-- Installing: /home/phma/package/plytapus-0.6.0/debian/tmp/usr/include/plytapus/config.h
-- Installing: /home/phma/package/plytapus-0.6.0/debian/tmp/usr/include/plytapus/textio.h
make[1]: Leaving directory '/home/phma/package/plytapus-0.6.0/obj-x86_64-linux-gnu'
   dh_install
   dh_installdocs
   dh_installchangelogs
   dh_perl
   dh_link
   dh_strip_nondeterminism
   dh_compress
   dh_fixperms
   dh_missing
dh_missing: usr/lib/libplytapus.so.0.6.0 exists in debian/tmp but is not installed to anywhere
dh_missing: usr/lib/libplytapus.a exists in debian/tmp but is not installed to anywhere
    The following debhelper tools have reported what they installed (with files per package)
     * dh_install: plytapus (0), plytapus-dev (3)
     * dh_installdocs: plytapus (0), plytapus-dev (0)
    If the missing files are installed by another tool, please file a bug against it.
    When filing the report, if the tool is not part of debhelper itself, please reference the
    "Logging helpers and dh_missing" section from the "PROGRAMMING" guide for debhelper (10.6.3+).
      (in the debhelper package: /usr/share/doc/debhelper/PROGRAMMING.gz)
    Be sure to test with dpkg-buildpackage -A/-B as the results may vary when only a subset is built
    For a short-term work-around: Add the files to debian/not-installed
   dh_dwz
   dh_strip
   dh_makeshlibs
   dh_shlibdeps
   dh_installdeb
   dh_gencontrol
dpkg-gencontrol: warning: Depends field of package plytapus: substitution variable ${shlibs:Depends} used, but is not defined
   dh_md5sums
   dh_builddeb
dpkg-deb: building package 'plytapus-dev' in '../plytapus-dev_0.6.0-3_amd64.deb'.
dpkg-deb: building package 'plytapus' in '../plytapus_0.6.0-3_amd64.deb'.

How can I fix this so that the .so and .a files are in the plytapus package?

2 Answers 2

0

Repeating my answer from https://lists.launchpad.net/launchpad-users/msg07147.html:

  1. The upstream build system installs to .../usr/lib/lib*.so.*, but in the version of your packaging that I downloaded debian/plytapus1.install says usr/lib/*/lib*.so.*, not usr/lib/lib*.so.* as you quoted above. You need to drop the /* bit. (I'm guessing that you used dh-make, and it's assuming that the upstream cmake configuration follows the recommendation in https://wiki.debian.org/Multiarch/Implementation#CMake, but this package doesn't do that; so you need to either make the packaging expect pre-multiarch paths or change the upstream cmake configuration to be multiarch-friendly as in that wiki page.)
  2. debian/control has the runtime library package name as plytapus, which means that debian/plytapus1.* are entirely ignored.
  3. Library package names should start with "lib".
  4. The "1" bit is currently incorrect anyway; the Debian Policy Manual says that it should match the version number in the library's SONAME, which in this case is "0.6.0" (you can use objdump -p on the .so file to see it). You'll need to make sure to change this any time the upstream SONAME changes.
  5. It looks as though you aren't currently setting a SONAME explicitly in the upstream cmake configuration and are just leaving cmake to guess at one. Perhaps this is unintentional, since it amounts to saying that every new upstream release may be entirely ABI-incompatible with every previous one. If this isn't what you meant, then you should set SOVERSION in the upstream cmake configuration (I think; I'm not very fluent in cmake) and possibly read up on the sorts of things you need to do when maintaining a C++ library interface. Symbols files are a useful discipline if possible.

So, putting that together, you should remove the /* from debian/plytapus1.install. You should rename debian/plytapus1.install to debian/libplytapus0.6.0.install and debian/plytapus-dev.install to debian/libplytapus-dev.install. You should change the two "Package:" lines in debian/control from plytapus-dev and plytapus to libplytapus-dev and libplytapus0.6.0, and also adjust libplytapus-dev's Depends line to match. You can also remove debian/*.dirs entirely since they don't seem to be needed. And I'd recommend sorting out the upstream ABI situation, after which you'll need to adjust the library package names again to match (if your library in fact has a fairly stable ABI, then you'll be rewarded by not having to change the binary package names for a while).

0

I think this is because the filename is wrong. Try renaming plytapus1.install to plytapus.install.

4
  • That does put the .so file in the package, but I found out elsewhere that the 1 should be the SONAME version number, which is 0.6.0 in this library. (I think it should really be 0.6, but I'm somewhat new to writing libraries.) Dec 25, 2020 at 9:15
  • Then you should rename package name. install filename should match package name.
    – cges30901
    Dec 26, 2020 at 13:48
  • For changing SONAME in CMake, you can use SOVERSION. Here is an example.
    – cges30901
    Dec 26, 2020 at 14:32
  • In addition, Static library should be put in -dev package.
    – cges30901
    Dec 26, 2020 at 14:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .