[Build-common-hackers] Re: cdbs question

Martin-Éric Racine q-funk@pp.fishpool.fi
Thu, 4 Dec 2003 18:29:40 +0200 (EET)


On Thu, 4 Dec 2003, Martin-Éric Racine wrote:

> On Wed, 3 Dec 2003, Colin Walters wrote:
> 
> > > The addition of $(DESTDIR) to the software's crude Makefile was all i=
t took to
> > > make it work with a traditional debian/rules made of dh_* -powered ta=
rgets, but
> > > it won't do with CDBS, for some reason.
> > 
> > Just add this to the end of your debian/rules:
> > 
> > DEB_MAKE_INSTALL_TARGET := install DESTDIR=$(DEB_DESTDIR)
> 
> That finally made CDBS follow the Makefile, except for one buglet:  upstr=
eam's
> ChangeLog ends up being packaged twice:  once as an uncompressed ChangeLo=
g and
[as performed by the Makefile's install target]

> once as a compressed changelog.gz
[as performed by dh_installchangelog, which debhelper.mk calls automatically]

Finally got it to work, but had to use a stupid kludge. The result is as follow:

X8-----
#!/usr/bin/make -f
include /usr/share/cdbs/1/class/makefile.mk
include /usr/share/cdbs/1/rules/debhelper.mk

DEB_MAKE_INSTALL_TARGET := install DESTDIR=$(DEB_DESTDIR)

# FIXME:  Stupid kludge to get around ChangeLog handling contradictions between
# Makefile (install target moves it to /usr/share/doc/$(package)/ChangeLog) and
# CDBS (dh_installchangelog creates /usr/share/doc/$(package)/changelog.gz too)

binary-post-install/foobar::
        rm -f debian/foobar/usr/share/doc/foobar/ChangeLog
X8-----

IMHO, it is perfectly logical for the Makefile to install all the documentation
itself, but then by the time debhelper.mk does its thing, README and ChangeLog
get processed all over again.  Any way to avoid this mess?  Thanks.

-- 
Martin-Éric Racine, ICT Consultant
http://www.pp.fishpool.fi/~q-funk/