]>
Commit | Line | Data |
---|---|---|
e4f88921 DM |
1 | PACKAGE=pve-client |
2 | PKGVER=0.1 | |
3 | PKGREL=1 | |
4 | ||
5 | DEB=${PACKAGE}_${PKGVER}-${PKGREL}_all.deb | |
6 | ||
7 | DESTDIR= | |
8 | ||
ca3269f4 | 9 | PERL5_DIR=${DESTDIR}/usr/share/perl5 |
565bbc73 | 10 | LIB_DIR=${DESTDIR}/usr/share/${PACKAGE} |
2767c2b9 | 11 | MAN1DIR=${DESTDIR}//usr/share/man/man1 |
e4f88921 | 12 | DOCDIR=${DESTDIR}/usr/share/doc/${PACKAGE} |
dce6ecbc | 13 | BASHCOMPLDIR=${DESTDIR}/usr/share/bash-completion/completions/ |
e4f88921 | 14 | |
ca3269f4 | 15 | PVE_COMMON_FILES= \ |
50d84256 DM |
16 | Tools.pm \ |
17 | Syscall.pm \ | |
c2bcfdb2 | 18 | CLIFormatter.pm \ |
ca3269f4 RJ |
19 | CLIHandler.pm \ |
20 | JSONSchema.pm \ | |
21 | PTY.pm \ | |
22 | RESTHandler.pm \ | |
23 | SafeSyslog.pm \ | |
24 | SectionConfig.pm \ | |
25 | ||
a086d1ce | 26 | PVE_CLIENT_SOURCES= \ |
a086d1ce DM |
27 | PVE/APIClient/Helpers.pm \ |
28 | PVE/APIClient/Config.pm \ | |
29 | PVE/APIClient/Commands/remote.pm \ | |
30 | PVE/APIClient/Commands/config.pm \ | |
31 | PVE/APIClient/Commands/lxc.pm \ | |
32 | PVE/APIClient/Commands/list.pm \ | |
33 | PVE/APIClient/Commands/GuestStatus.pm | |
34 | ||
e4f88921 DM |
35 | all: ${DEB} |
36 | ||
37 | .PHONY: deb | |
38 | deb ${DEB}: | |
39 | rm -rf build | |
40 | rsync -a debian build | |
41 | make DESTDIR=./build install | |
42 | cd build; dpkg-buildpackage -rfakeroot -b -us -uc | |
43 | lintian ${DEB} | |
44 | ||
2767c2b9 DM |
45 | pveclient.1-synopsis.adoc: pveclient ${PVE_CLIENT_SOURCES} |
46 | perl -I. ./pveclient printsynopsis > $@.tmp | |
47 | mv $@.tmp $@ | |
48 | ||
49 | pveclient.1: pveclient.1-synopsis.adoc | |
50 | a2x -f manpage pveclient.adoc | |
51 | ||
52 | install: pve-api-definition.dat pveclient.1 | |
ca3269f4 | 53 | install -d -m 0755 ${PERL5_DIR}/PVE/APIClient |
565bbc73 | 54 | # install library tools from pve-common |
ca3269f4 | 55 | for i in ${PVE_COMMON_FILES}; do install -m 0644 PVE/APIClient/$$i ${PERL5_DIR}/PVE/APIClient; done |
565bbc73 | 56 | # install pveclient |
a086d1ce | 57 | for i in ${PVE_CLIENT_SOURCES}; do install -D -m 0644 $$i ${PERL5_DIR}/$$i; done |
ab79ce78 | 58 | install -D -m 0644 pve-api-definition.dat ${LIB_DIR}/pve-api-definition.dat |
e4f88921 | 59 | install -D -m 0755 pveclient ${DESTDIR}/usr/bin/pveclient |
f507a398 | 60 | install -D -m 0644 pveclient.bash-completion ${BASHCOMPLDIR}/pveclient |
2767c2b9 DM |
61 | # install manual page |
62 | install -D -m 0644 pveclient.1 ${MAN1DIR}/pveclient.1 | |
63 | gzip -9 ${MAN1DIR}/pveclient.1 | |
e4f88921 | 64 | |
ca3269f4 RJ |
65 | update-pve-common: |
66 | for i in ${PVE_COMMON_FILES}; do cp ../pve-common/src/PVE/$$i PVE/APIClient/; done | |
67 | for i in ${PVE_COMMON_FILES}; do sed -i 's/PVE::/PVE::APIClient::/g' PVE/APIClient/$$i; done | |
68 | # Remove INotify from CLIHandler.pm | |
69 | sed -i 's/use PVE::APIClient::INotify;//' PVE/APIClient/CLIHandler.pm | |
70 | ||
71 | ||
ab79ce78 DM |
72 | pve-api-definition.dat: |
73 | ./extractapi.pl > pve-api-definition.dat.tmp | |
74 | mv pve-api-definition.dat.tmp pve-api-definition.dat | |
e4f88921 | 75 | |
81ddc6f6 DM |
76 | #.PHONY: upload |
77 | #upload: ${DEB} | |
78 | # tar cf - ${DEB} | ssh -X repoman@repo.proxmox.com upload --product pmg,pve --dist stretch | |
e4f88921 DM |
79 | |
80 | distclean: clean | |
81 | ||
82 | clean: | |
83 | rm -rf ./build *.deb *.changes *.buildinfo | |
b76ab655 | 84 | rm -f pveclient.1-synopsis.adoc pveclient.1 |
e4f88921 DM |
85 | find . -name '*~' -exec rm {} ';' |
86 | ||
87 | .PHONY: dinstall | |
88 | dinstall: ${DEB} | |
89 | dpkg -i ${DEB} |