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