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