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