]> git.proxmox.com Git - pve-manager.git/blob - Makefile
update shipped appliance info index
[pve-manager.git] / Makefile
1 include defines.mk
2
3 export SOURCE_DATE_EPOCH ?= $(shell dpkg-parsechangelog -STimestamp)
4
5 DESTDIR=
6
7 SUBDIRS = aplinfo PVE bin www services configs network-hooks test
8
9 ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
10 GITVERSION:=$(shell git rev-parse HEAD)
11
12 # possibly set via debian/rules(.env)
13 REPOID?=$(shell git rev-parse --short=8 HEAD)
14
15 DEB=${PACKAGE}_${VERSION}-${PACKAGERELEASE}_${ARCH}.deb
16
17 all: ${SUBDIRS}
18 set -e && for i in ${SUBDIRS}; do ${MAKE} -C $$i; done
19
20 .PHONY: check
21 check: bin test
22 ${MAKE} -C bin check
23 ${MAKE} -C test check
24
25 .PHONY: dinstall
26 dinstall: ${DEB}
27 dpkg -i ${DEB}
28
29 .PHONY: deb
30 deb: $(DEB)
31 $(DEB):
32 rm -rf dest
33 mkdir dest
34 rsync -a * dest
35 echo "git clone git://git.proxmox.com/git/pve-manager.git\\ngit checkout ${GITVERSION}" > dest/debian/SOURCE
36 echo "REPOID_GENERATED=${REPOID}" > dest/debian/rules.env
37 cd dest; dpkg-buildpackage -b -us -uc
38 # supress lintian error: statically-linked-binary usr/bin/pvemailforward
39 lintian -X binaries ${DEB}
40
41 .PHONY: upload
42 upload: ${DEB} check
43 # check if working directory is clean
44 git diff --exit-code --stat && git diff --exit-code --stat --staged
45 tar cf - ${DEB} | ssh -X repoman@repo.proxmox.com upload --product pve --dist stretch
46
47 .PHONY: install
48 install: vzdump-hook-script.pl
49 install -d -m 0700 -o www-data -g www-data ${DESTDIR}/var/log/pveproxy
50 install -d ${DOCDIR}/examples
51 install -d ${DESTDIR}/var/lib/${PACKAGE}
52 install -d ${DESTDIR}/var/lib/vz/images
53 install -d ${DESTDIR}/var/lib/vz/template/cache
54 install -d ${DESTDIR}/var/lib/vz/template/iso
55 install -d ${DESTDIR}/var/lib/vz/template/qemu
56 install -m 0644 vzdump-hook-script.pl ${DOCDIR}/examples/vzdump-hook-script.pl
57 install -m 0644 spice-example-sh ${DOCDIR}/examples/spice-example-sh
58 set -e && for i in ${SUBDIRS}; do ${MAKE} -C $$i $@; done
59
60 .PHONY: distclean
61 distclean: clean
62
63 .PHONY: clean
64 clean:
65 set -e && for i in ${SUBDIRS}; do ${MAKE} -C $$i $@; done
66 find . -name '*~' -exec rm {} ';'
67 rm -rf dest country.dat *.deb *.buildinfo *.changes ca-tmp