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