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