]> git.proxmox.com Git - pmg-api.git/blob - Makefile
buildsys: add DSC & sbuild convenience target
[pmg-api.git] / Makefile
1 include /usr/share/dpkg/pkg-info.mk
2
3 PACKAGE=pmg-api
4
5 BUILDDIR ?= $(PACKAGE)-$(DEB_VERSION)
6
7 DSC=$(PACKAGE)_$(DEB_VERSION).dsc
8 DEB=$(PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION)_all.deb
9
10 REPOID = $(shell git rev-parse --short=8 HEAD)
11
12 export PACKAGE
13 export REPOID
14 export PMGVERSION = $(DEB_VERSION_UPSTREAM_REVISION)
15 export PMGRELEASE = $(shell echo $(DEB_VERSION_UPSTREAM) | cut -c 1-3)
16
17 $(BUILDDIR): src debian
18 rm -rf $@ $@.tmp
19 cp -a src $@.tmp
20 cp -a debian $@.tmp/
21 mv $@.tmp $@
22
23 .PHONY: deb
24 deb: $(DEB)
25 $(DEB): $(BUILDDIR)
26 cd $(BUILDDIR); dpkg-buildpackage -b -us -uc
27 lintian $(DEB)
28
29 dsc:
30 rm -rf $(BUILDDIR) $(DSC)
31 $(MAKE) $(DSC)
32 lintian $(DSC)
33 $(DSC): $(BUILDDIR)
34 cd $(BUILDDIR); dpkg-buildpackage -S -us -uc -d
35
36 sbuild: $(DSC)
37 sbuild $<
38
39 .PHONY: upload
40 upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION)
41 upload: $(DEB)
42 tar cf - $(DEB) | ssh -X repoman@repo.proxmox.com -- upload --product pmg --dist $(UPLOAD_DIST)
43
44 .PHONY: check
45 check:
46 $(MAKE) -C src/tests check
47
48 .PHONY: clean distclean
49 distclean: clean
50 clean:
51 rm -rf $(PACKAGE)-[0-9]*/
52 rm -rf *.deb *.changes *.build *.buildinfo $(PACKAGE)*tar* *.dsc
53
54 .PHONY: dinstall
55 dinstall: $(DEB)
56 dpkg -i $(DEB)