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

Re: Getting dh_install to do what we need

Nicolas Boulenguez <nicolas.boulenguez@free.fr> writes:

> 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

We'll have to disagree here, I find the above overrides awkward, and
harder to follow than this:

| export FOO_SOVERSION=1.0
| %:
| 	dh $@

| #!/usr/bin/dh_subst
| lib/libfoo.so.${FOO_VERSION} usr/lib/${DEB_HOST_MULTIARCH}

And so on...

Why do I find it more readable? Because there aren't any
overrides. Overrides are a horrible, horrible way to customize a
build. They don't really follow the make flow one normally

Going the executable script route, you can get rid of the overrides, and
I honestly fail to see how a she-bang line would make it less

Okay, okay, you will have to trust dh_subst to do the right thing. But
you already trust debhelper, and dh_subst will be a *very* lightweight
and dead-simple tool.

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

I disagree, and think that dynamic debhelper files should be encouraged
over overrides.

But each to his own, I guess. We all can use whichever method we prefer,
as both work, and none of us is forced to use the other method if we
don't want to.

In the end, both ways work, and no matter how I happen to feel about
overrides, neither them, nor executable scripts should be discouraged.


Reply to: