]> git.proxmox.com Git - lxcfs.git/blob - Makefile
buildsys: add sbuild convenience target
[lxcfs.git] / Makefile
1 include /usr/share/dpkg/pkg-info.mk
2 include /usr/share/dpkg/architecture.mk
3
4 PACKAGE=lxcfs
5
6 SRCDIR=${PACKAGE}
7 BUILDDIR ?= ${PACKAGE}-${DEB_VERSION_UPSTREAM}
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_UPSTREAM_REVISION).dsc
13 DEB=${PACKAGE}_${DEB_VERSION_UPSTREAM_REVISION}_${DEB_BUILD_ARCH}.deb
14 DBGDEB=${PACKAGE}-dbgsym_${DEB_VERSION_UPSTREAM_REVISION}_${DEB_BUILD_ARCH}.deb
15 DEBS=$(DEB) $(DBGDEB)
16
17 all: ${DEB}
18
19 .PHONY: submodule
20 submodule:
21 test -f "${SRCDIR}/README" || git submodule update --init
22 ${SRCDIR}/README: submodule
23
24 $(BUILDDIR): $(SRCDIR)/README debian
25 rm -rf $(BUILDDIR)
26 rsync -a $(SRCDIR)/ debian $(BUILDDIR)
27 echo "git clone git://git.proxmox.com/git/lxcfs.git\\ngit checkout $(GITVERSION)" > $(BUILDDIR)/debian/SOURCE
28
29 .PHONY: deb
30 deb: $(DEBS)
31 $(DBGDEB): $(DEB)
32 $(DEB): $(BUILDDIR)
33 cd $(BUILDDIR); dpkg-buildpackage -rfakeroot -b -us -uc
34 lintian $(DEBS)
35
36 sbuild: $(DSC)
37 sbuild $(DSC)
38
39 $(ORIG_SRC_TAR): $(BUILDDIR)
40 tar czf $(ORIG_SRC_TAR) -C $(BUILDDIR) .
41
42 .PHONY: dsc
43 dsc: $(DSC)
44 $(DSC): $(ORIG_SRC_TAR) $(BUILDDIR)
45 rm -f *.dsc
46 cd $(BUILDDIR); dpkg-buildpackage -S -us -uc -d
47 lintian $(DSC)
48
49 .PHONY: upload
50 upload: $(DEBS)
51 tar cf - ${DEBS} | ssh repoman@repo.proxmox.com upload --product pve --dist bookworm
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)