[Distutils] Install a script to <prefix>/sbin instead of <prefix>/bin

Daniel Holth dholth at gmail.com
Mon Dec 2 20:17:42 CET 2013


On Mon, Dec 2, 2013 at 9:14 AM, Michael Jansen <info at michael-jansen.biz> wrote:
> Hi
>
>
>
> I am currently working on the cobbler (http://cobblerd.org) setup.py and
> trying to improve it. It currently is only capable of installing to /usr for
> several reasons. Since i would like to have virtualenv support when running
> it i am trying to change that. While doing that i managed to meet one of the
> standard problems with distutils/setuptools - a search returns results of
> 2004 or older - which still seems to be unsolved.
>
>
>
> I would be willing to change that but my recent research leaves me a bit
> confused with all that setuptools is not dead, distlibs, tuf and wheels
> stuff.
>
>
>
> So here is the question. If i am willing to do the work is it possible to
> add something like sbin_scripts (or admin_scripts?) to distutils?
>
>
>
> I locally solved the problem like that http://pastebin.kde.org/pqrwrud1p (or
> attached).
>
>
>
> The implementation expands INSTALL_SCHEMA and reuses install_scripts to
> install those sbin_scripts too. That could be debatable. Perhaps a dedicated
> build|install_xxx_scripts command.
>
>
>
> I want to add that fhs also has a libexec folder (usually
> /usr/lib/<project>/libexec these days) destined for scripts that are
> supposed to be only called by other scripts/programs not manually.
>
>
>
> And cobbler for installs python scripts for modwsgi into /srv/www/cobbler/ .
> So i guess just adding sbin_scripts is not really the solution. Perhaps
> something more flexible is needed.
>
>
>
> Or should i wait for nextgen distlib based swiss knife python build tool and
> for now keep my local additions (there are more).
>
>
>
> --
>
> Michael Jansen
>
> http://michael-jansen.biz

It would be fairly simple to propose adding the GNU coding standard
directory variables:
http://www.gnu.org/prep/standards/html_node/Directory-Variables.html .
They could become valid names under the wheel .data/ directory.

You would also want to figure out how to instruct the installer to
generate scripts wrappers for these alternative destinations so e.g.
the execute bit is set and the #! line points to the correct
interpreter.

It would be a good idea to consider the needs of Windows and
virtualenv users who may need to be able to opt out of the "install
things anywhere on my system" and "full FHS compliance" features.


More information about the Distutils-SIG mailing list