Script to create the rt-tests rpm
[kvmfornfv.git] / ci / envs / create-rt-tests-rpm.sh
1 #!/bin/bash
2 ##############################################################################
3 ## Copyright (c) 2015 Intel Corp.
4 ##
5 ## All rights reserved. This program and the accompanying materials
6 ## are made available under the terms of the Apache License, Version 2.0
7 ## which accompanies this distribution, and is available at
8 ## http://www.apache.org/licenses/LICENSE-2.0
9 ###############################################################################
10
11 usage ()
12 {
13         echo "$0 rpmdir"
14         exit 1
15 }
16
17 rpmdir=$1
18 rm -rf ${rpmdir}/rt-tests-0.96-1.el7.centos.x86_64.rpm
19 gitdir=`mktemp -d`
20 ROOTDIR=$(cd $(dirname "$0")/../.. && pwd)
21 VERSION=v0.96
22 cd $gitdir
23 git clone https://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git
24 cd rt-tests
25 git checkout -b ${VERSION} ${VERSION}
26 patch -p1  -i ${ROOTDIR}/ci/envs/rt-tests.patch
27 make HAVE_PARSE_CPUSTRING_ALL=1 rpm
28 cp ./RPMS/x86_64/rt-tests-0.96-1.el7.centos.x86_64.rpm $rpmdir
29 rm -rf $gitdir
30