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