]> git.proxmox.com Git - pve-manager.git/blame - Makefile
fixup: Makefile: s/tests/test/
[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
7f4d4526 20.PHONY: check
6530ef46 21check: bin test
7f4d4526 22 ${MAKE} -C bin check
73ed0af1 23 ${MAKE} -C test check
53f13052 24
beb651ee
DM
25.PHONY: dinstall
26dinstall: ${DEB}
27 dpkg -i ${DEB}
28
c27e8e49
WB
29.PHONY: deb
30deb: $(DEB)
31$(DEB):
beb651ee
DM
32 rm -rf dest
33 mkdir dest
ff9c5f01 34 rsync -a * dest
ff9c5f01 35 echo "git clone git://git.proxmox.com/git/pve-manager.git\\ngit checkout ${GITVERSION}" > dest/debian/SOURCE
fb992042 36 echo "REPOID_GENERATED=${REPOID}" > dest/debian/rules.env
8c200508 37 cd dest; dpkg-buildpackage -b -us -uc
46c17bd2 38 # supress lintian error: statically-linked-binary usr/bin/pvemailforward
85fd9b52 39 lintian -X binaries ${DEB}
beb651ee
DM
40
41.PHONY: upload
53f13052 42upload: ${DEB} check
de79fddd
TL
43 # check if working directory is clean
44 git diff --exit-code --stat && git diff --exit-code --stat --staged
7fffbe32 45 tar cf - ${DEB} | ssh -X repoman@repo.proxmox.com upload --product pve --dist stretch
beb651ee 46
beb651ee 47.PHONY: install
6ebc0106 48install: vzdump-hook-script.pl
3dad8dc7 49 install -d -m 0700 -o www-data -g www-data ${DESTDIR}/var/log/pveproxy
9ff497a9 50 install -d ${DOCDIR}/examples
beb651ee
DM
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
9ff497a9 56 install -m 0644 vzdump-hook-script.pl ${DOCDIR}/examples/vzdump-hook-script.pl
072188dc 57 install -m 0644 spice-example-sh ${DOCDIR}/examples/spice-example-sh
beb651ee
DM
58 set -e && for i in ${SUBDIRS}; do ${MAKE} -C $$i $@; done
59
60.PHONY: distclean
61distclean: clean
beb651ee
DM
62
63.PHONY: clean
64clean:
65 set -e && for i in ${SUBDIRS}; do ${MAKE} -C $$i $@; done
66 find . -name '*~' -exec rm {} ';'
45868655 67 rm -rf dest country.dat *.deb *.buildinfo *.changes ca-tmp