]> git.proxmox.com Git - pve-apiclient.git/blob - Makefile
cb2c2435c82822dbc65f1f1058ec08391b00e468
[pve-apiclient.git] / Makefile
1 include /usr/share/dpkg/default.mk
2
3 PACKAGE=libpve-apiclient-perl
4
5 BUILDSRC := $(PACKAGE)-$(DEB_VERSION)
6 DEB=$(PACKAGE)_$(DEB_VERSION)_all.deb
7 DSC=$(PACKAGE)_$(DEB_VERSION).dsc
8
9 DESTDIR=
10 PERL5DIR=$(DESTDIR)/usr/share/perl5
11 DOCDIR=$(DESTDIR)/usr/share/doc/$(PACKAGE)
12
13 GITVERSION:=$(shell git rev-parse HEAD)
14
15 all: $(DEB)
16
17 .PHONY: $(BUILDSRC)
18 $(BUILDSRC):
19 rm -rf $(BUILDSRC)
20 rsync -a debian $(BUILDSRC)
21 make DESTDIR=./$(BUILDSRC) install
22 echo "git clone git://git.proxmox.com/git/pve-apiclient.git\\ngit checkout $(GITVERSION)" > $(BUILDSRC)/debian/SOURCE
23
24 .PHONY: deb
25 deb $(DEB): $(BUILDSRC)
26 cd $(BUILDSRC); dpkg-buildpackage -rfakeroot -b -us -uc
27 lintian $(DEB)
28
29 .PHONY: dsc
30 dsc: $(BUILDSRC)
31 cd $(BUILDSRC); dpkg-buildpackage -S -us -uc -d -nc
32 lintian $(DSC)
33
34 install: PVE/APIClient/Exception.pm PVE/APIClient/LWP.pm examples/*.pl
35 install -D -m 0644 PVE/APIClient/LWP.pm $(PERL5DIR)/PVE/APIClient/LWP.pm
36 install -m 0644 PVE/APIClient/Exception.pm $(PERL5DIR)/PVE/APIClient/Exception.pm
37 install -d -m 755 $(DOCDIR)/examples
38 install -m 0755 examples/example1.pl $(DOCDIR)/examples
39 install -m 0755 examples/example2.pl $(DOCDIR)/examples
40 install -m 0755 examples/perftest1.pl $(DOCDIR)/examples
41
42 .PHONY: upload
43 upload: $(DEB)
44 tar cf - $(DEB) | ssh -X repoman@repo.proxmox.com upload --product pmg,pve --dist bullseye
45
46 distclean: clean
47 clean:
48 rm -rf $(PACKAGE)-[0-9]*/ *.deb *.changes *.buildinfo *.build *.dsc *.tar.*
49
50 .PHONY: dinstall
51 dinstall: $(DEB)
52 dpkg -i $(DEB)