]> git.proxmox.com Git - pve-client.git/blame - Makefile
copy Tools.pm from pve-common
[pve-client.git] / Makefile
CommitLineData
e4f88921
DM
1PACKAGE=pve-client
2PKGVER=0.1
3PKGREL=1
4
5DEB=${PACKAGE}_${PKGVER}-${PKGREL}_all.deb
6
7DESTDIR=
8
ca3269f4 9PERL5_DIR=${DESTDIR}/usr/share/perl5
565bbc73 10LIB_DIR=${DESTDIR}/usr/share/${PACKAGE}
e4f88921 11DOCDIR=${DESTDIR}/usr/share/doc/${PACKAGE}
dce6ecbc 12BASHCOMPLDIR=${DESTDIR}/usr/share/bash-completion/completions/
e4f88921 13
ca3269f4 14PVE_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 24PVE_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
33all: ${DEB}
34
35.PHONY: deb
36deb ${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 43install: 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
54update-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
61pve-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
69distclean: clean
70
71clean:
72 rm -rf ./build *.deb *.changes *.buildinfo
73 find . -name '*~' -exec rm {} ';'
74
75.PHONY: dinstall
76dinstall: ${DEB}
77 dpkg -i ${DEB}