]> git.proxmox.com Git - lxcfs.git/blob - Makefile
buildsys: improve DSC target
[lxcfs.git] / Makefile
1 include /usr/share/dpkg/default.mk
2
3 PACKAGE=lxcfs
4
5 SRCDIR=$(PACKAGE)
6 BUILDDIR ?= $(PACKAGE)-$(DEB_VERSION_UPSTREAM)
7 ORIG_SRC_TAR=$(PACKAGE)_$(DEB_VERSION_UPSTREAM).orig.tar.gz
8
9 GITVERSION:=$(shell git rev-parse HEAD)
10
11 DSC=$(PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION).dsc
12 DEB=$(PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION)_$(DEB_HOST_ARCH).deb
13 DBGDEB=$(PACKAGE)-dbgsym_$(DEB_VERSION_UPSTREAM_REVISION)_$(DEB_HOST_ARCH).deb
14 DEBS=$(DEB) $(DBGDEB)
15
16 all: $(DEB)
17
18 .PHONY: submodule
19 submodule:
20 test -f "$(SRCDIR)/README" || git submodule update --init
21 $(SRCDIR)/README: submodule
22
23 $(BUILDDIR): $(SRCDIR)/README debian
24 rm -rf $(BUILDDIR)
25 rsync -a $(SRCDIR)/ debian $(BUILDDIR)
26 echo "git clone git://git.proxmox.com/git/lxcfs.git\\ngit checkout $(GITVERSION)" > $(BUILDDIR)/debian/SOURCE
27
28 .PHONY: deb
29 deb: $(DEBS)
30 $(DBGDEB): $(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 distclean
56 clean:
57 rm -rf $(PACKAGE)-[0-9]*/
58 rm -rf $(PACKAGE)*.tar* *.deb *.dsc *.changes *.dsc *.buildinfo *.build
59
60 distclean: clean
61 git submodule deinit --all
62
63 .PHONY: dinstall
64 dinstall: $(DEBS)
65 dpkg -i $(DEBS)