Skip to content

Commit

Permalink
make install: Templatise install location
Browse files Browse the repository at this point in the history
Closes #214.
  • Loading branch information
cdown committed Apr 12, 2024
1 parent d80842e commit e98b3f3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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))
Expand Down
6 changes: 3 additions & 3 deletions init/clipmenud.service → init/clipmenud.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Description=Clipmenu daemon

[Service]
ExecStart=/usr/bin/clipmenud
ExecStart=@bindir@/clipmenud
Restart=always
RestartSec=500ms

Expand All @@ -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]
Expand Down

0 comments on commit e98b3f3

Please sign in to comment.