From 693f594719903c688d2013aa3adaeb8e30a59f50 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Mon, 25 Oct 2021 10:24:43 -0700 Subject: 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. --- tools/mpd-stats/Makefile | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tools/mpd-stats/Makefile (limited to 'tools/mpd-stats/Makefile') diff --git a/tools/mpd-stats/Makefile b/tools/mpd-stats/Makefile new file mode 100644 index 0000000..0edb9dd --- /dev/null +++ b/tools/mpd-stats/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 -- cgit 1.4.1