]>
Commit | Line | Data |
---|---|---|
1 | include /usr/share/dpkg/default.mk | |
2 | include defines.mk | |
3 | ||
4 | export PVERELEASE = $(shell echo $(DEB_VERSION_UPSTREAM) | cut -c 1-3) | |
5 | export VERSION = $(DEB_VERSION_UPSTREAM_REVISION) | |
6 | ||
7 | BUILDDIR = $(PACKAGE)-$(DEB_VERSION_UPSTREAM) | |
8 | ||
9 | DSC=$(PACKAGE)_$(DEB_VERSION).dsc | |
10 | DEB=$(PACKAGE)_$(DEB_VERSION)_$(DEB_HOST_ARCH).deb | |
11 | ||
12 | DESTDIR= | |
13 | SUBDIRS = aplinfo PVE bin www services configs network-hooks test | |
14 | ||
15 | all: $(SUBDIRS) | |
16 | set -e && for i in $(SUBDIRS); do $(MAKE) -C $$i; done | |
17 | ||
18 | .PHONY: check | |
19 | check: bin test www | |
20 | $(MAKE) -C bin check | |
21 | $(MAKE) -C test check | |
22 | $(MAKE) -C www check | |
23 | ||
24 | GITVERSION:=$(shell git rev-parse --short=16 HEAD) | |
25 | $(BUILDDIR): | |
26 | rm -rf $@ $@.tmp | |
27 | mkdir $@.tmp | |
28 | rsync -a * $@.tmp | |
29 | echo "git clone git://git.proxmox.com/git/pve-manager.git\\ngit checkout $(GITVERSION)" > $@.tmp/debian/SOURCE | |
30 | echo "REPOID_GENERATED=$(GITVERSION)" > $@.tmp/debian/rules.env | |
31 | mv $@.tmp $@ | |
32 | ||
33 | .PHONY: deb dsc | |
34 | deb: $(DEB) | |
35 | $(DEB): $(BUILDDIR) | |
36 | cd $(BUILDDIR); dpkg-buildpackage -b -us -uc | |
37 | lintian $(DEB) | |
38 | ||
39 | dsc: | |
40 | rm -rf $(BUILDDIR) $(DSC) | |
41 | $(MAKE) $(DSC) | |
42 | lintian $(DSC) | |
43 | $(DSC): $(BUILDDIR) | |
44 | cd $(BUILDDIR); dpkg-buildpackage -S -us -uc -d | |
45 | ||
46 | sbuild: $(DSC) | |
47 | sbuild $< | |
48 | ||
49 | .PHONY: upload | |
50 | upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION) | |
51 | upload: $(DEB) | |
52 | tar cf - $(DEB) | ssh -X repoman@repo.proxmox.com upload --product pve --dist $(UPLOAD_DIST) | |
53 | ||
54 | .PHONY: install | |
55 | install: vzdump-hook-script.pl | |
56 | install -d -m 0700 -o www-data -g www-data $(DESTDIR)/var/log/pveproxy | |
57 | install -d $(DOCDIR)/examples | |
58 | install -d $(DESTDIR)/var/lib/$(PACKAGE) | |
59 | install -d $(DESTDIR)/var/lib/vz/images | |
60 | install -d $(DESTDIR)/var/lib/vz/template/cache | |
61 | install -d $(DESTDIR)/var/lib/vz/template/iso | |
62 | install -m 0644 vzdump-hook-script.pl $(DOCDIR)/examples/vzdump-hook-script.pl | |
63 | install -m 0644 spice-example-sh $(DOCDIR)/examples/spice-example-sh | |
64 | set -e && for i in $(SUBDIRS); do $(MAKE) -C $$i $@; done | |
65 | ||
66 | .PHONY: distclean | |
67 | distclean: clean | |
68 | ||
69 | .PHONY: clean | |
70 | clean: | |
71 | set -e && for i in $(SUBDIRS); do $(MAKE) -C $$i $@; done | |
72 | rm -f $(PACKAGE)*.tar* country.dat *.deb *.dsc *.build *.buildinfo *.changes | |
73 | rm -rf dest $(PACKAGE)-[0-9]*/ | |
74 | ||
75 | .PHONY: dinstall | |
76 | dinstall: $(DEB) | |
77 | dpkg -i $(DEB) |