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