开发者

How to install scripts to sbin with python's distutils?

开发者 https://www.devze.com 2023-02-10 20:40 出处:网络
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 w

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消