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