Subject: bug#76924: 31.0.50; Wrong install location for systemd user unit file

From: Eli Zaretskii <[email-masked]>
Date: Wed, 12 Mar 2025 17:18:59 +0200

> From: Ulrich Müller <[email-masked]>
> Cc: Ulrich Müller <[email-masked]>,  [email-masked],
>   [email-masked]
> Date: Wed, 12 Mar 2025 14:15:23 +0100
> 
> >>>>> On Wed, 12 Mar 2025, Eli Zaretskii wrote:
> 
> > Is there no way of knowing what is systemd's idea of prefix?
> 
> I think that for the majority of installations it would be prefix=/usr.
> 
> > If not, I guess a configure option will have to do, but the question
> > of the default still stands, no?
> 
> Presumably the most common use cases will be:
> 
> - Distros building an Emacs package. These should make sure that prefix
>   is the same for all their packages. So, installing in $(prefix)/lib
>   will be The Right Thing and no option is needed.
> 
> - Users compiling Emacs from the release tarball or from Git. For these
>   we don't really know what the prefix is, it could be /usr/local or
>   some location under their home dir. I believe an option would be
>   useful here.
> 
>   Not entirely sure about the default, but I'd go with $(prefix)/lib
>   also for this case, because: a) /usr/local/lib is in systemd's search
>   path, which covers one of the more common cases, and b) hardcoded
>   /usr/lib (systemd's prefix) may not be writable for the user.

OK, thanks.  Before we decide what to do, would it be possibly to see
what other projects do with systemd files?  (Assuming there are other
projects which install files for systemd's use.)  I'd like to be sure
we are not reinventing the wheel here, if some accepted solution
already exists.