]> git.proxmox.com Git - pmg-api.git/blame_incremental - Makefile
pmg7to8: sync over changes from stable-7 branch
[pmg-api.git] / Makefile
... / ...
CommitLineData
1include /usr/share/dpkg/pkg-info.mk
2
3PACKAGE=pmg-api
4
5BUILDDIR ?= $(PACKAGE)-$(DEB_VERSION)
6
7DSC=$(PACKAGE)_$(DEB_VERSION).dsc
8DEB=$(PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION)_all.deb
9
10REPOID = $(shell git rev-parse --short=8 HEAD)
11
12export PACKAGE
13export REPOID
14export PMGVERSION = $(DEB_VERSION_UPSTREAM_REVISION)
15export 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
24deb: $(DEB)
25$(DEB): $(BUILDDIR)
26 cd $(BUILDDIR); dpkg-buildpackage -b -us -uc
27 lintian $(DEB)
28
29dsc:
30 rm -rf $(BUILDDIR) $(DSC)
31 $(MAKE) $(DSC)
32 lintian $(DSC)
33$(DSC): $(BUILDDIR)
34 cd $(BUILDDIR); dpkg-buildpackage -S -us -uc -d
35
36sbuild: $(DSC)
37 sbuild $<
38
39.PHONY: upload
40upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION)
41upload: $(DEB)
42 tar cf - $(DEB) | ssh -X repoman@repo.proxmox.com -- upload --product pmg --dist $(UPLOAD_DIST)
43
44.PHONY: check
45check:
46 $(MAKE) -C src/tests check
47
48.PHONY: clean distclean
49distclean: clean
50clean:
51 rm -rf $(PACKAGE)-[0-9]*/
52 rm -rf *.deb *.changes *.build *.buildinfo $(PACKAGE)*tar* *.dsc
53
54.PHONY: dinstall
55dinstall: $(DEB)
56 dpkg -i $(DEB)