socratools / socranop

Soundcraft Notepad mixer tools for Linux
MIT License
8 stars 2 forks source link

installtool: clarify roles, then name, implement and document properly #66

Closed ndim closed 8 months ago

ndim commented 1 year ago

As we discovered in https://github.com/socratools/socranop/issues/63, the socranop installtool socranop-installtool plays different roles, and the naming of these roles and therefore the actual roles are confusing. We should name things better, and fix the issues caused by the unclear roles.

Probably more aspects to follow.

ndim commented 1 year ago

So...

socranop-installtool
====================

Help with the parts of socranop installation and setup, and reversing installation and setup, which exceed Python's builtin install and uninstall capabilities. This comprises

  * checking library dependencies are installed
  * bash completion files for the executables
  * D-Bus service file
  * Man page files
  * XDG desktop and icon files
  * Linux udev rules file

Arguments:
  -h, --help    Show help text and exit
  -V, --version Show software version and exit
  -n, --dry-run Do not actually do anything, just show what would be done.

socranop-installtool post-pip-install
-------------------------------------

To be run after `pip install socranop`, `pip install --user socranop`, and similar `pipenv` and `pip` based installations.

Arguments:
  --no-launch  Do not launch the socranop D-Bus service. Optional argument.
  --sudo-script FILENAME
               The FILENAME to write the sudo script to, with commands to be run by privileged users. Optional argument.

socranop-installtool pre-pip-uninstall
--------------------------------------

To be run before `pip uninstall socranop`, `pip uninstall --user socranop`, and similar `pipenv` and `pip` based uninstalls.

Arguments:
  --sudo-script FILENAME
               The FILENAME to write the sudo script to, with commands to be run by privileged users. Optional argument.

socranop-installtool package-build-install
------------------------------------------

To be run while building a package, namely in the install part of the package where the software is installed into the package buildroot chroot environment.

Arguments:
  --chroot CHROOT  The package buildroot chroot environment. Mandatory argument.
ndim commented 1 year ago

Here is a section on

Why socranop-installtool?

The stock python packaging infrastructure has between no and limited support for installing configuration and resource files into well-known system directories where they configure system services to integrate a python application like socranop with the system.

For socranop, there are two classes of these configuration and resource files:

While there might be a way to hook substitution and install location support into the more modern python packaging which uses pyproject.toml with a backend other than setuptools, those do appear to support editable development installations at all.

While there is https://pypi.org/project/install-freedesktop/ which works for .desktop files and icon files, it does not with all types of installations either or do adaptations for any other files besides .desktop.

So we put the content substitutions and the file installations into our own installation tool and called it socranop-installtool.