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:
build_sbin.pymodule that subclasses
build_scripts, replacing the normal install location with a specific
install_sbin.pymodule that duplicates much of the functionality of
install_scripts.py, picking up the targets from the
sbinbuild directory and installing them into either the
sbindirectory under the standard installation or the value set in
dist.pymodule that subclasses
CustomDistribution, adding the attributes
self.libexecto allow these keywords to be passed through from
distutils.core.setup()and used by the custom build and install modules.
With all this in place, it was simply a matter adding the keyword
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.