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