]> git.proxmox.com Git - swtpm.git/blame - GNUmakefile
d/control: Proxmox maintains this package for Proxmox projects
[swtpm.git] / GNUmakefile
CommitLineData
542229de
TL
1# NOTE: just for Proxmox packaging and called GNUmakefile to still allow direct (non-packaging) builds
2
3include /usr/share/dpkg/default.mk
4
5PACKAGE=swtpm
6
7BUILDDIR ?= $(PACKAGE)-$(DEB_VERSION)
8ORIG_SRC_TAR=$(PACKAGE)_$(DEB_VERSION_UPSTREAM).orig.tar.gz
9
10GITVERSION:=$(shell git rev-parse HEAD)
11
12DSC = $(PACKAGE)_$(DEB_VERSION).dsc
13DEB = $(PACKAGE)_$(DEB_VERSION)_$(DEB_HOST_ARCH).deb
14DEB_DBG = $(PACKAGE)-dbgsym_$(DEB_VERSION)_$(DEB_HOST_ARCH).deb
15DEB_LIB = swtpm-libs_$(DEB_VERSION)_$(DEB_HOST_ARCH).deb
16DEB_DEV = swtpm-dev_$(DEB_VERSION)_$(DEB_HOST_ARCH).deb
17DEB_TOOLS = swtpm-tools_$(DEB_VERSION)_$(DEB_HOST_ARCH).deb
18
19DEBS=$(DEB) $(DEB_DBG) $(DEB_LIB) $(DEB_DEV) $(DEB_TOOLS)
20
21all:
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
31deb: $(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
37sbuild: $(DSC)
38 sbuild $(DSC)
39
40$(ORIG_SRC_TAR): $(BUILDDIR)
41 tar czf $(ORIG_SRC_TAR) --exclude="$(BUILDDIR)/debian" $(BUILDDIR)
42
43.PHONY: dsc
44dsc:
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
53upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION)
54upload: $(DEBS)
55 tar cf - $(DEBS) | ssh repoman@repo.proxmox.com upload --product pve --dist $(UPLOAD_DIST)
56
57.PHONY: clean
58clean:
59 rm -rf $(PACKAGE)-[0-9]*/ $(PACKAGE)*.tar* *.deb *.dsc *.changes *.buildinfo *.build