]> git.proxmox.com Git - pmg-api.git/blob - Makefile
ruledb disclaimer: cleanup trailing whitespace
[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 $(BUILDDIR): src debian
11 rm -rf $@ $@.tmp
12 cp -a src $@.tmp
13 cp -a debian $@.tmp/
14 echo "REPOID_GENERATED=$(shell git rev-parse --short=12 HEAD)" > $@.tmp/debian/rules.env
15 mv $@.tmp $@
16
17 .PHONY: deb
18 deb: $(DEB)
19 $(DEB): $(BUILDDIR)
20 cd $(BUILDDIR); dpkg-buildpackage -b -us -uc
21 lintian $(DEB)
22
23 dsc:
24 rm -rf $(BUILDDIR) $(DSC)
25 $(MAKE) $(DSC)
26 lintian $(DSC)
27 $(DSC): $(BUILDDIR)
28 cd $(BUILDDIR); dpkg-buildpackage -S -us -uc -d
29
30 sbuild: $(DSC)
31 sbuild $<
32
33 .PHONY: upload
34 upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION)
35 upload: $(DEB)
36 tar cf - $(DEB) | ssh -X repoman@repo.proxmox.com -- upload --product pmg --dist $(UPLOAD_DIST)
37
38 .PHONY: check
39 check:
40 $(MAKE) -C src/tests check
41
42 .PHONY: clean distclean
43 distclean: clean
44 clean:
45 rm -rf $(PACKAGE)-[0-9]*/
46 rm -rf *.deb *.changes *.build *.buildinfo $(PACKAGE)*tar* *.dsc
47
48 .PHONY: dinstall
49 dinstall: $(DEB)
50 dpkg -i $(DEB)