fccb5f1c3b40fb7f778f2e91032d889bfc9e2d49
[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 PERL5DIR=${DESTDIR}/usr/share/perl5
10 DOCDIR=${DESTDIR}/usr/share/doc/${PACKAGE}
11
12 all: ${DEB}
13
14 .PHONY: deb
15 deb ${DEB}:
16 rm -rf build
17 rsync -a debian build
18 make DESTDIR=./build install
19 cd build; dpkg-buildpackage -rfakeroot -b -us -uc
20 lintian ${DEB}
21
22 install: pve-api-definition.js
23 install -D -m 0644 PVE/APIClient/Helpers.pm ${PERL5DIR}/PVE/APIClient/Helpers.pm
24 install -D -m 0644 pve-api-definition.js ${DESTDIR}/usr/share/${PACKAGE}/pve-api-definition.js
25 install -D -m 0755 pveclient ${DESTDIR}/usr/bin/pveclient
26
27 pve-api-definition.js:
28 ./extractapi.pl > pve-api-definition.js.tmp
29 mv pve-api-definition.js.tmp pve-api-definition.js
30
31 #.PHONY: upload
32 #upload: ${DEB}
33 # tar cf - ${DEB} | ssh -X repoman@repo.proxmox.com upload --product pmg,pve --dist stretch
34
35 distclean: clean
36
37 clean:
38 rm -rf ./build *.deb *.changes *.buildinfo
39 find . -name '*~' -exec rm {} ';'
40
41 .PHONY: dinstall
42 dinstall: ${DEB}
43 dpkg -i ${DEB}