How to install scripts to sbin with python's distutils?
Commonly on most unix systems there is a distinction between $PREFIX/bin
and $PREFIX/sbin
. When installing a piece of software the administrator decides about what $PREFIX
is, but the author decides which programs are suitable for regular users and which are not. With Python's distutils
a set of scripts
can be defined and they are installed to $PREFIX/bin
. So how to install a script to the corresponding sbin directory?
Note that in this case solutions targeting only Linux are welcome, because other parts of开发者_开发知识库 the software in question depend on iptables.
You can specify where files should be installed in the data_files parameter. It should work putting '/sbin' in the directory specification:
setup(...,
data_files=[('/sbin', ['rootfill']),
('/etc/init.d', ['init-script'])]
)
For distutils, we are working on support to install scripts into prefix/sbin.
精彩评论