From 774284cf67da0092f9a257575e3c93f1c6c35916 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Thu, 14 Dec 2023 12:38:29 +0100 Subject: [PATCH] Add install and uninstall make targets Uses pipx to install globally Closes #433 --- Makefile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Makefile b/Makefile index 7500d130..25ecb566 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,7 @@ +prefix = /usr/local +bindir = $(prefix)/bin +PIPX_HOME = /opt/pipx + .PHONY: clean publish test docs dist : @@ -46,3 +50,13 @@ bundle: --output toot-`git describe`.pyz bundle \ --compress echo "Bundle created: toot-`git describe`.pyz" + +install: + @test -w $(bindir) || { echo "No write access to $(bindir), use sudo ?" >&2; false; } + @test -w $(PIPX_HOME) || { echo "No write access to $(PIPX_HOME), use sudo ?" >&2; false; } + PIPX_HOME=$(PIPX_HOME) PIPX_BIN_DIR=$(bindir) pipx install --force . + +uninstall: + @test -w $(bindir) || { echo "No write access to $(bindir), use sudo ?" >&2; false; } + @test -w $(PIPX_HOME) || { echo "No write access to $(PIPX_HOME), use sudo ?" >&2; false; } + PIPX_HOME=$(PIPX_HOME) PIPX_BIN_DIR=$(bindir) pipx uninstall toot