]> git.proxmox.com Git - pve-apiclient.git/blame - Makefile
buildsys: encode prerequisites of install target
[pve-apiclient.git] / Makefile
CommitLineData
7147fbfe
TL
1include /usr/share/dpkg/default.mk
2
5a3b38c1 3PACKAGE=libpve-apiclient-perl
5a3b38c1 4
7147fbfe
TL
5BUILDSRC := $(PACKAGE)-$(DEB_VERSION)
6DEB=$(PACKAGE)_$(DEB_VERSION)_all.deb
7DSC=$(PACKAGE)_$(DEB_VERSION).dsc
5a3b38c1
DM
8
9DESTDIR=
727d396e
TL
10PERL5DIR=$(DESTDIR)/usr/share/perl5
11DOCDIR=$(DESTDIR)/usr/share/doc/$(PACKAGE)
5a3b38c1 12
2689bc84 13GITVERSION:=$(shell git rev-parse HEAD)
2d805336 14
727d396e 15all: $(DEB)
5a3b38c1 16
2d805336
RV
17.PHONY: $(BUILDSRC)
18$(BUILDSRC):
19 rm -rf $(BUILDSRC)
20 rsync -a debian $(BUILDSRC)
21 make DESTDIR=./$(BUILDSRC) install
727d396e 22 echo "git clone git://git.proxmox.com/git/pve-apiclient.git\\ngit checkout $(GITVERSION)" > $(BUILDSRC)/debian/SOURCE
2d805336 23
5a3b38c1 24.PHONY: deb
727d396e 25deb $(DEB): $(BUILDSRC)
2d805336 26 cd $(BUILDSRC); dpkg-buildpackage -rfakeroot -b -us -uc
727d396e 27 lintian $(DEB)
5a3b38c1 28
2d805336
RV
29.PHONY: dsc
30dsc: $(BUILDSRC)
31 cd $(BUILDSRC); dpkg-buildpackage -S -us -uc -d -nc
727d396e 32 lintian $(DSC)
2d805336 33
f7d3e2f5 34install: PVE/APIClient/Exception.pm PVE/APIClient/LWP.pm examples/*.pl
727d396e
TL
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
5a3b38c1
DM
41
42.PHONY: upload
727d396e
TL
43upload: $(DEB)
44 tar cf - $(DEB) | ssh -X repoman@repo.proxmox.com upload --product pmg,pve --dist bullseye
5a3b38c1
DM
45
46distclean: clean
5a3b38c1 47clean:
f5310c07 48 rm -rf $(PACKAGE)-[0-9]*/ *.deb *.changes *.buildinfo *.build *.dsc *.tar.*
2834772d
DM
49
50.PHONY: dinstall
727d396e
TL
51dinstall: $(DEB)
52 dpkg -i $(DEB)