]> git.proxmox.com Git - pve-manager.git/blob - Makefile
buildsys: adapt extracting release to native versioning
[pve-manager.git] / Makefile
1 include /usr/share/dpkg/pkg-info.mk
2 include /usr/share/dpkg/architecture.mk
3 include defines.mk
4
5 export PVERELEASE = $(shell echo $(DEB_VERSION_UPSTREAM) | cut -c 1-3)
6 export VERSION = $(DEB_VERSION_UPSTREAM_REVISION)
7
8 DESTDIR=
9
10 SUBDIRS = aplinfo PVE bin www services configs network-hooks test
11
12 GITVERSION:=$(shell git rev-parse --short=16 HEAD)
13
14
15 BUILDDIR = $(PACKAGE)-$(DEB_VERSION_UPSTREAM)
16
17 DSC=$(PACKAGE)_$(DEB_VERSION).dsc
18 DEB=$(PACKAGE)_$(DEB_VERSION)_$(DEB_HOST_ARCH).deb
19
20 all: $(SUBDIRS)
21 set -e && for i in $(SUBDIRS); do $(MAKE) -C $$i; done
22
23 .PHONY: check
24 check: bin test www
25 $(MAKE) -C bin check
26 $(MAKE) -C test check
27 $(MAKE) -C www check
28
29 .PHONY: dinstall
30 dinstall: $(DEB)
31 dpkg -i $(DEB)
32
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
41 .PHONY: deb dsc
42 deb: $(DEB)
43 $(DEB): $(BUILDDIR)
44 cd $(BUILDDIR); dpkg-buildpackage -b -us -uc
45 lintian $(DEB)
46
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
57 .PHONY: upload
58 upload: $(DEB) check
59 # check if working directory is clean
60 git diff --exit-code --stat && git diff --exit-code --stat --staged
61 tar cf - $(DEB) | ssh -X repoman@repo.proxmox.com upload --product pve --dist bullseye
62
63 .PHONY: install
64 install: vzdump-hook-script.pl
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
74
75 .PHONY: distclean
76 distclean: clean
77
78 .PHONY: clean
79 clean:
80 set -e && for i in $(SUBDIRS); do $(MAKE) -C $$i $@; done
81 rm -f $(PACKAGE)*.tar* country.dat *.deb *.dsc *.build *.buildinfo *.changes
82 rm -rf dest $(PACKAGE)-[0-9]*/