[Distutils] Python Deb Packages

Damian Johnson atagar1 at gmail.com
Wed Nov 17 17:25:05 CET 2010


> /usr/share/pyshared is Debian tools' internal location and you should not use it

Great, thanks Piotr for the clarification.

> /usr/share/binary_package_name/ to be exact
> --install-lib=/usr/share/yourpackagename/ --install-data=/usr/share/yourpackagename/
> (and maybe --install-scripts=/usr/share/yourpackagename/) should do the
> right thing

Unfortunately not quite. Passing those flags results in:
/usr/share/arm/arm/<package's contents>
/usr/share/arm/arm-1.3.7_dev.egg-info

The egg-info metadata only has relevance if this was being installed
to pyshared so ideally it should be omitted and the package contents
just installed to:
/usr/share/arm/<package's contents>

Setting "--install-lib=/usr/share" adds my package to the right
location, but also includes "/usr/share/arm-1.3.7_dev.egg-info" which
causes a lintian error. A couple quick questions:

- If private python modules aren't supposed to be living in
'/usr/share/pyshared' then shouldn't distutil include an option to
omit the egg-info metadata?

- Any ideas you have for how to remove the egg-info during debian
builds would be much appreciated. Peter has mentioned that a simple
change to the debian/rules [1] should do the trick but I'm still a bit
too new to debian builds to know what.

Cheers! -Damian

[1] https://svn.torproject.org/svn/arm/resources/build/debian/rules

On Tue, Nov 16, 2010 at 11:13 AM, Damian Johnson <atagar1 at gmail.com> wrote:
> Hi, I'm working on deb/rpm packaging for a terminal monitor of tor relays
> [1] and running into an issue with the egg-info distutil autogenerates.
>
> My project currently installs to the default '/usr/share/pyshared' [2] but
> according to the debian policy for private python modules [3] it should be
> installed to '/usr/share' instead (my program is an application and there's
> no reason for it to be importable by other modules). The problem with doing
> this is that the egg-info metadata is hardcoded in
> 'distutils/command/install.py' to be added on install, and having an
> egg-info file on '/usr/share' causes a lintian error when generating the
> deb. Also, most things I've been reading seems to say that the package
> belongs in '/usr/share/pyshared' and that removing the egg-info is kinda
> evil [4].
>
> Help would be appreciated. Cheers! -Damian
>
> [1] http://www.atagar.com/arm/
> [2] https://svn.torproject.org/svn/arm/trunk/setup.py
> [3]
> http://www.debian.org/doc/packaging-manuals/python-policy/ch-programs.html#s-current_version_progs
> [4]
> http://mail.python.org/pipermail/distutils-sig/2007-September/008225.html
>
>


More information about the Distutils-SIG mailing list