Closed NateTheGreat68 closed 3 years ago
I'd just use a makefile and maybe pkgconfig to get some paths... An uninstaller isn't really needed because the point here is to make package maintainers happy.
That also means there should be a way to override variables usually auto-detected, e.g. Gentoo Linux can install packages depending on systemd even when that isn't installed. This is because the package manager already knows where systemd files need to go and passes that path to install scripts.
autotools would be totally overkill... Just use pkg-config systemd --variable=systemd_user_unit_dir
in a makefile:
SYSTEMD_USER_UNIT_DIR ?= $(pkg-config systemd --variable=systemd_user_unit_dir)
should do the trick. That way, you could pass in another directory by running make install SYSTEMD_USER_UNIT_DIR=/lib/systemd/user
The only reason I even considered a full autotools implementation was to address the possibility that the commands within the systemd unit files themselves (/usr/games/steam, /usr/bin/flatpak, etc.) could be in different paths on some systems. The thinking was that the final systemd files themselves might need to be "made". Now that I've thought about it some more and looked at the number of distros, especially those using systemd, which have a "/usr merge" folder layout, I agree that autotools is overkill. I'll proceed with just a Makefile.
To detect where Steam is installed, I'd just use which
or type -p
(the latter being more portable). Flatpak probably has similar means of showing what's in the system but I think it can install to user profiles - so it wouldn't be too useful in a system-wide installer. I'd leave the rest to distro package maintainers: They can decide which deps are needed, and they know where those are installed, thus you'll give them opportunity to bypass auto-detection and let them specify paths directly as part of the installation script.
Steam is a little bit different, btw... While it also installs to the local user profile, this is usually initiated by a system-wide steam launcher script - which does both: Start the installed client, or bootstrap the installation into the user profile. Not sure it flatpak has something similar.
I'm going to keep this issue open until it's tested and reviewed, but this was addressed in some significant changes and pulled into dev in #15.
Alright, closing it. Can be reopened if a problem is found later.
Needs to be able to specify the path for executables in the systemd unit files(edit: no; see discussion below), as well as where to install them.Include an uninstaller?(edit: also no, at least for now; see same discussion below).New plan: just a simple Makefile to handle installation.