diff options
author | 2016-07-22 17:19:19 +0000 | |
---|---|---|
committer | 2016-07-22 17:19:19 +0000 | |
commit | d1db94c2f5f41d450094b67459a2821154e063bc (patch) | |
tree | eeba6a251cb0d28ad0920af75673a95c35ba4996 /ci/build_qemu_rpm_deb/qemu_rpm_build.sh | |
parent | d2c75f97c709800d8263d15512f566a38b1e3e87 (diff) | |
parent | 853d63d099ec2f098f1f36350ec0c5095c3f4fd1 (diff) |
Merge "Creation of QEMU(rpm and debian builds)"
Diffstat (limited to 'ci/build_qemu_rpm_deb/qemu_rpm_build.sh')
-rwxr-xr-x | ci/build_qemu_rpm_deb/qemu_rpm_build.sh | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/ci/build_qemu_rpm_deb/qemu_rpm_build.sh b/ci/build_qemu_rpm_deb/qemu_rpm_build.sh new file mode 100755 index 000000000..a52ee0f4a --- /dev/null +++ b/ci/build_qemu_rpm_deb/qemu_rpm_build.sh @@ -0,0 +1,32 @@ +#!/bin/bash +#Build process for Generating qemu rpm. + +source ci/build_qemu_rpm_deb/qemu_build.sh +qemu_rpm_build() { + sudo cp -r ${qemu_src_dir} ${qemu_src_dir}-$VERSION + sudo tar -zcvf ${qemu_src_dir}-$VERSION.tar.gz ${qemu_src_dir}-$VERSION + sudo mv ${qemu_src_dir}-$VERSION.tar.gz ${rpmbuild_dir}/SOURCES/ + +#create a spec file for rpm creation. + (cd ${scripts_dir}; ./mkspec $VERSION > qemu.spec) + sudo cp ${scripts_dir}/qemu.spec ${rpmbuild_dir}/SPECS/ + +#build the qemu rpm with spec file developed + sudo rpmbuild -ba ${rpmbuild_dir}/SPECS/qemu.spec + if [ ${?} -ne 0 ] ; then + echo "${0}: qemu build failed" + exit 1 + fi + sudo rm -rf ${qemu_src_dir}-$VERSION + sudo rm -rf ${rpmbuild_dir}/SOURCES/${qemu_src_dir}-$VERSION.tar.gz +} + +if [ ! -d ${rpmbuild_dir} ] ; then + sudo yum install rpm-build -y + mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS} + sudo mv rpmbuild $workspace +fi + +qemu_rpm_build +latest_qemu_build=`ls -rt $artifact_dir | grep qemu-2.6* | tail -1` +sudo cp $artifact_dir/$latest_qemu_build build_output |