(un)install options for auto-completion files.

This commit is contained in:
Arun Prakash Jana 2016-05-24 18:28:33 +05:30
parent 4d5054e70f
commit 7a2d1bfde3
No known key found for this signature in database
GPG Key ID: C0A712ED95043DCB
2 changed files with 37 additions and 15 deletions

View File

@ -1,22 +1,35 @@
PREFIX ?= /usr/local
BINDIR?= $(PREFIX)/bin
MANDIR?= $(PREFIX)/share/man/man1
DOCDIR?= $(PREFIX)/share/doc/buku
BINDIR ?= $(DESTDIR)$(PREFIX)/bin
MANDIR ?= $(DESTDIR)$(PREFIX)/share/man/man1
DOCDIR ?= $(DESTDIR)$(PREFIX)/share/doc/buku
BASHCOMPDIR = $(DESTDIR)$(PREFIX)/etc/bash_completion.d
FISHCOMPDIR = $(DESTDIR)$(PREFIX)/share/fish/vendor_completions.d
ZSHCOMPDIR = $(DESTDIR)$(PREFIX)/share/zsh/site-functions
.PHONY: all install install.comp uninstall uninstall.comp
.PHONY: install uninstall
all:
install:
install -m755 -d $(DESTDIR)$(BINDIR)
install -m755 -d $(DESTDIR)$(MANDIR)
install -m755 -d $(DESTDIR)$(DOCDIR)
install -m755 -d $(BINDIR)
install -m755 -d $(MANDIR)
install -m755 -d $(DOCDIR)
gzip -c buku.1 > buku.1.gz
install -m755 buku $(DESTDIR)$(BINDIR)
install -m644 buku.1.gz $(DESTDIR)$(MANDIR)
install -m644 README.md $(DESTDIR)$(DOCDIR)
install -m755 buku $(BINDIR)
install -m644 buku.1.gz $(MANDIR)
install -m644 README.md $(DOCDIR)
rm -f buku.1.gz
install.comp:
install -m755 -d $(BASHCOMPDIR) $(FISHCOMPDIR) $(ZSHCOMPDIR)
install -m644 auto-completion/bash/buku-completion.bash $(BASHCOMPDIR)
install -m644 auto-completion/fish/buku.fish $(FISHCOMPDIR)
install -m644 auto-completion/zsh/_buku $(ZSHCOMPDIR)
uninstall:
rm -f $(DESTDIR)$(BINDIR)/buku
rm -f $(DESTDIR)$(MANDIR)/buku.1.gz
rm -rf $(DESTDIR)$(DOCDIR)
rm -f $(BINDIR)/buku
rm -f $(MANDIR)/buku.1.gz
rm -rf $(DOCDIR)
uninstall.comp:
rm -f $(BASHCOMPDIR)/buku-completion.bash $(FISHCOMPDIR)/buku.fish $(ZSHCOMPDIR)/_buku

View File

@ -89,7 +89,16 @@ To remove, run:
## Shell completion
Shell completion scripts for Bash, Fish and Zsh can be found in respective subdirectories of [auto-completion/](https://github.com/jarun/buku/blob/master/auto-completion). Please refer to your shell's manual for installation instructions.
Shell completion scripts for Bash, Fish and Zsh can be found in respective subdirectories of [auto-completion/](https://github.com/jarun/buku/blob/master/auto-completion).
Install shell completion scripts:
$ sudo make install.comp
Remove shell completion scripts:
$ sudo make uninstall.comp
`PREFIX` is supported.
## Installing with a package manager