summaryrefslogtreecommitdiffstats
path: root/satellit_installer/includes/50-install_dnbd3-server.inc
blob: 2b8e8faa4b0c5a8fde957f9c93d5a9be0f77780c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
install_dnbd3-server() {
	# $1: directory to install dnbd3-server to
	echo "# Installing dnbd3 server... "
	mkdir -p "$1" || perror "mkdir '$1' failed"
	# Build server
	mkdir -p "$BASEDIR/tmp"
	git clone https://git.openslx.org/dnbd3.git "$BASEDIR/tmp/dnbd3" || perror "Could not clone dnbd3"
	mkdir "$BASEDIR/tmp/dnbd3/build"
	cd "$BASEDIR/tmp/dnbd3/build" || perror "Build dir == where?"
	cmake -DDNBD3_CLIENT_FUSE=OFF -DDNBD3_KERNEL_MODULE=OFF -DDNBD3_SERVER=ON -DCMAKE_BUILD_TYPE=Release .. || perror "cmake failed"
	make dnbd3-server || perror "Building dnbd3-server failed"
	cp src/server/dnbd3-server "$1/" || perror "Could not copy dnbd3-server binary to $1"
	cd - &>/dev/null

	# Install static files
	install_files "dnbd3"
	echo "# dnbd3-server ok."
}