5 debbuild_dir=$workspace/debbuild
6 scripts_dir=ci/build_deb
8 VERSION=`grep -m 1 "VERSION" ${qemu_src_dir}/config-host.mak | cut -d= -f2-`
11 echo "usage: ${0} output_dir"
15 if [[ -z "$@" ]]; then
19 if [ ! -d ${output_dir} -o ! -w ${output_dir} ] ; then
20 echo "${0}: Output directory '${output_dir}' does not exist or cannot \
25 if [ ! -d ${qemu_src_dir} ] ; then
26 echo "${0}: Directory '${qemu_src_dir}' does not exist, run this script \
27 from the root of kvmfornfv source tree"
36 mkdir -p $debbuild_dir/qemu-$VERSION
37 cp -r $qemu_src_dir $debbuild_dir/qemu-$VERSION
38 mkdir -p $debbuild_dir/qemu-$VERSION/DEBIAN
41 #creating control file for debian build.
42 (cd ${scripts_dir}; ./mkcontrol.sh $VERSION > control)
43 mv $scripts_dir/control $debbuild_dir/qemu-$VERSION/DEBIAN/control
45 #building the qemu debian with control file developed.
46 dpkg-deb --build $debbuild_dir/qemu-$VERSION
47 if [ ${?} -ne 0 ] ; then
48 echo "${0}: qemu build failed"
53 if [ ! -d ${debbuild_dir} ] ; then
54 echo "creating debbuild directory"
55 mkdir -p $debbuild_dir
59 latest_qemu_build=`ls -rt $debbuild_dir | tail -1`
60 cp $debbuild_dir/$latest_qemu_build build_output