]>
Commit | Line | Data |
---|---|---|
6b0ddb3c | 1 | VERSION=4.0 |
1e3baf05 | 2 | PACKAGE=qemu-server |
f4c1d8e2 | 3 | PKGREL=103 |
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 | ||
1e3baf05 DM |
31 | all: ${DEB} |
32 | ||
33 | .PHONY: dinstall | |
34 | dinstall: deb | |
35 | dpkg -i ${DEB} | |
36 | ||
37 | control: control.in | |
38 | sed -e s/@@VERSION@@/${VERSION}/ -e s/@@PKGRELEASE@@/${PKGREL}/ -e s/@@ARCH@@/${ARCH}/<$< >$@ | |
39 | ||
1e3baf05 DM |
40 | vzsyscalls.ph: vzsyscalls.h |
41 | h2ph -d . vzsyscalls.h | |
42 | ||
43 | vmtar: vmtar.c utils.c | |
4841125d | 44 | gcc ${CFLAGS} -o vmtar vmtar.c |
1e3baf05 DM |
45 | |
46 | sparsecp: sparsecp.c utils.c | |
4841125d | 47 | gcc ${CFLAGS} -o sparsecp sparsecp.c |
1e3baf05 | 48 | |
f3e76e36 DM |
49 | qm.bash-completion: |
50 | perl -I. -T -e "use PVE::CLI::qm; PVE::CLI::qm->generate_bash_completions();" >$@.tmp | |
51 | mv $@.tmp $@ | |
1e3baf05 | 52 | |
cc7b93ec DM |
53 | qmrestore.bash-completion: |
54 | perl -I. -T -e "use PVE::CLI::qmrestore; PVE::CLI::qmrestore->generate_bash_completions();" >$@.tmp | |
55 | mv $@.tmp $@ | |
3e16d5fc | 56 | |
b6329a72 | 57 | PKGSOURCES=qm qm.1 qmrestore qmrestore.1 qmextract sparsecp vmtar control qm.conf.5 qm.bash-completion qmrestore.bash-completion |
1e3baf05 DM |
58 | |
59 | .PHONY: install | |
60 | install: ${PKGSOURCES} | |
61 | install -d ${DESTDIR}/${SBINDIR} | |
1e3baf05 DM |
62 | install -d ${DESTDIR}${LIBDIR} |
63 | install -d ${DESTDIR}${VARLIBDIR} | |
358297e0 DM |
64 | install -d ${DESTDIR}/${MAN1DIR} |
65 | install -d ${DESTDIR}/${MAN5DIR} | |
1e3baf05 DM |
66 | install -d ${DESTDIR}/usr/share/man/man5 |
67 | install -d ${DESTDIR}/usr/share/${PACKAGE} | |
68 | install -m 0644 pve-usb.cfg ${DESTDIR}/usr/share/${PACKAGE} | |
f8e83f05 | 69 | install -m 0644 pve-q35.cfg ${DESTDIR}/usr/share/${PACKAGE} |
f3e76e36 | 70 | install -m 0644 -D qm.bash-completion ${DESTDIR}/${BASHCOMPLDIR}/qm |
cc7b93ec | 71 | install -m 0644 -D qmrestore.bash-completion ${DESTDIR}/${BASHCOMPLDIR}/qmrestore |
dbea4415 | 72 | install -m 0644 -D bootsplash.jpg ${DESTDIR}/usr/share/${PACKAGE} |
1e3baf05 DM |
73 | make -C PVE install |
74 | install -m 0755 qm ${DESTDIR}${SBINDIR} | |
1e3baf05 | 75 | install -m 0755 qmrestore ${DESTDIR}${SBINDIR} |
1e3baf05 | 76 | install -m 0755 pve-bridge ${DESTDIR}${VARLIBDIR}/pve-bridge |
208ba94e | 77 | install -m 0755 pve-bridge-hotplug ${DESTDIR}${VARLIBDIR}/pve-bridge-hotplug |
011c5817 | 78 | install -m 0755 pve-bridgedown ${DESTDIR}${VARLIBDIR}/pve-bridgedown |
1e3baf05 DM |
79 | install -s -m 0755 vmtar ${DESTDIR}${LIBDIR} |
80 | install -s -m 0755 sparsecp ${DESTDIR}${LIBDIR} | |
4841125d | 81 | install -D -m 0644 modules-load.conf ${DESTDIR}/etc/modules-load.d/qemu-server.conf |
3e16d5fc | 82 | install -m 0755 qmextract ${DESTDIR}${LIBDIR} |
358297e0 DM |
83 | install -m 0644 qm.1 ${DESTDIR}/${MAN1DIR} |
84 | gzip -9 ${DESTDIR}/${MAN1DIR}/qm.1 | |
85 | install -m 0644 qmrestore.1 ${DESTDIR}/${MAN1DIR} | |
86 | gzip -9 ${DESTDIR}/${MAN1DIR}/qmrestore.1 | |
87 | install -m 0644 qm.conf.5 ${DESTDIR}/${MAN5DIR} | |
88 | gzip -9 ${DESTDIR}/${MAN5DIR}/qm.conf.5 | |
c881ad2f | 89 | cd ${DESTDIR}/${MAN5DIR}; ln -s qm.conf.5.gz vm.conf.5.gz |
1e3baf05 | 90 | |
ffc0bacf | 91 | .PHONY: deb |
1e3baf05 | 92 | deb ${DEB}: ${PKGSOURCES} |
ffc0bacf | 93 | rm -f *.deb |
81425ee8 DM |
94 | rm -rf build |
95 | mkdir build | |
96 | make DESTDIR=${CURDIR}/build install | |
1e3baf05 | 97 | perl -I. ./qm verifyapi |
81425ee8 DM |
98 | install -d -m 0755 build/DEBIAN |
99 | install -m 0644 control build/DEBIAN | |
dd9d6fb6 | 100 | install -m 0644 triggers build/DEBIAN |
4841125d | 101 | echo "/etc/modules-load.d/qemu-server.conf" >>build/DEBIAN/conffiles |
81425ee8 DM |
102 | install -D -m 0644 copyright build/${DOCDIR}/${PACKAGE}/copyright |
103 | install -m 0644 changelog.Debian build/${DOCDIR}/${PACKAGE}/ | |
104 | gzip -9 build/${DOCDIR}/${PACKAGE}/changelog.Debian | |
2354a8bb | 105 | echo "git clone git://git.proxmox.com/git/qemu-server.git\\ngit checkout ${GITVERSION}" > build/${DOCDIR}/${PACKAGE}/SOURCE |
81425ee8 DM |
106 | dpkg-deb --build build |
107 | mv build.deb ${DEB} | |
485e8e1d | 108 | lintian ${DEB} |
1e3baf05 DM |
109 | |
110 | .PHONY: upload | |
dae9b620 | 111 | upload: ${DEB} |
0622ddfb | 112 | tar cf - ${DEB} | ssh repoman@repo.proxmox.com upload |
1e3baf05 DM |
113 | |
114 | .PHONY: clean | |
115 | clean: | |
f625f7f6 | 116 | make cleanup-docgen |
b6329a72 | 117 | rm -rf build *.deb control vzsyscalls.ph _h2ph_pre.ph ${PACKAGE}-*.tar.gz dist *.1 *.5 *.pod vmtar sparsecp *.tmp *.bash-completion |
1e3baf05 DM |
118 | find . -name '*~' -exec rm {} ';' |
119 | ||
120 | ||
121 | .PHONY: distclean | |
122 | distclean: clean |