← Back to team overview

launchpad-users team mailing list archive

Re: Packaging a library and an app/lib

 

On Fri, Nov 20, 2020 at 01:06:21AM -0500, Pierre Abbat wrote:
> I am new to packaging (just built my first Ubuntu packages this week) and have 
> some questions about libraries.

launchpad-users@ is mostly about issues specifically with Launchpad,
rather than issues with Ubuntu packaging.  But I'll see what I can do
here ...

> 1. I'm trying to package a library called plytapus. I told dh_make it's a 
> library, edited files in debian, and ran debuild. Here's the tail of the 
> output:

In general, dh_make gives you an initial skeleton that you're supposed
to edit to suit the thing you're packaging.  It's not necessarily
expected to do a perfect job all by itself.

> 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
[...]
> dh_install: Cannot find (any matches for) "usr/lib/*/lib*.so" (tried in ., 
> debian/tmp)
> 
> dh_install: plytapus-dev missing files: usr/lib/*/lib*.so

The cmake rules here apparently install the library into /usr/lib/,
while dh_make expects it to have ended up in a subdirectory depending on
the architecture (usually something like /usr/lib/x86_64-linux-gnu/).
See https://wiki.debian.org/Multiarch/Implementation for technical
details here, including how to get cmake to do the right thing.

Alternatively, as a first pass you could edit debian/*.install to say
"usr/lib/lib*.so" rather than "usr/lib/*/lib*.so".  This won't get you
modern multiarch library support, but it will get things working for
now.

> dh_install: Cannot find (any matches for) "usr/lib/*/pkgconfig/*" (tried in ., 
> debian/tmp)
> 
> dh_install: plytapus-dev missing files: usr/lib/*/pkgconfig/*
> dh_install: Cannot find (any matches for) "usr/share/pkgconfig/*" (tried in ., 
> debian/tmp)
> 
> dh_install: plytapus-dev missing files: usr/share/pkgconfig/*

pkg-config (https://www.freedesktop.org/wiki/Software/pkg-config/)
integration isn't something that packagers are normally expected to add.
If the upstream package you're working with doesn't include pkg-config
integration, then you should remove those lines from debian/*.install.

> 2. Another program I'd like to package is Quadlods. This can be used two ways: 
> as a library by C++ programs, and as an application, which can be run by apps 
> in any language by talking on a socket. Should I tell dh_make it's a library 
> or an application?

I expect you'll have to do a fair amount of manual work here; this is
beyond what dh_make can do by itself.  Telling dh_make that it's a
library is probably a better starting point, but you might for example
try doing both in different scratch directories and compare the results
to get an idea of how to merge them.

-- 
Colin Watson (he/him)                           [cjwatson@xxxxxxxxxxxxx]


References