]>
Commit | Line | Data |
---|---|---|
51e85ba1 TL |
1 | include /usr/share/dpkg/pkg-info.mk |
2 | include /usr/share/dpkg/architecture.mk | |
3 | ||
1e3baf05 | 4 | PACKAGE=qemu-server |
1e3baf05 DM |
5 | |
6 | DESTDIR= | |
7 | PREFIX=/usr | |
8 | BINDIR=${PREFIX}/bin | |
9 | SBINDIR=${PREFIX}/sbin | |
1e3baf05 DM |
10 | LIBDIR=${PREFIX}/lib/${PACKAGE} |
11 | VARLIBDIR=/var/lib/${PACKAGE} | |
12 | MANDIR=${PREFIX}/share/man | |
13 | DOCDIR=${PREFIX}/share/doc | |
1e3baf05 | 14 | MAN1DIR=${MANDIR}/man1/ |
358297e0 | 15 | MAN5DIR=${MANDIR}/man5/ |
4c17b2e3 | 16 | MAN8DIR=${MANDIR}/man8/ |
f3e76e36 | 17 | BASHCOMPLDIR=${PREFIX}/share/bash-completion/completions/ |
efcd6784 | 18 | ZSHCOMPLDIR=${PREFIX}/share/zsh/vendor-completions/ |
1e3baf05 DM |
19 | export PERLDIR=${PREFIX}/share/perl5 |
20 | PERLINCDIR=${PERLDIR}/asm-x86_64 | |
21 | ||
b20c8f7e | 22 | GITVERSION:=$(shell git rev-parse HEAD) |
2354a8bb | 23 | |
51e85ba1 TL |
24 | DEB=${PACKAGE}_${DEB_VERSION_UPSTREAM_REVISION}_${DEB_BUILD_ARCH}.deb |
25 | DBG_DEB=${PACKAGE}-dbgsym_${DEB_VERSION_UPSTREAM_REVISION}_${DEB_BUILD_ARCH}.deb | |
303c67ba TL |
26 | |
27 | DEBS=${DEB} ${DBG_DEB} | |
1e3baf05 | 28 | |
f625f7f6 DM |
29 | # this requires package pve-doc-generator |
30 | export NOVIEW=1 | |
31 | include /usr/share/pve-doc-generator/pve-doc-generator.mk | |
32 | ||
88c9e280 | 33 | all: |
1e3baf05 DM |
34 | |
35 | .PHONY: dinstall | |
36 | dinstall: deb | |
37 | dpkg -i ${DEB} | |
38 | ||
f3e76e36 | 39 | qm.bash-completion: |
3227a101 | 40 | PVE_GENERATING_DOCS=1 perl -I. -T -e "use PVE::CLI::qm; PVE::CLI::qm->generate_bash_completions();" >$@.tmp |
f3e76e36 | 41 | mv $@.tmp $@ |
1e3baf05 | 42 | |
cc7b93ec | 43 | qmrestore.bash-completion: |
3227a101 | 44 | PVE_GENERATING_DOCS=1 perl -I. -T -e "use PVE::CLI::qmrestore; PVE::CLI::qmrestore->generate_bash_completions();" >$@.tmp |
cc7b93ec | 45 | mv $@.tmp $@ |
3e16d5fc | 46 | |
efcd6784 CE |
47 | qm.zsh-completion: |
48 | PVE_GENERATING_DOCS=1 perl -I. -T -e "use PVE::CLI::qm; PVE::CLI::qm->generate_zsh_completions();" >$@.tmp | |
49 | mv $@.tmp $@ | |
50 | ||
51 | qmrestore.zsh-completion: | |
52 | PVE_GENERATING_DOCS=1 perl -I. -T -e "use PVE::CLI::qmrestore; PVE::CLI::qmrestore->generate_zsh_completions();" >$@.tmp | |
53 | mv $@.tmp $@ | |
54 | ||
55 | PKGSOURCES=qm qm.1 qmrestore qmrestore.1 qmextract qm.conf.5 qm.bash-completion qmrestore.bash-completion \ | |
8752e5a3 | 56 | qm.zsh-completion qmrestore.zsh-completion |
1e3baf05 DM |
57 | |
58 | .PHONY: install | |
59 | install: ${PKGSOURCES} | |
60 | install -d ${DESTDIR}/${SBINDIR} | |
1e3baf05 DM |
61 | install -d ${DESTDIR}${LIBDIR} |
62 | install -d ${DESTDIR}${VARLIBDIR} | |
358297e0 DM |
63 | install -d ${DESTDIR}/${MAN1DIR} |
64 | install -d ${DESTDIR}/${MAN5DIR} | |
4c17b2e3 | 65 | install -d ${DESTDIR}/${MAN8DIR} |
1e3baf05 DM |
66 | install -d ${DESTDIR}/usr/share/man/man5 |
67 | install -d ${DESTDIR}/usr/share/${PACKAGE} | |
f3e76e36 | 68 | install -m 0644 -D qm.bash-completion ${DESTDIR}/${BASHCOMPLDIR}/qm |
cc7b93ec | 69 | install -m 0644 -D qmrestore.bash-completion ${DESTDIR}/${BASHCOMPLDIR}/qmrestore |
efcd6784 CE |
70 | install -m 0644 -D qm.zsh-completion ${DESTDIR}/${ZSHCOMPLDIR}/_qm |
71 | install -m 0644 -D qmrestore.zsh-completion ${DESTDIR}/${ZSHCOMPLDIR}/_qmrestore | |
dbea4415 | 72 | install -m 0644 -D bootsplash.jpg ${DESTDIR}/usr/share/${PACKAGE} |
64e7017e | 73 | $(MAKE) -C PVE install |
8752e5a3 | 74 | $(MAKE) -C qmeventd install |
30680751 | 75 | $(MAKE) -C qemu-configs install |
1e3baf05 | 76 | install -m 0755 qm ${DESTDIR}${SBINDIR} |
1e3baf05 | 77 | install -m 0755 qmrestore ${DESTDIR}${SBINDIR} |
1e3baf05 | 78 | install -m 0755 pve-bridge ${DESTDIR}${VARLIBDIR}/pve-bridge |
208ba94e | 79 | install -m 0755 pve-bridge-hotplug ${DESTDIR}${VARLIBDIR}/pve-bridge-hotplug |
011c5817 | 80 | install -m 0755 pve-bridgedown ${DESTDIR}${VARLIBDIR}/pve-bridgedown |
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 | 83 | install -m 0644 qm.1 ${DESTDIR}/${MAN1DIR} |
358297e0 | 84 | install -m 0644 qmrestore.1 ${DESTDIR}/${MAN1DIR} |
358297e0 | 85 | install -m 0644 qm.conf.5 ${DESTDIR}/${MAN5DIR} |
9d699c49 | 86 | cd ${DESTDIR}/${MAN5DIR}; ln -s -f qm.conf.5.gz vm.conf.5.gz |
1e3baf05 | 87 | |
ffc0bacf | 88 | .PHONY: deb |
303c67ba TL |
89 | deb: ${DEBS} |
90 | ${DBG_DEB}: ${DEB} | |
88c9e280 | 91 | ${DEB}: |
81425ee8 | 92 | rm -rf build |
88c9e280 | 93 | rsync -a * build |
88c9e280 | 94 | echo "git clone git://git.proxmox.com/git/qemu-server.git\\ngit checkout ${GITVERSION}" > build/debian/SOURCE |
a183ab0d | 95 | cd build; dpkg-buildpackage -b -us -uc |
303c67ba | 96 | lintian ${DEBS} |
1e3baf05 | 97 | |
88c9e280 TL |
98 | .PHONY: test |
99 | test: | |
100 | PVE_GENERATING_DOCS=1 perl -I. ./qm verifyapi | |
64e7017e | 101 | $(MAKE) -C test |
35c78505 | 102 | |
1e3baf05 | 103 | .PHONY: upload |
dae9b620 | 104 | upload: ${DEB} |
6801213d | 105 | tar cf - ${DEBS} | ssh repoman@repo.proxmox.com upload --product pve --dist buster |
1e3baf05 DM |
106 | |
107 | .PHONY: clean | |
88c9e280 | 108 | clean: |
64e7017e | 109 | $(MAKE) cleanup-docgen |
8752e5a3 | 110 | rm -rf build *.deb *.buildinfo *.changes |
1e3baf05 DM |
111 | find . -name '*~' -exec rm {} ';' |
112 | ||
113 | ||
114 | .PHONY: distclean | |
115 | distclean: clean |