From 98c3e4dee8a30c247d7967def84adea5aeb8640b Mon Sep 17 00:00:00 2001 From: Guillaume Chazarain Date: Sun, 26 May 2013 18:29:43 +0200 Subject: [PATCH] Make setup.py install the iotop script in sbin/ instead of bin/. --- setup.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/setup.py b/setup.py index fdfbe00..cd639ca 100755 --- a/setup.py +++ b/setup.py @@ -1,8 +1,16 @@ #!/usr/bin/env python from distutils.core import setup +from distutils.command import install as distutils_install from iotop.version import VERSION +# Dirty hack to make setup.py install the iotop script to sbin/ instead of bin/ +# while still honoring the choice of installing into local/ or not. +if hasattr(distutils_install, 'INSTALL_SCHEMES'): + for d in distutils_install.INSTALL_SCHEMES.itervalues(): + if d.get('scripts', '').endswith('/bin'): + d['scripts'] = d['scripts'][:-len('/bin')] + '/sbin' + setup(name='iotop', version=VERSION, description='Per process I/O bandwidth monitor', -- 2.11.4.GIT