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

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


--=-QrdiRfO9c7q2NLZmc//2
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

On Fri, 2004-03-12 at 16:15, W. Borgert wrote:
> Hi,
>=20
> I like to build a package with CDBS that is made using GNU auto tools.
> The debian/rules has only two relevant lines:
>=20
> include /usr/share/cdbs/1/rules/debhelper.mk
> include /usr/share/cdbs/1/class/autotools.mk
>=20
> 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,
like:

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
somesuch).


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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQBAdiJrOIkJWWp2WGURAhkiAJ9Bh6J4JFGQRfG0zBPwBK9999u47gCePux3
uSVmz+OrY+Plp0OfKStw9GA=
=GtFX
-----END PGP SIGNATURE-----

--=-QrdiRfO9c7q2NLZmc//2--