]> git.proxmox.com Git - pve-apiclient.git/blob - Makefile
bump version to 3.0-1
[pve-apiclient.git] / Makefile
1 PACKAGE=libpve-apiclient-perl
2 PKGVER=$(shell dpkg-parsechangelog -Sversion | cut -d- -f1)
3 PKGREL=$(shell dpkg-parsechangelog -Sversion | cut -d- -f2)
4
5 BUILDSRC := $(PACKAGE)-$(PKGVER)
6 DEB=${PACKAGE}_${PKGVER}-${PKGREL}_all.deb
7 DSC=${PACKAGE}_${PKGVER}-${PKGREL}.dsc
8
9 DESTDIR=
10
11 PERL5DIR=${DESTDIR}/usr/share/perl5
12 DOCDIR=${DESTDIR}/usr/share/doc/${PACKAGE}
13
14 PVE_COMMON_FILES= \
15 Exception.pm
16
17 GITVERSION:=$(shell git rev-parse HEAD)
18
19 all: ${DEB}
20
21 .PHONY: $(BUILDSRC)
22 $(BUILDSRC):
23 rm -rf $(BUILDSRC)
24 rsync -a debian $(BUILDSRC)
25 make DESTDIR=./$(BUILDSRC) install
26 echo "git clone git://git.proxmox.com/git/pve-apiclient.git\\ngit checkout ${GITVERSION}" > $(BUILDSRC)/debian/SOURCE
27
28 .PHONY: deb
29 deb ${DEB}: $(BUILDSRC)
30 cd $(BUILDSRC); dpkg-buildpackage -rfakeroot -b -us -uc
31 lintian ${DEB}
32
33 .PHONY: dsc
34 dsc: $(BUILDSRC)
35 cd $(BUILDSRC); dpkg-buildpackage -S -us -uc -d -nc
36 lintian ${DSC}
37
38 install:
39 install -D -m 0644 PVE/APIClient/LWP.pm ${PERL5DIR}/PVE/APIClient/LWP.pm
40 install -m 0644 PVE/APIClient/Exception.pm ${PERL5DIR}/PVE/APIClient/Exception.pm
41 install -d -m 755 ${DOCDIR}/examples
42 install -m 0755 examples/example1.pl ${DOCDIR}/examples
43 install -m 0755 examples/example2.pl ${DOCDIR}/examples
44 install -m 0755 examples/perftest1.pl ${DOCDIR}/examples
45
46 update-pve-common:
47 for i in ${PVE_COMMON_FILES}; do cp ../pve-common/src/PVE/$$i PVE/APIClient/; done
48 for i in ${PVE_COMMON_FILES}; do sed -i 's/PVE::/PVE::APIClient::/g' PVE/APIClient/$$i; done
49
50 .PHONY: upload
51 upload: ${DEB}
52 tar cf - ${DEB} | ssh -X repoman@repo.proxmox.com upload --product pmg,pve --dist stretch
53
54 distclean: clean
55
56 clean:
57 rm -rf ./$(BUILDSRC) *.deb *.changes *.buildinfo *.dsc *.tar.gz
58 find . -name '*~' -exec rm {} ';'
59
60 .PHONY: dinstall
61 dinstall: ${DEB}
62 dpkg -i ${DEB}