From 303ec60d7aedec70fcff2a4f4965bcc90c2aa365 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 9 Oct 2013 10:33:26 +0200 Subject: add install and unstall MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- Makefile | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e6fb4c3..61a5811 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,45 @@ +PREFIX = /usr +BIN = /bin +DATA = /share +LICENSES = $(DATA)/licenses +COMMAND = bfind +PKGNAME = bfind + PY3_SHEBANG = /usr/bin/env/ python3 .PHONY: all -all: bfind +all: cmd + +.PHONY: cmd +cmd: bfind bfind: src/bfind.py cp "$<" "$@" sed -i 's:/usr/bin/env/ python3:$(PY3_SHEBANG):' "$@" +.PHONY: install +install: install-cmd install-license + +.PHONY: install-cmd +install-cmd: bfind + install -d -- "$(DESTDIR)$(PREFIX)$(BIN)" + install -m755 -- bfind "$(DESTDIR)$(PREFIX)$(BIN)/$(COMMAND)" + +.PHONY: install-license +install-license: + install -d -- "$(DESTDIR)$(PREFIX)$(LICENSES)/$(PKGNAME)" + install -m644 -- COPYING LICENSE "$(DESTDIR)$(PREFIX)$(LICENSES)/$(PKGNAME)" + +.PHONY: uninstall +uninstall: + -rm -- "$(DESTDIR)$(PREFIX)$(BIN)/$(COMMAND)" + -rm -- "$(DESTDIR)$(PREFIX)$(LICENSES)/$(PKGNAME)/COPYING" + -rm -- "$(DESTDIR)$(PREFIX)$(LICENSES)/$(PKGNAME)/LICENSE" + -rm -d -- "$(DESTDIR)$(PREFIX)$(LICENSES)/$(PKGNAME)" + + .PHONY: clean clean: -rm -- bfind -- cgit v1.2.3-70-g09d2