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