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