Commit 2fc1ed76 authored by Maciej Wawryk's avatar Maciej Wawryk Committed by Tomasz Zawadzki
Browse files

scripts/pkgdep.sh: Add flag for FUSE and NVMe-CUSE dependencies

parent f035937d
Loading
Loading
Loading
Loading
+27 −14
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@ function usage()
	echo "  -a --all"
	echo "  -d --developer-tools        Install tools for developers (code styling, code coverage, etc.)"
	echo "  -p --pmem                   Additional dependencies for reduce and pmdk"
	echo "  -f --fuse                   Additional dependencies for FUSE and NVMe-CUSE"
	echo ""
	exit 0
}
@@ -22,13 +23,15 @@ function install_all_dependencies ()
{
	INSTALL_DEV_TOOLS=true
	INSTALL_PMEM=true
	INSTALL_FUSE=true
}

INSTALL_CRYPTO=false
INSTALL_DEV_TOOLS=false
INSTALL_PMEM=false
INSTALL_FUSE=false

while getopts 'adhip-:' optchar; do
while getopts 'adfhip-:' optchar; do
	case "$optchar" in
		-)
		case "$OPTARG" in
@@ -36,6 +39,7 @@ while getopts 'adhip-:' optchar; do
			all) install_all_dependencies;;
			developer-tools) INSTALL_DEV_TOOLS=true;;
			pmem) INSTALL_PMEM=true;;
			fuse) INSTALL_FUSE=true;;
			*) echo "Invalid argument '$OPTARG'"
			usage;;
		esac
@@ -44,6 +48,7 @@ while getopts 'adhip-:' optchar; do
	a) install_all_dependencies;;
	d) INSTALL_DEV_TOOLS=true;;
	p) INSTALL_PMEM=true;;
	f) INSTALL_FUSE=true;;
	*) echo "Invalid argument '$OPTARG'"
	usage;;
	esac
@@ -91,12 +96,14 @@ if [ -s /etc/redhat-release ]; then
		# Additional dependencies for building pmem based backends
		yum install -y libpmemblk-devel || true
	fi
	if [[ $INSTALL_FUSE == "true" ]]; then
		# Additional dependencies for FUSE and NVMe-CUSE
		yum install -y fuse3-devel
	fi
	# Additional dependencies for NVMe over Fabrics
	yum install -y libibverbs-devel librdmacm-devel
	# Additional dependencies for building docs
	yum install -y doxygen mscgen graphviz
	# Additional dependencies for FUSE and CUSE
	yum install -y fuse3-devel
elif [ -f /etc/debian_version ]; then
	. /etc/os-release
	VERSION_ID_NUM=$(sed 's/\.//g' <<< $VERSION_ID)
@@ -134,17 +141,19 @@ elif [ -f /etc/debian_version ]; then
			apt-get install -y libpmem-dev
		fi
	fi
	# Additional dependencies for NVMe over Fabrics
	apt-get install -y libibverbs-dev librdmacm-dev
	# Additional dependencies for building docs
	apt-get install -y doxygen mscgen graphviz
	# Additional dependencies for FUSE and CUSE
	if [[ $INSTALL_FUSE == "true" ]]; then
		# Additional dependencies for FUSE and NVMe-CUSE
		if [[ $NAME == "Ubuntu" ]] && (( VERSION_ID_NUM > 1400 && VERSION_ID_NUM < 1900 )); then
			echo "Ubuntu $VERSION_ID does not have libfuse3-dev in mainline repository."
			echo "You can install it manually"
		else
			apt-get install -y libfuse3-dev
		fi
	fi
	# Additional dependencies for NVMe over Fabrics
	apt-get install -y libibverbs-dev librdmacm-dev
	# Additional dependencies for building docs
	apt-get install -y doxygen mscgen graphviz
elif [ -f /etc/SuSE-release ] || [ -f /etc/SUSE-brand ]; then
	# Minimal install
	zypper install -y gcc gcc-c++ make cunit-devel libaio-devel libopenssl-devel \
@@ -164,12 +173,14 @@ elif [ -f /etc/SuSE-release ] || [ -f /etc/SUSE-brand ]; then
		# Additional dependencies for building pmem based backends
		zypper install -y libpmemblk-devel
	fi
	if [[ $INSTALL_FUSE == "true" ]]; then
		# Additional dependencies for FUSE and NVMe-CUSE
		zypper install -y fuse3-devel
	fi
	# Additional dependencies for NVMe over Fabrics
	zypper install -y rdma-core-devel
	# Additional dependencies for building docs
	zypper install -y doxygen mscgen graphviz
	# Additional dependencies for FUSE and CUSE
	zypper install -y fuse3-devel
elif [ $(uname -s) = "FreeBSD" ] ; then
	# Minimal install
	pkg install -y gmake cunit openssl git bash misc/e2fsprogs-libuuid python
@@ -230,8 +241,6 @@ elif [ -f /etc/arch-release ]; then
	fi
	# Additional dependencies for building docs
	pacman -Sy --needed --noconfirm doxygen graphviz
	# Additional dependencies for FUSE and CUSE
	pacman -Sy --needed --noconfirm fuse3
	# Additional dependency for building docs
	pacman -S --noconfirm --needed gd ttf-font
	su - $SUDO_USER -c "pushd /tmp;
@@ -251,6 +260,10 @@ elif [ -f /etc/arch-release ]; then
		makepkg -si --needed --noconfirm;
		cd .. && rm -rf rdma-core;
		popd"
	if [[ $INSTALL_FUSE == "true" ]]; then
		# Additional dependencies for FUSE and NVMe-CUSE
		pacman -Sy --needed --noconfirm fuse3
	fi
else
	echo "pkgdep: unknown system type."
	exit 1