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