forked from intel/virtual-storage-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvsm
executable file
·40 lines (31 loc) · 1005 Bytes
/
vsm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
function _change_vsm_files() {
echo "" > $TEMP/$VSM_DIR/vsm.egg-info/requires.txt
echo "" > $TEMP/$VSM_DIR/tools/pip-requires
echo "" > $TEMP/$VSM_DIR/tools/test-requires
}
function _install_vsm_dep_package() {
sudo yum install -y `cat $1 | grep BuildRequires | awk '{print $2}' | tr "\n" " "`
sudo yum install -y rpm-build
}
function _setup_vsm_rpm() {
rm -rf $TEMP/*
local old_dir=`pwd`
local version=`cat VERSION`
cp -rf $TOPDIR/$SOURCE_DIR/$VSM_DIR $TEMP/
cd $TEMP/
_change_vsm_files
if [[ $VSM_DIR != vsm-$version ]]; then
mv $VSM_DIR vsm-$version
fi
[[ -e vsm-$version/build ]] && rm -rf vsm-$version/build
tar zcf vsm-${version}.tar.gz vsm-$version
cp -rf vsm-${version}.tar.gz ~/rpmbuild/SOURCES/
cp -rf vsm-$version/vsm.spec ~/rpmbuild/SPECS/
_install_vsm_dep_package vsm-$version/vsm.spec
cd ~/rpmbuild/SPECS/
rpmbuild -bb vsm.spec
cd $old_dir
}
function build_vsm_rpm() {
_setup_vsm_rpm
}