2016-04-29 10:03:38 +03:00
RELEASE = 4.2
2011-08-23 09:47:04 +04:00
2015-02-27 15:01:18 +03:00
VERSION = 4.0
2011-08-23 09:47:04 +04:00
PACKAGE = qemu-server
2016-06-22 12:33:13 +03:00
PKGREL = 83
2011-08-23 09:47:04 +04:00
2015-02-27 18:01:51 +03:00
CFLAGS = -O2 -Werror -Wall -Wtype-limits -Wl,-z,relro
2011-08-23 09:47:04 +04:00
DESTDIR =
PREFIX = /usr
BINDIR = ${ PREFIX } /bin
SBINDIR = ${ PREFIX } /sbin
BINDIR = ${ PREFIX } /bin
LIBDIR = ${ PREFIX } /lib/${ PACKAGE }
VARLIBDIR = /var/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/
2011-08-23 09:47:04 +04:00
export PERLDIR = ${ PREFIX } /share/perl5
PERLINCDIR = ${ PERLDIR } /asm-x86_64
ARCH := $( shell dpkg-architecture -qDEB_BUILD_ARCH)
2013-09-05 15:05:47 +04:00
GITVERSION := $( shell cat .git/refs/heads/master)
2011-08-23 09:47:04 +04:00
DEB = ${ PACKAGE } _${ VERSION } -${ PKGREL } _${ ARCH } .deb
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
2011-08-23 09:47:04 +04:00
all : ${DEB }
.PHONY : dinstall
dinstall : deb
dpkg -i ${ DEB }
control : control .in
sed -e s/@@VERSION@@/${ VERSION } / -e s/@@PKGRELEASE@@/${ PKGREL } / -e s/@@ARCH@@/${ ARCH } /<$< >$@
vzsyscalls.ph : vzsyscalls .h
h2ph -d . vzsyscalls.h
vmtar : vmtar .c utils .c
2015-02-27 18:01:51 +03:00
gcc ${ CFLAGS } -o vmtar vmtar.c
2011-08-23 09:47:04 +04:00
sparsecp : sparsecp .c utils .c
2015-02-27 18:01:51 +03:00
gcc ${ CFLAGS } -o sparsecp sparsecp.c
2011-08-23 09:47:04 +04:00
2015-09-06 16:44:53 +03:00
qm.bash-completion :
perl -I. -T -e "use PVE::CLI::qm; PVE::CLI::qm->generate_bash_completions();" >$@ .tmp
mv $@ .tmp $@
2011-08-23 09:47:04 +04:00
2015-10-05 14:10:24 +03:00
qmrestore.bash-completion :
perl -I. -T -e "use PVE::CLI::qmrestore; PVE::CLI::qmrestore->generate_bash_completions();" >$@ .tmp
mv $@ .tmp $@
2011-10-17 15:49:48 +04:00
2016-04-09 11:04:51 +03:00
PKGSOURCES = qm qm.1 qmrestore qmrestore.1 qmextract sparsecp vmtar control qm.conf.5 qm.bash-completion qmrestore.bash-completion
2011-08-23 09:47:04 +04:00
.PHONY : install
install : ${PKGSOURCES }
install -d ${ DESTDIR } /${ SBINDIR }
install -d ${ DESTDIR } ${ LIBDIR }
install -d ${ DESTDIR } ${ VARLIBDIR }
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/man/man5
install -d ${ DESTDIR } /usr/share/${ PACKAGE }
install -m 0644 pve-usb.cfg ${ DESTDIR } /usr/share/${ PACKAGE }
2014-05-26 11:49:56 +04:00
install -m 0644 pve-q35.cfg ${ 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
2011-08-23 09:47:04 +04:00
make -C PVE install
install -m 0755 qm ${ DESTDIR } ${ SBINDIR }
install -m 0755 qmrestore ${ DESTDIR } ${ SBINDIR }
install -m 0755 pve-bridge ${ DESTDIR } ${ VARLIBDIR } /pve-bridge
2015-11-06 17:05:59 +03:00
install -m 0755 pve-bridge-hotplug ${ DESTDIR } ${ VARLIBDIR } /pve-bridge-hotplug
2014-05-07 12:42:43 +04:00
install -m 0755 pve-bridgedown ${ DESTDIR } ${ VARLIBDIR } /pve-bridgedown
2011-08-23 09:47:04 +04:00
install -s -m 0755 vmtar ${ DESTDIR } ${ LIBDIR }
install -s -m 0755 sparsecp ${ DESTDIR } ${ LIBDIR }
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 }
gzip -9 ${ DESTDIR } /${ MAN1DIR } /qm.1
install -m 0644 qmrestore.1 ${ DESTDIR } /${ MAN1DIR }
gzip -9 ${ DESTDIR } /${ MAN1DIR } /qmrestore.1
install -m 0644 qm.conf.5 ${ DESTDIR } /${ MAN5DIR }
gzip -9 ${ DESTDIR } /${ MAN5DIR } /qm.conf.5
2016-04-09 11:13:46 +03:00
cd ${ DESTDIR } /${ MAN5DIR } ; ln -s qm.conf.5.gz vm.conf.5.gz
2011-08-23 09:47:04 +04:00
.PHONY : deb ${DEB }
deb ${DEB} : ${PKGSOURCES }
2011-08-24 13:08:33 +04:00
rm -rf build
mkdir build
make DESTDIR = ${ CURDIR } /build install
2011-08-23 09:47:04 +04:00
perl -I. ./qm verifyapi
2011-08-24 13:08:33 +04:00
install -d -m 0755 build/DEBIAN
install -m 0644 control build/DEBIAN
2015-05-05 15:57:00 +03:00
install -m 0644 triggers build/DEBIAN
2015-02-27 18:01:51 +03:00
echo "/etc/modules-load.d/qemu-server.conf" >>build/DEBIAN/conffiles
2011-08-24 13:08:33 +04:00
install -D -m 0644 copyright build/${ DOCDIR } /${ PACKAGE } /copyright
install -m 0644 changelog.Debian build/${ DOCDIR } /${ PACKAGE } /
gzip -9 build/${ DOCDIR } /${ PACKAGE } /changelog.Debian
2013-09-05 15:05:47 +04:00
echo " git clone git://git.proxmox.com/git/qemu-server.git\\ngit checkout ${ GITVERSION } " > build/${ DOCDIR } /${ PACKAGE } /SOURCE
2011-08-24 13:08:33 +04:00
dpkg-deb --build build
mv build.deb ${ DEB }
2011-08-30 17:11:02 +04:00
lintian ${ DEB }
2011-08-23 09:47:04 +04:00
.PHONY : upload
upload :
umount /pve/${ RELEASE } ; mount /pve/${ RELEASE } -o rw
mkdir -p /pve/${ RELEASE } /extra
rm -rf /pve/${ RELEASE } /extra/${ PACKAGE } _*.deb
rm -rf /pve/${ RELEASE } /extra/Packages*
cp ${ DEB } /pve/${ RELEASE } /extra
cd /pve/${ RELEASE } /extra; dpkg-scanpackages . /dev/null > Packages; gzip -9c Packages > Packages.gz
umount /pve/${ RELEASE } ; mount /pve/${ RELEASE } -o ro
.PHONY : clean
clean :
2016-04-08 08:36:29 +03:00
make cleanup-docgen
2016-04-09 11:04:51 +03:00
rm -rf build *.deb control vzsyscalls.ph _h2ph_pre.ph ${ PACKAGE } -*.tar.gz dist *.1 *.5 *.pod vmtar sparsecp *.tmp *.bash-completion
2011-08-23 09:47:04 +04:00
find . -name '*~' -exec rm { } ';'
.PHONY : distclean
distclean : clean