From dba9a719d5beecdc8d18849206dc6c528982cd9c Mon Sep 17 00:00:00 2001 From: Martin Bogdanov Date: Thu, 5 Feb 2026 18:58:30 +0200 Subject: [PATCH] make(install): edit systemd service `Exec` path to include `$PERFIX` (#104) * edit systemd service exec path at install time to make it reflect binary install location * move removal of intermediary service file to clean recipe * move sed-generated service file to dist --- Makefile | 4 +++- services.mk | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 2baa46f..30cc9b1 100644 --- a/Makefile +++ b/Makefile @@ -36,7 +36,9 @@ lidm: $(OBJ) $(CC) -o $@ $^ $(ALLFLAGS) $(LIBS) $(LDFLAGS) clean: - rm -f $(ODIR)/*.o lidm + rm -f \ + $(ODIR)/* \ + lidm install: lidm mkdir -p ${DESTDIR}${PREFIX}/bin ${DESTDIR}${PREFIX}/share/man/man{1,5} diff --git a/services.mk b/services.mk index c09c360..6b0bc7e 100644 --- a/services.mk +++ b/services.mk @@ -26,7 +26,8 @@ install-service: fi install-service-systemd: - install -Dm644 ./assets/services/systemd.service ${DESTDIR}${PREFIX}/lib/systemd/system/lidm.service + @sed -e 's|ExecStart=/usr/bin/lidm|ExecStart=${DESTDIR}${PREFIX}/bin/lidm|' ./assets/services/systemd.service > ./dist/lidm.service + install -Dm644 ./dist/lidm.service ${DESTDIR}${PREFIX}/lib/systemd/system/lidm.service @printf '\033[1m%s\033[0m\n\n' " don't forget to run 'systemctl enable lidm'" install-service-dinit: install -m644 ./assets/services/dinit ${DESTDIR}/etc/dinit.d/lidm