Closed ghost closed 2 years ago
This should be /lib/systemd/system
.
This should be
/lib/systemd/system
.
/lib
is almost always a symlink to /usr/lib
, so installing to /usr/lib/systemd/system
is correct.
I also modified this PR to install the udev rule and the modules-load file to the correct locations in /usr/lib
as well.
Almost always. That's not the default in Gentoo and some other distributions. I would go with /lib
. I can see from my system that practically everything installs there.
I can see why you say so @Ta180m . It is true that /lib
is considered to be a legacy symlink according to to file-hierarchy(7). For right now, Gentoo does not fully follow this standard.
Would you consider making this PR query for the path instead of hard-coding? You can call systemd-path systemd-system-unit
to get the path for the unit with execute_process(COMMAND systemd-path systemd-system-unit OUTPUT_VARIABLE SYSTEMD_SYSTEM_UNIT_PATH)
then use ${SYSTEMD_SYSTEM_UNIT_PATH}
.
You can do the same for modules-load.d with systemd-path modules-load
.
For udev this should work: pkg-config --variable=udevdir udev
then add rules.d/
to the end. If this command fails, fallback to /usr/lib/udev
.
Here is what we use in blueman https://github.com/blueman-project/blueman/blob/main/configure.ac#L213 (I know this is cmake but you get what is intended)
One last thing: you should fallback if execute_process()
fails. You can check the RESULT_VARIABLE <name>
value (integer).
Thanks for making this dynamic, but there's a much better way. pkg_get_variable! I think this will respect the PKG_CONFIG
environment variable too, which is good for Gentoo.
This is the standard location for systemd service files. I initially posted a comment about this on the AUR package but the maintainer told me to get it fixed upstream instead.
Fixes #96