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