![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
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.py
module that subclassesbuild_scripts
, replacing the normal install location with a specificsbin
version - a
install_sbin.py
module that duplicates much of the functionality ofinstall_scripts.py
, picking up the targets from thesbin
build directory and installing them into either thesbin
directory under the standard installation or the value set insetup.cfg
- a
dist.py
module that subclassesdistutils.dist.Distribution
to createCustomDistribution
, adding the attributesself.sbin
andself.libexec
to 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.