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