3 source ./ci/qemuConfigValidate.sh
4 rpmbuild_dir=$workspace/rpmbuild
5 artifact_rpms=$rpmbuild_dir/RPMS
6 artifact_dir=$artifact_rpms/x86_64
7 debbuild_dir=$workspace/debbuild
12 scripts_dir=ci/build_rpm
13 cp -r ${qemu_src_dir} ${qemu_src_dir}-$VERSION
14 tar -zcvf ${qemu_src_dir}-$VERSION.tar.gz ${qemu_src_dir}-$VERSION
15 mv ${qemu_src_dir}-$VERSION.tar.gz ${rpmbuild_dir}/SOURCES/
17 #create a spec file for rpm creation.
18 (cd ${scripts_dir}; ./mkspec $VERSION > qemu.spec)
19 cp ${scripts_dir}/qemu.spec ${rpmbuild_dir}/SPECS/
21 #build the qemu rpm with spec file developed
22 rpmbuild -ba ${rpmbuild_dir}/SPECS/qemu.spec
23 if [ ${?} -ne 0 ] ; then
24 echo "${0}: qemu build failed"
27 rm -rf ${qemu_src_dir}-$VERSION
28 rm -rf ${rpmbuild_dir}/SOURCES/${qemu_src_dir}-$VERSION.tar.gz
32 scripts_dir=ci/build_deb
33 mkdir -p $debbuild_dir/qemu-$VERSION
34 cp -r $qemu_src_dir $debbuild_dir/qemu-$VERSION
35 mkdir -p $debbuild_dir/qemu-$VERSION/DEBIAN
38 #creating control file for debian build.
39 (cd ${scripts_dir}; ./mkcontrol.sh $VERSION > control)
40 mv $scripts_dir/control $debbuild_dir/qemu-$VERSION/DEBIAN/control
42 #building the qemu debian with control file developed.
43 dpkg-deb --build $debbuild_dir/qemu-$VERSION
44 if [ ${?} -ne 0 ] ; then
45 echo "${0}: qemu build failed"
50 if [ $pkgtype == "centos" ];then
51 if [ ! -d ${rpmbuild_dir} ] ; then
52 mkdir -p ${rpmbuild_dir}/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
55 latest_qemu_build=`ls -rt $artifact_dir | grep qemu-2.6* | tail -1`
56 cp $artifact_dir/$latest_qemu_build ${output_dir}
57 elif [ $pkgtype == "ubuntu" ];then
58 if [ ! -d ${debbuild_dir} ] ; then
59 echo "creating debbuild directory"
60 mkdir -p $debbuild_dir
63 latest_qemu_build=`ls -rt $debbuild_dir | tail -1`
64 cp $debbuild_dir/$latest_qemu_build build_output