]>
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} |
e4f88921 | 11 | DOCDIR=${DESTDIR}/usr/share/doc/${PACKAGE} |
dce6ecbc | 12 | BASHCOMPLDIR=${DESTDIR}/usr/share/bash-completion/completions/ |
e4f88921 | 13 | |
ca3269f4 | 14 | PVE_COMMON_FILES= \ |
50d84256 DM |
15 | Tools.pm \ |
16 | Syscall.pm \ | |
ca3269f4 RJ |
17 | CLIHandler.pm \ |
18 | JSONSchema.pm \ | |
19 | PTY.pm \ | |
20 | RESTHandler.pm \ | |
21 | SafeSyslog.pm \ | |
22 | SectionConfig.pm \ | |
23 | ||
a086d1ce | 24 | PVE_CLIENT_SOURCES= \ |
a086d1ce DM |
25 | PVE/APIClient/Helpers.pm \ |
26 | PVE/APIClient/Config.pm \ | |
27 | PVE/APIClient/Commands/remote.pm \ | |
28 | PVE/APIClient/Commands/config.pm \ | |
29 | PVE/APIClient/Commands/lxc.pm \ | |
30 | PVE/APIClient/Commands/list.pm \ | |
31 | PVE/APIClient/Commands/GuestStatus.pm | |
32 | ||
e4f88921 DM |
33 | all: ${DEB} |
34 | ||
35 | .PHONY: deb | |
36 | deb ${DEB}: | |
37 | rm -rf build | |
38 | rsync -a debian build | |
39 | make DESTDIR=./build install | |
40 | cd build; dpkg-buildpackage -rfakeroot -b -us -uc | |
41 | lintian ${DEB} | |
42 | ||
ab79ce78 | 43 | install: pve-api-definition.dat |
ca3269f4 | 44 | install -d -m 0755 ${PERL5_DIR}/PVE/APIClient |
565bbc73 | 45 | # install library tools from pve-common |
ca3269f4 | 46 | for i in ${PVE_COMMON_FILES}; do install -m 0644 PVE/APIClient/$$i ${PERL5_DIR}/PVE/APIClient; done |
565bbc73 | 47 | # install pveclient |
a086d1ce | 48 | for i in ${PVE_CLIENT_SOURCES}; do install -D -m 0644 $$i ${PERL5_DIR}/$$i; done |
ab79ce78 | 49 | install -D -m 0644 pve-api-definition.dat ${LIB_DIR}/pve-api-definition.dat |
e4f88921 | 50 | install -D -m 0755 pveclient ${DESTDIR}/usr/bin/pveclient |
f507a398 | 51 | install -D -m 0644 pveclient.bash-completion ${BASHCOMPLDIR}/pveclient |
dce6ecbc | 52 | |
e4f88921 | 53 | |
ca3269f4 RJ |
54 | update-pve-common: |
55 | for i in ${PVE_COMMON_FILES}; do cp ../pve-common/src/PVE/$$i PVE/APIClient/; done | |
56 | for i in ${PVE_COMMON_FILES}; do sed -i 's/PVE::/PVE::APIClient::/g' PVE/APIClient/$$i; done | |
57 | # Remove INotify from CLIHandler.pm | |
58 | sed -i 's/use PVE::APIClient::INotify;//' PVE/APIClient/CLIHandler.pm | |
59 | ||
60 | ||
ab79ce78 DM |
61 | pve-api-definition.dat: |
62 | ./extractapi.pl > pve-api-definition.dat.tmp | |
63 | mv pve-api-definition.dat.tmp pve-api-definition.dat | |
e4f88921 | 64 | |
81ddc6f6 DM |
65 | #.PHONY: upload |
66 | #upload: ${DEB} | |
67 | # tar cf - ${DEB} | ssh -X repoman@repo.proxmox.com upload --product pmg,pve --dist stretch | |
e4f88921 DM |
68 | |
69 | distclean: clean | |
70 | ||
71 | clean: | |
72 | rm -rf ./build *.deb *.changes *.buildinfo | |
73 | find . -name '*~' -exec rm {} ';' | |
74 | ||
75 | .PHONY: dinstall | |
76 | dinstall: ${DEB} | |
77 | dpkg -i ${DEB} |