]>
Commit | Line | Data |
---|---|---|
542229de TL |
1 | # NOTE: just for Proxmox packaging and called GNUmakefile to still allow direct (non-packaging) builds |
2 | ||
3 | include /usr/share/dpkg/default.mk | |
4 | ||
5 | PACKAGE=swtpm | |
6 | ||
7 | BUILDDIR ?= $(PACKAGE)-$(DEB_VERSION) | |
8 | ORIG_SRC_TAR=$(PACKAGE)_$(DEB_VERSION_UPSTREAM).orig.tar.gz | |
9 | ||
10 | GITVERSION:=$(shell git rev-parse HEAD) | |
11 | ||
12 | DSC = $(PACKAGE)_$(DEB_VERSION).dsc | |
13 | DEB = $(PACKAGE)_$(DEB_VERSION)_$(DEB_HOST_ARCH).deb | |
14 | DEB_DBG = $(PACKAGE)-dbgsym_$(DEB_VERSION)_$(DEB_HOST_ARCH).deb | |
15 | DEB_LIB = swtpm-libs_$(DEB_VERSION)_$(DEB_HOST_ARCH).deb | |
16 | DEB_DEV = swtpm-dev_$(DEB_VERSION)_$(DEB_HOST_ARCH).deb | |
17 | DEB_TOOLS = swtpm-tools_$(DEB_VERSION)_$(DEB_HOST_ARCH).deb | |
18 | ||
19 | DEBS=$(DEB) $(DEB_DBG) $(DEB_LIB) $(DEB_DEV) $(DEB_TOOLS) | |
20 | ||
21 | all: | |
22 | ||
23 | $(BUILDDIR): | |
24 | rm -rf $@ $@.tmp | |
25 | rsync -a * $@.tmp | |
26 | rm -f $@.tmp/GNUmakefile # just for Proxmox packaging convenience | |
27 | echo "git clone git://git.proxmox.com/git/lxcfs.git\\ngit checkout $(GITVERSION)" > $@.tmp/debian/SOURCE | |
28 | mv $@.tmp $@ | |
29 | ||
30 | .PHONY: deb | |
31 | deb: $(DEBS) | |
32 | $(DEB_DBG) $(DEB_LIB) $(DEB_DEV) $(DEB_TOOLS): $(DEB) | |
33 | $(DEB): $(BUILDDIR) | |
34 | cd $(BUILDDIR); dpkg-buildpackage -rfakeroot -b -us -uc | |
35 | lintian $(DEBS) | |
36 | ||
37 | sbuild: $(DSC) | |
38 | sbuild $(DSC) | |
39 | ||
40 | $(ORIG_SRC_TAR): $(BUILDDIR) | |
41 | tar czf $(ORIG_SRC_TAR) --exclude="$(BUILDDIR)/debian" $(BUILDDIR) | |
42 | ||
43 | .PHONY: dsc | |
44 | dsc: | |
45 | $(MAKE) clean | |
46 | $(MAKE) $(DSC) | |
47 | lintian $(DSC) | |
48 | ||
49 | $(DSC): $(ORIG_SRC_TAR) $(BUILDDIR) | |
50 | cd $(BUILDDIR); dpkg-buildpackage -S -us -uc -d | |
51 | ||
52 | .PHONY: upload | |
53 | upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION) | |
54 | upload: $(DEBS) | |
55 | tar cf - $(DEBS) | ssh repoman@repo.proxmox.com upload --product pve --dist $(UPLOAD_DIST) | |
56 | ||
57 | .PHONY: clean | |
58 | clean: | |
59 | rm -rf $(PACKAGE)-[0-9]*/ $(PACKAGE)*.tar* *.deb *.dsc *.changes *.buildinfo *.build |