]> git.proxmox.com Git - pve-client.git/commitdiff
add Makefile
authorDietmar Maurer <dietmar@proxmox.com>
Tue, 22 May 2018 12:14:56 +0000 (14:14 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 22 May 2018 12:14:56 +0000 (14:14 +0200)
Makefile [new file with mode: 0644]

diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..f32776e
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,43 @@
+PACKAGE=pve-client
+PKGVER=0.1
+PKGREL=1
+
+DEB=${PACKAGE}_${PKGVER}-${PKGREL}_all.deb
+
+DESTDIR=
+
+PERL5DIR=${DESTDIR}/usr/share/perl5
+DOCDIR=${DESTDIR}/usr/share/doc/${PACKAGE}
+
+all: ${DEB}
+
+.PHONY: deb
+deb ${DEB}:
+       rm -rf build
+       rsync -a debian build
+       make DESTDIR=./build install
+       cd build; dpkg-buildpackage -rfakeroot -b -us -uc
+       lintian ${DEB}
+
+install:  pve-api-definition.js
+       install -D -m 0644 PVE/APIClient/Helpers.pm ${PERL5DIR}/PVE/APIClient/Helpers.pm
+       install -D -m 0644 pve-api-definition.js ${DESTDIR}/usr/share/${PACKAGE}/pve-api-definition.js
+       install -D -m 0755 pveclient ${DESTDIR}/usr/bin/pveclient
+
+pve-api-definition.js:
+       ./extractapi.pl > pve-api-definition.js.tmp
+       mv pve-api-definition.js.tmp pve-api-definition.js
+
+.PHONY: upload
+upload: ${DEB}
+       tar cf - ${DEB} | ssh -X repoman@repo.proxmox.com upload --product pmg,pve --dist stretch
+
+distclean: clean
+
+clean:
+       rm -rf ./build *.deb *.changes *.buildinfo
+       find . -name '*~' -exec rm {} ';'
+
+.PHONY: dinstall
+dinstall: ${DEB}
+       dpkg -i ${DEB}