]>
Commit | Line | Data |
---|---|---|
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/pve-zsync.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 | |
52 | lintian $(DSC) | |
53 | ||
54 | sbuild: $(DSC) | |
55 | sbuild $(DSC) | |
56 | ||
57 | .PHONY: clean | |
58 | clean: | |
59 | rm -rf $(PACKAGE)-[0-9]*/ *.deb *.dsc $(PACKAGE)*.tar.?z *.build *.buildinfo *.changes | |
60 | find . -name '*~' -exec rm {} ';' | |
61 | ||
62 | .PHONY: distclean | |
63 | distclean: clean | |
64 | ||
65 | ||
66 | .PHONY: upload | |
67 | upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION) | |
68 | upload: $(DEB) | |
69 | tar cf - $(DEB) | ssh repoman@repo.proxmox.com upload --product pve --dist $(UPLOAD_DIST) |