]> git.proxmox.com Git - pve-zsync.git/blob - Makefile
buildsys: derive upload dist automatically
[pve-zsync.git] / Makefile
1 include /usr/share/dpkg/pkg-info.mk
2
3 PACKAGE=pve-zsync
4
5 DESTDIR=
6 SBINDIR=$(DESTDIR)/usr/sbin
7 MAN8DIR=$(DESTDIR)/usr/share/man/man8
8 DOCDIR=$(DESTDIR)/usr/share/doc/$(PACKAGE)
9 WORKDIR=$(DESTDIR)/var/lib/pve-zsync
10
11 BUILDDIR ?= $(PACKAGE)-$(DEB_VERSION_UPSTREAM)
12
13 GITVERSION:=$(shell git rev-parse HEAD)
14
15 DEB=$(PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION)_all.deb
16 DSC=$(PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION).dsc
17
18 all:
19
20 .PHONY: dinstall
21 dinstall: deb
22 dpkg -i $(DEB)
23
24 pve-zsync.8: pve-zsync
25 ./pve-zsync printpod | pod2man -c "Proxmox Documentation" -s 8 -r $(DEB_VERSION_UPSTREAM) -n pve-zsync - pve-zsync.8
26
27 .PHONY: install
28 install: pve-zsync.8
29 install -d $(SBINDIR)
30 install -m 0755 pve-zsync $(SBINDIR)/pve-zsync
31 install -d $(WORKDIR)
32 install -d $(MAN8DIR)
33 install -m 0644 pve-zsync.8 $(MAN8DIR)/pve-zsync.8
34 install -d $(DOCDIR)
35
36 $(BUILDDIR):
37 rm -rf $@.tmp $@
38 rsync -a * $@.tmp
39 echo "git clone git://git.proxmox.com/git/dab.git\\ngit checkout $(GITVERSION)" > $@.tmp/debian/SOURCE
40 mv $@.tmp $@
41
42 .PHONY: deb
43 deb: $(DEB)
44 $(DEB): $(BUILDDIR)
45 cd $(BUILDDIR); dpkg-buildpackage -b -us -uc
46 lintian $(DEB)
47
48 .PHONY: dsc
49 dsc: $(DSC)
50 $(DSC):$(BUILDDIR)
51 cd $(BUILDDIR); dpkg-buildpackage -S -us -uc -d -nc
52 lintian $(DSC)
53
54 .PHONY: clean
55 clean:
56 rm -rf $(BUILDDIR) *.deb *.dsc $(PACKAGE)*.tar.gz *.buildinfo *.changes
57 find . -name '*~' -exec rm {} ';'
58
59 .PHONY: distclean
60 distclean: clean
61
62
63 .PHONY: upload
64 upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION)
65 upload: $(DEB)
66 tar cf - $(DEB) | ssh repoman@repo.proxmox.com upload --product pve --dist $(UPLOAD_DIST)