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