]> git.proxmox.com Git - pve-apiclient.git/blob - Makefile
d/control: define compat level via build-depends and raise to 13
[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 GITVERSION:=$(shell git rev-parse HEAD)
15
16 all: $(DEB)
17
18 .PHONY: $(BUILDSRC)
19 $(BUILDSRC):
20 rm -rf $(BUILDSRC)
21 rsync -a debian $(BUILDSRC)
22 make DESTDIR=./$(BUILDSRC) install
23 echo "git clone git://git.proxmox.com/git/pve-apiclient.git\\ngit checkout $(GITVERSION)" > $(BUILDSRC)/debian/SOURCE
24
25 .PHONY: deb
26 deb $(DEB): $(BUILDSRC)
27 cd $(BUILDSRC); dpkg-buildpackage -rfakeroot -b -us -uc
28 lintian $(DEB)
29
30 .PHONY: dsc
31 dsc: $(BUILDSRC)
32 cd $(BUILDSRC); dpkg-buildpackage -S -us -uc -d -nc
33 lintian $(DSC)
34
35 install:
36 install -D -m 0644 PVE/APIClient/LWP.pm $(PERL5DIR)/PVE/APIClient/LWP.pm
37 install -m 0644 PVE/APIClient/Exception.pm $(PERL5DIR)/PVE/APIClient/Exception.pm
38 install -d -m 755 $(DOCDIR)/examples
39 install -m 0755 examples/example1.pl $(DOCDIR)/examples
40 install -m 0755 examples/example2.pl $(DOCDIR)/examples
41 install -m 0755 examples/perftest1.pl $(DOCDIR)/examples
42
43 .PHONY: upload
44 upload: $(DEB)
45 tar cf - $(DEB) | ssh -X repoman@repo.proxmox.com upload --product pmg,pve --dist bullseye
46
47 distclean: clean
48
49 clean:
50 rm -rf ./$(BUILDSRC) *.deb *.changes *.buildinfo *.dsc *.tar.gz
51
52 .PHONY: dinstall
53 dinstall: $(DEB)
54 dpkg -i $(DEB)