install missing files
[pve-client.git] / Makefile
1 PACKAGE=pve-client
2 PKGVER=0.1
3 PKGREL=1
4
5 DEB=${PACKAGE}_${PKGVER}-${PKGREL}_all.deb
6
7 DESTDIR=
8
9 LIB_DIR=${DESTDIR}/usr/share/${PACKAGE}
10 DOCDIR=${DESTDIR}/usr/share/doc/${PACKAGE}
11 BASHCOMPLDIR=${DESTDIR}/usr/share/bash-completion/completions/
12
13 all: ${DEB}
14
15 .PHONY: deb
16 deb ${DEB}:
17         rm -rf build
18         rsync -a debian build
19         make DESTDIR=./build install
20         cd build; dpkg-buildpackage -rfakeroot -b -us -uc
21         lintian ${DEB}
22
23 install:  pve-api-definition.dat
24         install -d -m 0755 ${LIB_DIR}/PVE
25         # install library tools from pve-common
26         install -m 0644 PVE/Tools.pm ${LIB_DIR}/PVE
27         install -m 0644 PVE/SafeSyslog.pm ${LIB_DIR}/PVE
28         install -m 0644 PVE/Exception.pm ${LIB_DIR}/PVE
29         install -m 0644 PVE/JSONSchema.pm ${LIB_DIR}/PVE
30         install -m 0644 PVE/RESTHandler.pm  ${LIB_DIR}/PVE
31         install -m 0644 PVE/CLIHandler.pm ${LIB_DIR}/PVE
32         install -m 0644 PVE/PTY.pm ${LIB_DIR}/PVE
33         install -m 0644 PVE/SectionConfig.pm ${LIB_DIR}/PVE
34         # install pveclient
35         install -D -m 0644 PVE/APIClient/Helpers.pm ${LIB_DIR}/PVE/APIClient/Helpers.pm
36         install -D -m 0644 PVE/APIClient/Config.pm ${LIB_DIR}/PVE/APIClient/Config.pm
37         install -D -m 0644 PVE/APIClient/Commands/remote.pm ${LIB_DIR}/PVE/APIClient/Commands/remote.pm
38         install -D -m 0644 PVE/APIClient/Commands/lxc.pm ${LIB_DIR}/PVE/APIClient/Commands/lxc.pm
39         install -D -m 0644 PVE/APIClient/Commands/config.pm ${LIB_DIR}/PVE/APIClient/Commands/config.pm
40         install -D -m 0644 PVE/APIClient/Commands/list.pm ${LIB_DIR}/PVE/APIClient/Commands/list.pm
41         install -D -m 0644 PVE/APIClient/Commands/GuestStatus.pm ${LIB_DIR}/PVE/APIClient/Commands/GuestStatus.pm
42         install -D -m 0644 pve-api-definition.dat ${LIB_DIR}/pve-api-definition.dat
43         install -D -m 0755 pveclient ${DESTDIR}/usr/bin/pveclient
44         install -D -m 0644 pveclient.bash-completion ${BASHCOMPLDIR}/pveclient
45
46
47 pve-api-definition.dat:
48         ./extractapi.pl > pve-api-definition.dat.tmp
49         mv pve-api-definition.dat.tmp pve-api-definition.dat
50
51 #.PHONY: upload
52 #upload: ${DEB}
53 #       tar cf - ${DEB} | ssh -X repoman@repo.proxmox.com upload --product pmg,pve --dist stretch
54
55 distclean: clean
56
57 clean:
58         rm -rf ./build *.deb *.changes *.buildinfo
59         find . -name '*~' -exec rm {} ';'
60
61 .PHONY: dinstall
62 dinstall: ${DEB}
63         dpkg -i ${DEB}