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

Re: Getting dh_install to do what we need



If I understand well, this thread deals, among other things, with
different ways to transmit a variable from debian/rules to dh_install.
- via override_dh_install: and command line arguments
- via debian/*.install static content
- via debian/*.install.in content, preprocessed (with environment variables)
- via debian/*.install execution output (based on environment)

1/ From this point of view, FOO_SOVERSION is similar to
DEB_HOST_MULTIARCH. As the soversion is mentioned in the library
binary package name, only the first solution applies to it, unless the
file is preprocessed *and renamed*.

override_dh_install:
     dh_install --package=libfoo$(FOO_SOVERSION) lib/libfoo.so.$(FOO_SOVERSION) usr/lib/$(DEB_HOST_MULTIARCH)
     dh_install

2/ As a novice packager, I had a hard time figuring the execution flow
of the debhelper tools, and specially variable values transmission
across the hierarchy of subprocesses, even if each step is well
documented. It is quite instructive to read, in this very thread,
experimented DD arguing whether some dpkg-buildflag variable is
available to a particular program called by a dh_tool at a specific
compatibility level, and having to run the program once to know for
sure… The first solution provides, in debian/rules, the equivalent of
a method call with an explicit list of named actual parameters. In
this analogy, environment variables are global variables, and should
be avoided when possible.

3/ The way debhelper splits its work in small tools does not always
fit the separation of human concerns. For example, the following is
IMHO more readable that generating/executing a single debian/*.install
file in which each line deals with a different library.

# foo stuff
override_dh_install::
     dh_install --package=libfoo$(FOO_SOVERSION) lib/libfoo.so.$(FOO_SOVERSION) usr/lib/$(DEB_HOST_MULTIARCH)
override_dh_link::
     dh_link --package=libfoo-dev usr/lib/$(DEB_HOST_MULTIARCH)/libfoo.so.$(FOO_SOVERSION) usr/lib/$(DEB_HOST_MULTIARCH)/libfoo.so
… more foo stuff

# bar stuff
override_dh_install::
     dh_install --package=libbar$(BAR_SOVERSION) lib/libbar.so.$(BAR_SOVERSION) usr/lib/$(DEB_HOST_MULTIARCH)
… more bar stuff

# At the end
override_dh_install::
     dh_install --remaining-packages
override_dh_link::
     dh_link --remaining-packages
… and so on

In short, I think that debian/*.install dynamic content should be
discouraged.


Reply to: