[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Shared library packaging question



On Sat, Mar 27, 2010 at 06:35:42PM +0100, Wuttke, Joachim wrote:
> Dear specialists,
> 
> I need more help.  Specifically, I am going to ask 3 questions.
> 
> My debian directory is still messed up, as it has been from the beginning:
> either the automatic scripts are not ready to assist in generating a shared-library
> package, or I used them in wrong way.
> 
> Here my control file :
> 
> ---------------------------------------------------------------------------------------------------------------
> Source: lmfit
> Priority: extra
> Maintainer: Joachim Wuttke <j.wuttke@fz-juelich.de>
> Build-Depends: debhelper (>= 7), autotools-dev
> Standards-Version: 3.8.4
> Section: libs
> Homepage: http://messen-und-deuten.de/lmfit/lmfit.html
> 
> Package: lmfit-dev
> Section: libdevel
> Architecture: any
> Depends: lmfit (= ${binary:Version}), ${misc:Depends}
> Description: Development files for Levenberg-Marquardt library lmfit
>  A self-contained implementation of the Levenberg-Marquardt algorithm.
>  Routine lmmin determines a parameter vector p that minimizes the Euclidean
>  norm of a vectorial function v(p). The most important application is curve
>  fitting: to approximate data y(t) by a function f(t;p), routine lmfit
>  minimizes the norm of the residual vector v = y(t) - f(t;p).
>  .
>  This package contains the include file lmmin.h and some application examples.
> 
> Package: lmfit3
> Section: libs
> Architecture: any
> Depends: ${shlibs:Depends}, ${misc:Depends}
> Description: Least-squares minimization and curve fitting
>  A self-contained implementation of the Levenberg-Marquardt algorithm.
>  Routine lmmin determines a parameter vector p that minimizes the Euclidean
>  norm of a vectorial function v(p). The most important application is curve
>  fitting: to approximate data y(t) by a function f(t;p), routine lmfit
>  minimizes the norm of the residual vector v = y(t) - f(t;p).
>  .
>  This package contains the shared library and the man page lmfit(3).
> ---------------------------------------------------------------------------------------------------------------
> 
> Stanislav suggested I create an additional doc package. Given the small
> size of the entire project, I tend to think it's better not to inflate the packaging
> overhead and to leave the examples in the dev package.

Technically speaking, the content of *-dev package is needed only for
compilation. Now imagine that your library became so popular that 1000
packages in debian build-depend on it. That means that when
autobuilding them your *-dev package will have to be unpacked,
installed and purged 1000 times for 1000 builds, with all its content.

> Question 1:
> Is that permissible, or absolutely forbidden by some rule ?

No, it is not forbidden by the policy, but it is simply not the best
thing to do, IMO.

> Stanislav suggested the package name lmfit0.

No, I did not suggest _this_ name. Please reread my mail carefully.

> By now, however, I succeeded in instructing autotools to generate the
> correct shared library version number so.3.0.2; therefore, it's
> lmfit3.

But I guess, the name of the file that gets installed into /usr/lib is
still liblmmin.so.X.Y.Z? Then, the name of the package with the
library should start with liblmmin.

Use this command ((C) Steve Langasek) to get the correct name

$ objdump -p liblmmin.so.3.0.2 | \
  sed -n -e's/^[[:space:]]*SONAME[[:space:]]*//p' | \
  sed -e's/\([0-9]\)\.so\./\1-/; s/\.so\.//'

Another comment. There was nothing wrong with SONAME ending in 0,
because SONAME is not something that you change with every version.
(I hope you are not going to do that).

> Now I need to hand-edit the install files.
> 
> Seems straightforward for lmfit3.install:
> 
> ---------------------------------------------------------------------------------------------------------------
> usr/lib/lib*.a
> usr/lib/lib*.so
> usr/lib/*.la
> ---------------------------------------------------------------------------------------------------------------
> 
> Less trivially, lmfit-dev.install should install the following:
> 
> lib/lmmin.h   to   prefix/include/lmmin.h

This file should not be a problem, as it is installed to
debian/tmp/usr/include/ by your Makefile at building time.

A line like 

usr/include/*.h

should do the work. Read man dh_install.

> doc/lmfit.3   to   prefix/share/man/man3

This guy belongs to dh_installman. Read man dh_installman.
Add debian/*.manpages. 

> demo/*   to   ?

man dh_installexamples

> Question 2:
> Where should the demo sources be installed to ?

dh_installexamples installs them to /usr/share/doc/<pkgname>/examples

> Question 3:
> Is it possible to write an install file such that the source directory
> (e.g. "lib") is different from the destination directory ("include") ?
> Or do I need to first reorganize my source directories ?

You do not need to reorganize that, Debian tools are enough flexible.

-- 
Stanislav


Reply to: