michaelrsweet / lprint

A Label Printer Application
https://www.msweet.org/lprint
Apache License 2.0
219 stars 29 forks source link

configure: Add --with-systemd option #50

Closed zdohnal closed 2 years ago

zdohnal commented 2 years ago

NEW:

The option gives a way how to disable systemd unit file installation and provides a way how to define a different systemd unit dir.

OLD version:

zdohnal commented 2 years ago

@zdohnal So I think AC_ARG_WITH (as in --with-systemd[=PATH]) would be more appropriate,

TBH setting the path via configuration option looked as an overkill for me (AFAIK if someone installs systemd, its system service files would lie in /usr/lib/systemd/system), so env variable looked fine for such a corner case.

and in the makefile the "else" should be changed to an "elif" with the condition that $(unitdir) isn't empty allowing --without-system to be supported.

Ah, this one I've missed - that's what I get from switching from one thing to another... thx.

Also, shouldn't we be using ${libdir}/systemd/... for the default path and not hardcoding to /usr/lib/systemd? It's fine for a system package to put things in /usr but most local/site installs use /usr/local (default prefix) or /opt (FHS).

Using ${libdir} would result into /usr/[local/]lib64 on 64b archs and systemd (CUPS does behave in similar way :) ) looks only into /usr/[local/]lib/systemd/system. So we can use the prefix, but not ${libdir} (IIUC).

zdohnal commented 2 years ago

Thank you for looking into it! :)