]> git.proxmox.com Git - pve-apiclient.git/blob - Makefile
ec67f2d5239e5370cba490209a070118eaa1ae9b
[pve-apiclient.git] / Makefile
1 PACKAGE=libpve-apiclient-perl
2 PKGVER=2.0
3 PKGREL=4
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 PVE_COMMON_FILES= \
13 Exception.pm
14
15 all: ${DEB}
16
17 .PHONY: deb
18 deb ${DEB}:
19 rm -rf build
20 rsync -a debian build
21 make DESTDIR=./build install
22 cd build; dpkg-buildpackage -rfakeroot -b -us -uc
23 lintian ${DEB}
24
25 install:
26 install -D -m 0644 PVE/APIClient/LWP.pm ${PERL5DIR}/PVE/APIClient/LWP.pm
27 install -m 0644 PVE/APIClient/Exception.pm ${PERL5DIR}/PVE/APIClient/Exception.pm
28 install -d -m 755 ${DOCDIR}/examples
29 install -m 0755 examples/example1.pl ${DOCDIR}/examples
30 install -m 0755 examples/example2.pl ${DOCDIR}/examples
31 install -m 0755 examples/perftest1.pl ${DOCDIR}/examples
32
33 update-pve-common:
34 for i in ${PVE_COMMON_FILES}; do cp ../pve-common/src/PVE/$$i PVE/APIClient/; done
35 for i in ${PVE_COMMON_FILES}; do sed -i 's/PVE::/PVE::APIClient::/g' PVE/APIClient/$$i; done
36
37 .PHONY: upload
38 upload: ${DEB}
39 tar cf - ${DEB} | ssh -X repoman@repo.proxmox.com upload --product pmg,pve --dist stretch
40
41 distclean: clean
42
43 clean:
44 rm -rf ./build *.deb *.changes *.buildinfo
45 find . -name '*~' -exec rm {} ';'
46
47 .PHONY: dinstall
48 dinstall: ${DEB}
49 dpkg -i ${DEB}