[Build-common-hackers] Howto use CDBS with auto tools and Python?

Colin Walters walters@verbum.org
Fri, 09 Apr 2004 00:11:23 -0400

Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

On Fri, 2004-03-12 at 16:15, W. Borgert wrote:
> Hi,
> I like to build a package with CDBS that is made using GNU auto tools.
> The debian/rules has only two relevant lines:
> include /usr/share/cdbs/1/rules/debhelper.mk
> include /usr/share/cdbs/1/class/autotools.mk
> The package contains not only C, but also Python code, so Makefile.am
> and configure.ac have the usual entries python_PYTHON and
> AM_PATH_PYTHON.  So far, everything works fine, but by default, the
> package contains .pyc and .pyo files under site-packages/ what is not
> what you want to have in a Debian package. =20

Yeah, automake likes to compile Python itself at install-time.  Maybe it
should have an environment variable or something to disable that.

> A workaround is to
> explicitly list all *.py files in the debian/*.install files, but
> that is cumbersome and leads to another problem: No .pyc or .pyo
> files are created at package installation time.  I assume, that it
> would be enough to call dh_python somewhere, but how exactly?=20

I think you could just hook a call to dh_python into binary-install/foo,

	dh_python -pfoo

>  And shouldn't that be done by CDBS automatically?

We could create a class like python-app.mk or something that would do
the above.  It might also attempt to disable automake's
Python-installing stuff it finds it (and autotools.mk is included or

Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

Version: GnuPG v1.2.3 (GNU/Linux)