]> git.proxmox.com Git - libtpms.git/blob - GNUmakefile
fixup packaging make file
[libtpms.git] / GNUmakefile
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=libtpms
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)0_$(DEB_VERSION)_$(DEB_HOST_ARCH).deb
14 DEB_DBG = $(PACKAGE)0-dbgsym_$(DEB_VERSION)_$(DEB_HOST_ARCH).deb
15 DEB_DEV = $(PACKAGE)-dev_$(DEB_VERSION)_$(DEB_HOST_ARCH).deb
16
17 DEBS=$(DEB) $(DEB_DBG) $(DEB_DEV)
18
19 all:
20
21 $(BUILDDIR):
22 rm -rf $@ $@.tmp
23 rsync -a * $@.tmp
24 rm -f $@.tmp/GNUmakefile # just for Proxmox packaging convenience
25 echo "git clone git://git.proxmox.com/git/lxcfs.git\\ngit checkout $(GITVERSION)" > $@.tmp/debian/SOURCE
26 mv $@.tmp $@
27
28 .PHONY: deb
29 deb: $(DEBS)
30 $(DEB_DBG) $(DEB_DEV): $(DEB)
31 $(DEB): $(BUILDDIR)
32 cd $(BUILDDIR); dpkg-buildpackage -rfakeroot -b -us -uc
33 lintian $(DEBS)
34
35 sbuild: $(DSC)
36 sbuild $(DSC)
37
38 $(ORIG_SRC_TAR): $(BUILDDIR)
39 tar czf $(ORIG_SRC_TAR) --exclude="$(BUILDDIR)/debian" $(BUILDDIR)
40
41 .PHONY: dsc
42 dsc:
43 $(MAKE) clean
44 $(MAKE) $(DSC)
45 lintian $(DSC)
46
47 $(DSC): $(ORIG_SRC_TAR) $(BUILDDIR)
48 cd $(BUILDDIR); dpkg-buildpackage -S -us -uc -d
49
50 .PHONY: upload
51 upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION)
52 upload: $(DEBS)
53 tar cf - $(DEBS) | ssh repoman@repo.proxmox.com upload --product pve --dist $(UPLOAD_DIST)
54
55 .PHONY: clean
56 clean:
57 rm -rf $(PACKAGE)-[0-9]*/ $(PACKAGE)*.tar* *.deb *.dsc *.changes *.buildinfo *.build