sbin and libexec directories.
After reading my way through the various commands included in distutils, I worked came up with a series of modules to deal with the problem:
- a
build_sbin.pymodule that subclassesbuild_scripts, replacing the normal install location with a specificsbinversion - a
install_sbin.pymodule that duplicates much of the functionality ofinstall_scripts.py, picking up the targets from thesbinbuild directory and installing them into either thesbindirectory under the standard installation or the value set insetup.cfg - a
dist.pymodule that subclassesdistutils.dist.Distributionto createCustomDistribution, adding the attributesself.sbinandself.libexecto allow these keywords to be passed through fromdistutils.core.setup()and used by the custom build and install modules.
With all this in place, it was simply a matter adding the keyword distclass=CustomDistribution to setup() and adding the appropriate libraries to cmdclass — I eventually moved this into CustomDistribution even though I'm pretty sure it's not the right thing to do, because I thought I was going to want to do it every time.
This may all seem a bit baroque but got two significant bits of code that need to be installed in this fashion and I need something to reduce the complexity of the install processs and to provide a single command that can be used to regress the current version to an older one in the event of problems. And finally, after a morning of hackery, I think I've got something that will fulfil my requirements.