]>
Commit | Line | Data |
---|---|---|
36ca08b7 | 1 | VERSION=5.0 |
1e3baf05 | 2 | PACKAGE=qemu-server |
6956993e | 3 | PKGREL=14 |
1e3baf05 | 4 | |
4841125d DM |
5 | CFLAGS= -O2 -Werror -Wall -Wtype-limits -Wl,-z,relro |
6 | ||
1e3baf05 DM |
7 | DESTDIR= |
8 | PREFIX=/usr | |
9 | BINDIR=${PREFIX}/bin | |
10 | SBINDIR=${PREFIX}/sbin | |
11 | BINDIR=${PREFIX}/bin | |
12 | LIBDIR=${PREFIX}/lib/${PACKAGE} | |
13 | VARLIBDIR=/var/lib/${PACKAGE} | |
14 | MANDIR=${PREFIX}/share/man | |
15 | DOCDIR=${PREFIX}/share/doc | |
1e3baf05 | 16 | MAN1DIR=${MANDIR}/man1/ |
358297e0 | 17 | MAN5DIR=${MANDIR}/man5/ |
f3e76e36 | 18 | BASHCOMPLDIR=${PREFIX}/share/bash-completion/completions/ |
1e3baf05 DM |
19 | export PERLDIR=${PREFIX}/share/perl5 |
20 | PERLINCDIR=${PERLDIR}/asm-x86_64 | |
21 | ||
22 | ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH) | |
2354a8bb DM |
23 | GITVERSION:=$(shell cat .git/refs/heads/master) |
24 | ||
1e3baf05 DM |
25 | DEB=${PACKAGE}_${VERSION}-${PKGREL}_${ARCH}.deb |
26 | ||
f625f7f6 DM |
27 | # this requires package pve-doc-generator |
28 | export NOVIEW=1 | |
29 | include /usr/share/pve-doc-generator/pve-doc-generator.mk | |
30 | ||
88c9e280 TL |
31 | export SOURCE_DATE_EPOCH ?= $(shell dpkg-parsechangelog -STimestamp) |
32 | ||
33 | all: | |
1e3baf05 DM |
34 | |
35 | .PHONY: dinstall | |
36 | dinstall: deb | |
37 | dpkg -i ${DEB} | |
38 | ||
1e3baf05 | 39 | vmtar: vmtar.c utils.c |
4841125d | 40 | gcc ${CFLAGS} -o vmtar vmtar.c |
1e3baf05 DM |
41 | |
42 | sparsecp: sparsecp.c utils.c | |
4841125d | 43 | gcc ${CFLAGS} -o sparsecp sparsecp.c |
1e3baf05 | 44 | |
f3e76e36 | 45 | qm.bash-completion: |
3227a101 | 46 | PVE_GENERATING_DOCS=1 perl -I. -T -e "use PVE::CLI::qm; PVE::CLI::qm->generate_bash_completions();" >$@.tmp |
f3e76e36 | 47 | mv $@.tmp $@ |
1e3baf05 | 48 | |
cc7b93ec | 49 | qmrestore.bash-completion: |
3227a101 | 50 | PVE_GENERATING_DOCS=1 perl -I. -T -e "use PVE::CLI::qmrestore; PVE::CLI::qmrestore->generate_bash_completions();" >$@.tmp |
cc7b93ec | 51 | mv $@.tmp $@ |
3e16d5fc | 52 | |
88c9e280 | 53 | PKGSOURCES=qm qm.1 qmrestore qmrestore.1 qmextract sparsecp vmtar qm.conf.5 qm.bash-completion qmrestore.bash-completion |
1e3baf05 DM |
54 | |
55 | .PHONY: install | |
56 | install: ${PKGSOURCES} | |
57 | install -d ${DESTDIR}/${SBINDIR} | |
1e3baf05 DM |
58 | install -d ${DESTDIR}${LIBDIR} |
59 | install -d ${DESTDIR}${VARLIBDIR} | |
358297e0 DM |
60 | install -d ${DESTDIR}/${MAN1DIR} |
61 | install -d ${DESTDIR}/${MAN5DIR} | |
1e3baf05 DM |
62 | install -d ${DESTDIR}/usr/share/man/man5 |
63 | install -d ${DESTDIR}/usr/share/${PACKAGE} | |
64 | install -m 0644 pve-usb.cfg ${DESTDIR}/usr/share/${PACKAGE} | |
f8e83f05 | 65 | install -m 0644 pve-q35.cfg ${DESTDIR}/usr/share/${PACKAGE} |
f3e76e36 | 66 | install -m 0644 -D qm.bash-completion ${DESTDIR}/${BASHCOMPLDIR}/qm |
cc7b93ec | 67 | install -m 0644 -D qmrestore.bash-completion ${DESTDIR}/${BASHCOMPLDIR}/qmrestore |
dbea4415 | 68 | install -m 0644 -D bootsplash.jpg ${DESTDIR}/usr/share/${PACKAGE} |
1e3baf05 DM |
69 | make -C PVE install |
70 | install -m 0755 qm ${DESTDIR}${SBINDIR} | |
1e3baf05 | 71 | install -m 0755 qmrestore ${DESTDIR}${SBINDIR} |
1e3baf05 | 72 | install -m 0755 pve-bridge ${DESTDIR}${VARLIBDIR}/pve-bridge |
208ba94e | 73 | install -m 0755 pve-bridge-hotplug ${DESTDIR}${VARLIBDIR}/pve-bridge-hotplug |
011c5817 | 74 | install -m 0755 pve-bridgedown ${DESTDIR}${VARLIBDIR}/pve-bridgedown |
1e3baf05 DM |
75 | install -s -m 0755 vmtar ${DESTDIR}${LIBDIR} |
76 | install -s -m 0755 sparsecp ${DESTDIR}${LIBDIR} | |
4841125d | 77 | install -D -m 0644 modules-load.conf ${DESTDIR}/etc/modules-load.d/qemu-server.conf |
3e16d5fc | 78 | install -m 0755 qmextract ${DESTDIR}${LIBDIR} |
358297e0 | 79 | install -m 0644 qm.1 ${DESTDIR}/${MAN1DIR} |
befb7c46 | 80 | gzip -9 -n ${DESTDIR}/${MAN1DIR}/qm.1 |
358297e0 | 81 | install -m 0644 qmrestore.1 ${DESTDIR}/${MAN1DIR} |
befb7c46 | 82 | gzip -9 -n ${DESTDIR}/${MAN1DIR}/qmrestore.1 |
358297e0 | 83 | install -m 0644 qm.conf.5 ${DESTDIR}/${MAN5DIR} |
befb7c46 | 84 | gzip -9 -n ${DESTDIR}/${MAN5DIR}/qm.conf.5 |
c881ad2f | 85 | cd ${DESTDIR}/${MAN5DIR}; ln -s qm.conf.5.gz vm.conf.5.gz |
1e3baf05 | 86 | |
ffc0bacf | 87 | .PHONY: deb |
e448dcf3 | 88 | deb: ${DEB} |
88c9e280 | 89 | ${DEB}: |
81425ee8 | 90 | rm -rf build |
88c9e280 | 91 | rsync -a * build |
88c9e280 | 92 | echo "git clone git://git.proxmox.com/git/qemu-server.git\\ngit checkout ${GITVERSION}" > build/debian/SOURCE |
a183ab0d | 93 | cd build; dpkg-buildpackage -b -us -uc |
485e8e1d | 94 | lintian ${DEB} |
1e3baf05 | 95 | |
88c9e280 TL |
96 | .PHONY: test |
97 | test: | |
98 | PVE_GENERATING_DOCS=1 perl -I. ./qm verifyapi | |
35c78505 FG |
99 | make -C test |
100 | ||
1e3baf05 | 101 | .PHONY: upload |
dae9b620 | 102 | upload: ${DEB} |
36ca08b7 | 103 | tar cf - ${DEB} | ssh repoman@repo.proxmox.com upload --product pve --dist stretch |
1e3baf05 DM |
104 | |
105 | .PHONY: clean | |
88c9e280 | 106 | clean: |
f625f7f6 | 107 | make cleanup-docgen |
88c9e280 | 108 | rm -rf build *.deb *.buildinfo *.changes |
1e3baf05 DM |
109 | find . -name '*~' -exec rm {} ';' |
110 | ||
111 | ||
112 | .PHONY: distclean | |
113 | distclean: clean |