2019-05-22 18:47:23 +02:00
i n c l u d e / u s r / s h a r e / d p k g / p k g - i n f o . m k
i n c l u d e / u s r / s h a r e / d p k g / a r c h i t e c t u r e . m k
2011-08-23 07:47:04 +02:00
PACKAGE = qemu-server
DESTDIR =
PREFIX = /usr
SBINDIR = ${ PREFIX } /sbin
LIBDIR = ${ PREFIX } /lib/${ PACKAGE }
MANDIR = ${ PREFIX } /share/man
DOCDIR = ${ PREFIX } /share/doc
MAN1DIR = ${ MANDIR } /man1/
2016-04-09 10:11:36 +02:00
MAN5DIR = ${ MANDIR } /man5/
2015-09-06 15:44:53 +02:00
BASHCOMPLDIR = ${ PREFIX } /share/bash-completion/completions/
2019-02-21 14:25:04 +01:00
ZSHCOMPLDIR = ${ PREFIX } /share/zsh/vendor-completions/
2011-08-23 07:47:04 +02:00
export PERLDIR = ${ PREFIX } /share/perl5
PERLINCDIR = ${ PERLDIR } /asm-x86_64
2018-02-27 10:11:51 +01:00
GITVERSION := $( shell git rev-parse HEAD)
2013-09-05 13:05:47 +02:00
2019-05-22 18:47:23 +02:00
DEB = ${ PACKAGE } _${ DEB_VERSION_UPSTREAM_REVISION } _${ DEB_BUILD_ARCH } .deb
DBG_DEB = ${ PACKAGE } -dbgsym_${ DEB_VERSION_UPSTREAM_REVISION } _${ DEB_BUILD_ARCH } .deb
2018-11-19 14:41:14 +01:00
DEBS = ${ DEB } ${ DBG_DEB }
2011-08-23 07:47:04 +02:00
2016-04-08 07:36:29 +02:00
# this requires package pve-doc-generator
export NOVIEW = 1
i n c l u d e / u s r / s h a r e / p v e - d o c - g e n e r a t o r / p v e - d o c - g e n e r a t o r . m k
2017-06-09 18:37:03 +02:00
all :
2011-08-23 07:47:04 +02:00
.PHONY : dinstall
dinstall : deb
dpkg -i ${ DEB }
2015-09-06 15:44:53 +02:00
qm.bash-completion :
2017-02-06 16:12:18 +01:00
PVE_GENERATING_DOCS = 1 perl -I. -T -e "use PVE::CLI::qm; PVE::CLI::qm->generate_bash_completions();" >$@ .tmp
2015-09-06 15:44:53 +02:00
mv $@ .tmp $@
2011-08-23 07:47:04 +02:00
2015-10-05 13:10:24 +02:00
qmrestore.bash-completion :
2017-02-06 16:12:18 +01:00
PVE_GENERATING_DOCS = 1 perl -I. -T -e "use PVE::CLI::qmrestore; PVE::CLI::qmrestore->generate_bash_completions();" >$@ .tmp
2015-10-05 13:10:24 +02:00
mv $@ .tmp $@
2011-10-17 13:49:48 +02:00
2019-02-21 14:25:04 +01:00
qm.zsh-completion :
PVE_GENERATING_DOCS = 1 perl -I. -T -e "use PVE::CLI::qm; PVE::CLI::qm->generate_zsh_completions();" >$@ .tmp
mv $@ .tmp $@
qmrestore.zsh-completion :
PVE_GENERATING_DOCS = 1 perl -I. -T -e "use PVE::CLI::qmrestore; PVE::CLI::qmrestore->generate_zsh_completions();" >$@ .tmp
mv $@ .tmp $@
PKGSOURCES = qm qm.1 qmrestore qmrestore.1 qmextract qm.conf.5 qm.bash-completion qmrestore.bash-completion \
2019-09-24 18:08:48 +02:00
qm.zsh-completion qmrestore.zsh-completion
2011-08-23 07:47:04 +02:00
.PHONY : install
install : ${PKGSOURCES }
install -d ${ DESTDIR } /${ SBINDIR }
install -d ${ DESTDIR } ${ LIBDIR }
2016-04-09 10:11:36 +02:00
install -d ${ DESTDIR } /${ MAN1DIR }
install -d ${ DESTDIR } /${ MAN5DIR }
2011-08-23 07:47:04 +02:00
install -d ${ DESTDIR } /usr/share/${ PACKAGE }
2015-09-06 15:44:53 +02:00
install -m 0644 -D qm.bash-completion ${ DESTDIR } /${ BASHCOMPLDIR } /qm
2015-10-05 13:10:24 +02:00
install -m 0644 -D qmrestore.bash-completion ${ DESTDIR } /${ BASHCOMPLDIR } /qmrestore
2019-02-21 14:25:04 +01:00
install -m 0644 -D qm.zsh-completion ${ DESTDIR } /${ ZSHCOMPLDIR } /_qm
install -m 0644 -D qmrestore.zsh-completion ${ DESTDIR } /${ ZSHCOMPLDIR } /_qmrestore
2016-09-08 09:25:57 +02:00
install -m 0644 -D bootsplash.jpg ${ DESTDIR } /usr/share/${ PACKAGE }
2019-09-24 18:06:16 +02:00
$( MAKE) -C PVE install
2019-09-24 18:08:48 +02:00
$( MAKE) -C qmeventd install
2019-09-24 18:11:22 +02:00
$( MAKE) -C qemu-configs install
2019-09-24 18:12:25 +02:00
$( MAKE) -C vm-network-scripts install
2011-08-23 07:47:04 +02:00
install -m 0755 qm ${ DESTDIR } ${ SBINDIR }
install -m 0755 qmrestore ${ DESTDIR } ${ SBINDIR }
2015-02-27 16:01:51 +01:00
install -D -m 0644 modules-load.conf ${ DESTDIR } /etc/modules-load.d/qemu-server.conf
2011-10-17 13:49:48 +02:00
install -m 0755 qmextract ${ DESTDIR } ${ LIBDIR }
2016-04-09 10:11:36 +02:00
install -m 0644 qm.1 ${ DESTDIR } /${ MAN1DIR }
install -m 0644 qmrestore.1 ${ DESTDIR } /${ MAN1DIR }
install -m 0644 qm.conf.5 ${ DESTDIR } /${ MAN5DIR }
2017-09-13 16:10:21 +02:00
cd ${ DESTDIR } /${ MAN5DIR } ; ln -s -f qm.conf.5.gz vm.conf.5.gz
2011-08-23 07:47:04 +02:00
2016-07-04 08:33:57 +02:00
.PHONY : deb
2018-11-19 14:41:14 +01:00
deb : ${DEBS }
${DBG_DEB} : ${DEB }
2017-06-09 18:37:03 +02:00
${DEB} :
2011-08-24 11:08:33 +02:00
rm -rf build
2017-06-09 18:37:03 +02:00
rsync -a * build
echo " git clone git://git.proxmox.com/git/qemu-server.git\\ngit checkout ${ GITVERSION } " > build/debian/SOURCE
2017-06-12 10:00:25 +02:00
cd build; dpkg-buildpackage -b -us -uc
2018-11-19 14:41:14 +01:00
lintian ${ DEBS }
2011-08-23 07:47:04 +02:00
2017-06-09 18:37:03 +02:00
.PHONY : test
test :
PVE_GENERATING_DOCS = 1 perl -I. ./qm verifyapi
2019-09-24 18:06:16 +02:00
$( MAKE) -C test
2017-05-17 12:40:58 +02:00
2011-08-23 07:47:04 +02:00
.PHONY : upload
2016-06-28 08:20:50 +02:00
upload : ${DEB }
2019-05-27 13:58:01 +02:00
tar cf - ${ DEBS } | ssh repoman@repo.proxmox.com upload --product pve --dist buster
2011-08-23 07:47:04 +02:00
.PHONY : clean
2017-06-09 18:37:03 +02:00
clean :
2019-09-24 18:06:16 +02:00
$( MAKE) cleanup-docgen
2019-09-24 18:08:48 +02:00
rm -rf build *.deb *.buildinfo *.changes
2011-08-23 07:47:04 +02:00
find . -name '*~' -exec rm { } ';'
.PHONY : distclean
distclean : clean