2 # Copyright 2017 Intel Corporation
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
17 source $DIR/package-list.sh
21 bash $DIR/check_git_repo.sh $CMTCAT_DIR $CMTCAT_REPO
25 git clone --branch $CMTCAT_BRANCH $CMTCAT_REPO $CMTCAT_DIR
30 git checkout -f $CMTCAT_BRANCH
37 wget https://github.com/01org/intel-cmt-cat/archive/${VERSION}.tar.gz --directory-prefix=$CMTCAT_DIR
39 mv $CMTCAT_DIR/${VERSION}.tar.gz $RPM_WORKDIR/SOURCES/
41 rpmbuild --define "_topdir $RPM_WORKDIR" -bb $CMTCAT_DIR/rpm/intel-cmt-cat.spec
46 echo "*** intel-cmt-cat is already installed"
48 RPM_NAME=`ls -1 $RPM_DIR | grep -E "cmt-cat-[0-9]"`
49 rpm -ivf $RPM_DIR/$RPM_NAME