]> git.proxmox.com Git - lxcfs.git/blob - Makefile
buildsys: add dsc 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 $(ORIG_SRC_TAR): $(BUILDDIR)
37 tar czf $(ORIG_SRC_TAR) -C $(BUILDDIR) .
38
39 .PHONY: dsc
40 dsc: $(DSC)
41 $(DSC): $(ORIG_SRC_TAR) $(BUILDDIR)
42 rm -f *.dsc
43 cd $(BUILDDIR); dpkg-buildpackage -S -us -uc -d
44 lintian $(DSC)
45
46 .PHONY: upload
47 upload: $(DEBS)
48 tar cf - ${DEBS} | ssh repoman@repo.proxmox.com upload --product pve --dist bullseye
49
50 .PHONY: clean distclean
51 clean:
52 rm -rf $(PACKAGE)-*/ *.deb *.changes *.dsc *.buildinfo
53
54 distclean: clean
55 git submodule deinit --all
56
57 .PHONY: dinstall
58 dinstall: $(DEBS)
59 dpkg -i $(DEBS)