aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2021-10-25 10:24:43 -0700
committerFranck Cuny <franck@fcuny.net>2021-10-25 10:24:43 -0700
commit82577799559edae983f59695b4a9af921b2e2c9c (patch)
tree4b46294326ea153de4536642a41f45fb98d6bf27
parentscrobbler: add a systemd unit file (diff)
downloadx-82577799559edae983f59695b4a9af921b2e2c9c.tar.gz
build: install the binary and systemd unit
Add a Makefile to install the binary in GOPATH and the unit file for the service. When the binary is installed, systemd is reloaded and the service is also started.
Diffstat (limited to '')
-rw-r--r--Makefile12
1 files changed, 12 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..0edb9dd
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,12 @@
+GO_INSTALL_ARGS := -trimpath
+
+.PHONY: install
+
+install:
+ @go install $(GO_INSTALL_ARGS) ./cmd/mpd-scrobbler
+ @install -m 0644 systemd/mpd-scrobbler.service $(HOME)/.config/systemd/user/
+ @echo "reloading systemd"
+ @systemctl --user daemon-reload
+ @echo "starting the unit"
+ @systemctl --user restart mpd-scrobbler
+ @systemctl --user status mpd-scrobbler