pve-manager/bin/Makefile
Christian Ebner 3fa3cc5640 Fix 1891 Generate zsh tab completion scripts for cli tools
This patch builds the  zsh tab completion scripts for the cli tools of
pve-manager.
In order for it to work, the latest version of pve-common and pve-docs
including the corresponding patches have to be installed on the build
system.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2019-02-20 12:12:07 +01:00

83 lines
2.4 KiB
Makefile

include ../defines.mk
# this requires package pve-doc-generator
export NOVIEW=1
PERL_DOC_INC_DIRS=..
include /usr/share/pve-doc-generator/pve-doc-generator.mk
SERVICES = pvestatd pveproxy pvedaemon spiceproxy
CLITOOLS = vzdump pvesubscription pveceph pveam pvesr pvenode pvesh
SCRIPTS = \
${SERVICES} \
${CLITOOLS} \
pvebanner \
pveversion \
pvemailforward.pl \
pveupgrade \
pveupdate \
pveperf \
pvereport
SERVICE_MANS = $(addsuffix .8, ${SERVICES})
CLI_MANS = \
$(addsuffix .1, ${CLITOOLS}) \
pveversion.1 \
pveupgrade.1 \
pveperf.1 \
pvereport.1 \
BASH_COMPLETIONS = \
$(addsuffix .service-bash-completion, ${SERVICES}) \
$(addsuffix .bash-completion, ${CLITOOLS}) \
ZSH_COMPLETIONS = \
$(addsuffix .service-zsh-completion, ${SERVICES}) \
$(addsuffix .zsh-completion, ${CLITOOLS}) \
all: ${SERVICE_MANS} ${CLI_MANS} pvemailforward
%.1: %.1.pod
rm -f $@
cat $<|pod2man -n $* -s 1 -r ${VERSION} -c "Proxmox Documentation" >$@.tmp
mv $@.tmp $@
%.1.pod:
podselect $* > $@.tmp
mv $@.tmp $@
pveversion.1.pod: pveversion
pveupgrade.1.pod: pveupgrade
pvereport.1.pod: pvereport
pvemailforward: pvemailforward.c
$(CC) $(CPPFLAGS) $(CFLAGS) -Wall -g -O2 $< -o $@
.PHONY: check
check: $(addsuffix .service-api-verified, ${SERVICES}) $(addsuffix .api-verified, ${CLITOOLS})
rm -f *.service-api-verified *.api-verified
.PHONY: install
install: ${SCRIPTS} ${CLI_MANS} ${SERVICE_MANS} pvemailforward ${BASH_COMPLETIONS} ${ZSH_COMPLETIONS}
install -d ${BINDIR}
install -m 0755 ${SCRIPTS} ${BINDIR}
install -s -m 2755 -g www-data pvemailforward ${BINDIR}
install -d ${MAN1DIR}
install -m 0644 ${CLI_MANS} ${MAN1DIR}
install -d ${MAN8DIR}
install -m 0644 ${SERVICE_MANS} ${MAN8DIR}
for i in ${CLITOOLS}; do install -m 0644 -D $$i.bash-completion ${BASHCOMPLDIR}/$$i; done
for i in ${SERVICES}; do install -m 0644 -D $$i.service-bash-completion ${BASHCOMPLDIR}/$$i; done
for i in ${CLITOOLS}; do install -m 0644 -D $$i.zsh-completion ${ZSHCOMPLDIR}/_$$i; done
for i in ${SERVICES}; do install -m 0644 -D $$i.service-zsh-completion ${ZSHCOMPLDIR}/_$$i; done
.PHONY: clean
clean:
make cleanup-docgen
rm -rf *~ *.tmp ${CLI_MANS} ${SERVICE_MANS} *.1.pod *.8.pod pvemailforward \
*.bash-completion *.service-bash-completion \
*.zsh-completion *.service-zsh-completion \
*.api-verified *.service-api-verified