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