forked from intel/virtual-storage-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vsmclient
executable file
·39 lines (31 loc) · 1.22 KB
/
vsmclient
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
function _change_vsmclient_files() {
echo "" > $TEMP/$VSMCLIENT_DIR/python_vsmclient.egg-info/requires.txt
echo "" > $TEMP/$VSMCLIENT_DIR/tools/pip-requires
echo "" > $TEMP/$VSMCLIENT_DIR/tools/test-requires
}
function _install_vsmclient_dep_package() {
sudo yum install -y `cat $1 | grep BuildRequires | awk '{print $2}' | tr "\n" " "`
sudo yum install -y rpm-build
}
function _setup_vsmclient_rpm() {
rm -rf $TEMP/*
local old_dir=`pwd`
local version=`cat VERSION`
cp -rf $TOPDIR/$SOURCE_DIR/$VSMCLIENT_DIR $TEMP/
cd $TEMP/
_change_vsmclient_files
if [[ $VSMCLIENT_DIR != python-vsmclient-$version ]]; then
mv $VSMCLIENT_DIR python-vsmclient-$version
fi
[[ -e python-vsmclient-$version/build ]] && rm -rf python-vsmclient-$version/build
tar zcf python-vsmclient-${version}.tar.gz python-vsmclient-$version
cp -rf python-vsmclient-${version}.tar.gz ~/rpmbuild/SOURCES/
cp -rf python-vsmclient-$version/python-vsmclient.spec ~/rpmbuild/SPECS/
_install_vsmclient_dep_package python-vsmclient-$version/python-vsmclient.spec
cd ~/rpmbuild/SPECS/
rpmbuild -bb python-vsmclient.spec
cd $old_dir
}
function build_vsmclient_rpm() {
_setup_vsmclient_rpm
}