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

Re: how to take a public package private?



On Tuesday, May 01, 2012 04:15:41 AM Stefano Rivera wrote:
> Hi Ben (2012.05.01_05:08:17_+0200)
> 
> > What is the best *method* to do this, though? How to best use existing
> > tools so as not to re-implement this boilerplate task every time such a
> > package comes along?
> 
> The usual way to make a package private is to do something like:
> 
> override_dh_auto_install:
> 	dh_auto_install -- --install-lib /usr/share/openastromod \
> 	                   --install-scripts /usr/share/openastromod
> 
> Then symlink /usr/share/openastromod/openastromod to
> /usr/bin/openastromod. python will dereference the symlink when setting
> up sys.path.
> 
> SR

This worked as far as moving the python package openastromod

> override_dh_auto_install:
> 	dh_auto_install -- --install-lib /usr/share/openastromod

I removed the "--install-scripts /usr/share/openastromod" because openastromod 
does not have any user invokable scripts and I do have user invokabe scripts 
not inside openastromod.

But I have a number of questions:

1)
How do I tell those scripts about the location of openastromod so they can 
import it? Is the only way to edit the scripts to change sys.path?

What is the standard, established, (I would say cannonical except it would be 
confused with commercial GNU/Linux distro), way to change that path?

2)
The Debian Python policy manual 
http://www.debian.org/doc/packaging-manuals/python-policy/ch-
module_packages.html
not so clearly states:
> Private modules are installed in a private directory such as
> /usr/share/package-name or /usr/lib/package-name. They are generally only
> accessible to a specific program or suite of programs included in the same
> package.

In the above what does package-name mean? Python package-name,  i.e. the 
directory with the __init__.py file, or the debian package?

I think that the directory should be  /usr/share/openastro.org/openastromod, 
because openastro.org is the debian package name and openastromod is the 
python package name. It should at least be specific to the debian package that 
should be the python package's sole user. 

Also because different debian packages could have name space collisions in the 
field of private python package names.

And the openastromod is needed because openastro.org could have more than 1 
private python package. This is my opinion.

Will this be clarified or changed?

Thank You for all your help?


-- 
Paul Elliott                               1(512)837-1096
pelliott@BlackPatchPanel.com               PMB 181, 11900 Metric Blvd Suite J
http://www.free.blackpatchpanel.com/pme/   Austin TX 78758-3117

Attachment: signature.asc
Description: This is a digitally signed message part.


Reply to: