forked from abbbi/virtnbdbackup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate.sh
executable file
·35 lines (32 loc) · 912 Bytes
/
create.sh
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
#!/bin/bash
# setup virtnbdbackup within virtualenv including
# required libnbd bindings.
VENVDIR=$(pwd)/virtnbdbackup-venv
LIBNBD_MAJ="1.12-stable"
LIBNBD_VERSION="libnbd-1.12.6"
set -e
BRANCH="master"
if [ ! -z $1 ]; then
BRANCH="$1"
fi
rm -rf virtnbdbackup
rm -rf ${VENVDIR}
rm -rf ${LIBNBD_VERSION}
rm -rf libnbd-*
virtualenv -p $(which python3) ${VENVDIR}
git clone https://github.com/abbbi/virtnbdbackup.git -b ${BRANCH}
source ${VENVDIR}/bin/activate
curl https://download.libguestfs.org/libnbd/${LIBNBD_MAJ}/${LIBNBD_VERSION}.tar.gz > ${LIBNBD_VERSION}.tar.gz
tar xzf ${LIBNBD_VERSION}.tar.gz
cd ${LIBNBD_VERSION}
export bashcompdir=/tmp
./configure --prefix=${VENVDIR} --exec-prefix=${VENVDIR} \
--disable-ocaml \
--disable-golang \
--disable-fuse
make -j $(nproc)
make install
cd ..
python -m pip install -r virtnbdbackup/requirements.txt
cd virtnbdbackup/
python setup.py install