]> git.proxmox.com Git - lxcfs.git/blob - Makefile
buildsys: fix source tarball generation
[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_BUILD_ARCH).deb
13 DBGDEB=$(PACKAGE)-dbgsym_$(DEB_VERSION_UPSTREAM_REVISION)_$(DEB_BUILD_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: $(DSC)
43 $(DSC): $(ORIG_SRC_TAR) $(BUILDDIR)
44 rm -f *.dsc
45 cd $(BUILDDIR); dpkg-buildpackage -S -us -uc -d
46 lintian $(DSC)
47
48 .PHONY: upload
49 upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION)
50 upload: $(DEBS)
51 tar cf - $(DEBS) | ssh repoman@repo.proxmox.com upload --product pve --dist $(UPLOAD_DIST)
52
53 .PHONY: clean distclean
54 clean:
55 rm -rf $(PACKAGE)-[0-9]*/ $(ORIG_SRC_TAR) *.deb *.dsc $(PACKAGE)*.debian.tar.[gx]z *.changes *.dsc *.buildinfo *.build
56
57 distclean: clean
58 git submodule deinit --all
59
60 .PHONY: dinstall
61 dinstall: $(DEBS)
62 dpkg -i $(DEBS)