X-Git-Url: https://git.proxmox.com/?p=pve-client.git;a=blobdiff_plain;f=Makefile;h=e7177df3827d1a6673428f642feafd1f10ae85f0;hp=f32776ea88254bd1c651fcd36267df3bf8e46eaf;hb=5101e472b1588759d791f999bad0f4b8a284d736;hpb=e4f8892159e903fda57fa92e3daabe04f7749f0c diff --git a/Makefile b/Makefile index f32776e..e7177df 100644 --- a/Makefile +++ b/Makefile @@ -6,8 +6,31 @@ DEB=${PACKAGE}_${PKGVER}-${PKGREL}_all.deb DESTDIR= -PERL5DIR=${DESTDIR}/usr/share/perl5 +PERL5_DIR=${DESTDIR}/usr/share/perl5 +LIB_DIR=${DESTDIR}/usr/share/${PACKAGE} +MAN1DIR=${DESTDIR}//usr/share/man/man1 DOCDIR=${DESTDIR}/usr/share/doc/${PACKAGE} +BASHCOMPLDIR=${DESTDIR}/usr/share/bash-completion/completions/ + +PVE_COMMON_FILES= \ + Tools.pm \ + Syscall.pm \ + CLIFormatter.pm \ + CLIHandler.pm \ + JSONSchema.pm \ + PTY.pm \ + RESTHandler.pm \ + SafeSyslog.pm \ + SectionConfig.pm \ + +PVE_CLIENT_SOURCES= \ + PVE/APIClient/Helpers.pm \ + PVE/APIClient/Config.pm \ + PVE/APIClient/Commands/remote.pm \ + PVE/APIClient/Commands/config.pm \ + PVE/APIClient/Commands/lxc.pm \ + PVE/APIClient/Commands/list.pm \ + PVE/APIClient/Commands/GuestStatus.pm all: ${DEB} @@ -19,23 +42,46 @@ deb ${DEB}: cd build; dpkg-buildpackage -rfakeroot -b -us -uc lintian ${DEB} -install: pve-api-definition.js - install -D -m 0644 PVE/APIClient/Helpers.pm ${PERL5DIR}/PVE/APIClient/Helpers.pm - install -D -m 0644 pve-api-definition.js ${DESTDIR}/usr/share/${PACKAGE}/pve-api-definition.js +pveclient.1-synopsis.adoc: pveclient ${PVE_CLIENT_SOURCES} + perl -I. ./pveclient printsynopsis > $@.tmp + mv $@.tmp $@ + +pveclient.1: pveclient.1-synopsis.adoc + a2x -f manpage pveclient.adoc + +install: pve-api-definition.dat pveclient.1 + install -d -m 0755 ${PERL5_DIR}/PVE/APIClient + # install library tools from pve-common + for i in ${PVE_COMMON_FILES}; do install -m 0644 PVE/APIClient/$$i ${PERL5_DIR}/PVE/APIClient; done + # install pveclient + for i in ${PVE_CLIENT_SOURCES}; do install -D -m 0644 $$i ${PERL5_DIR}/$$i; done + install -D -m 0644 pve-api-definition.dat ${LIB_DIR}/pve-api-definition.dat install -D -m 0755 pveclient ${DESTDIR}/usr/bin/pveclient + install -D -m 0644 pveclient.bash-completion ${BASHCOMPLDIR}/pveclient + # install manual page + install -D -m 0644 pveclient.1 ${MAN1DIR}/pveclient.1 + gzip -9 ${MAN1DIR}/pveclient.1 + +update-pve-common: + for i in ${PVE_COMMON_FILES}; do cp ../pve-common/src/PVE/$$i PVE/APIClient/; done + for i in ${PVE_COMMON_FILES}; do sed -i 's/PVE::/PVE::APIClient::/g' PVE/APIClient/$$i; done + # Remove INotify from CLIHandler.pm + sed -i 's/use PVE::APIClient::INotify;//' PVE/APIClient/CLIHandler.pm + -pve-api-definition.js: - ./extractapi.pl > pve-api-definition.js.tmp - mv pve-api-definition.js.tmp pve-api-definition.js +pve-api-definition.dat: + ./extractapi.pl > pve-api-definition.dat.tmp + mv pve-api-definition.dat.tmp pve-api-definition.dat -.PHONY: upload -upload: ${DEB} - tar cf - ${DEB} | ssh -X repoman@repo.proxmox.com upload --product pmg,pve --dist stretch +#.PHONY: upload +#upload: ${DEB} +# tar cf - ${DEB} | ssh -X repoman@repo.proxmox.com upload --product pmg,pve --dist stretch distclean: clean clean: rm -rf ./build *.deb *.changes *.buildinfo + rm pveclient.1-synopsis.adoc pveclient.1 find . -name '*~' -exec rm {} ';' .PHONY: dinstall