diff --git a/Makefile b/Makefile index d9e67e7..5667ff2 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,7 @@ CPPFLAGS += -I/usr/X11R6/include -L/usr/X11R6/lib LDLIBS += -lX11 -lXfixes PREFIX ?= /usr/local bindir := $(PREFIX)/bin +systemd_user_dir = $(DESTDIR)$(PREFIX)/lib/systemd/user debug_cflags := -D_FORTIFY_SOURCE=2 -fsanitize=leak -fsanitize=address \ -fsanitize=undefined -Og -ggdb -fno-omit-frame-pointer \ -fstack-protector-strong @@ -29,7 +30,8 @@ debug: CFLAGS+=$(debug_cflags) install: all mkdir -p $(DESTDIR)$(bindir)/ install -pt $(DESTDIR)$(bindir)/ $(addprefix src/,$(bins)) - install -Dp -m 644 init/clipmenud.service $(DESTDIR)$(PREFIX)/lib/systemd/user/clipmenud.service + mkdir -p $(systemd_user_dir) + sed 's|@bindir@|$(bindir)|g' init/clipmenud.service.in > $(systemd_user_dir)/clipmenud.service uninstall: rm -f $(addprefix $(DESTDIR)$(PREFIX)/bin/,$(bins)) diff --git a/init/clipmenud.service b/init/clipmenud.service.in similarity index 73% rename from init/clipmenud.service rename to init/clipmenud.service.in index c36ab4a..f68267b 100644 --- a/init/clipmenud.service +++ b/init/clipmenud.service.in @@ -2,7 +2,7 @@ Description=Clipmenu daemon [Service] -ExecStart=/usr/bin/clipmenud +ExecStart=@bindir@/clipmenud Restart=always RestartSec=500ms @@ -13,8 +13,8 @@ ProtectKernelTunables=yes RestrictAddressFamilies= RestrictRealtime=yes -# We don't need to do any clean up, so if something hangs (borked xclip, etc), -# it's going to stay that way. Just forcefully kill and get it over with. +# We don't need to do any clean up, so if something hangs (borked X server, +# etc), it's going to stay that way. Just forcefully kill and get it over with. TimeoutStopSec=2 [Install]