aboutsummaryrefslogtreecommitdiffstats
path: root/build/ci/cirrus_ci.sh
blob: 9db762f97cca7e1aa4a20b85eba9a96c5427d062 (plain) (blame)
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
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/sh
UNAME=`uname`
if [ "$1" = "install" ]
then
	if [ "${UNAME}" = "FreeBSD" ]
	then
		set -x -e
		sed -i.bak -e 's,pkg+http://pkg.FreeBSD.org/\${ABI}/quarterly,pkg+http://pkg.FreeBSD.org/\${ABI}/latest,' /etc/pkg/FreeBSD.conf
		mount -u -o acls /
		mkdir /tmp_acl_nfsv4
		MD=`mdconfig -a -t swap -s 128M`
		newfs /dev/$MD
		tunefs -N enable /dev/$MD
		mount /dev/$MD /tmp_acl_nfsv4
		chmod 1777 /tmp_acl_nfsv4
		pkg install -y autoconf automake cmake libiconv libtool pkgconf expat libxml2 liblz4 zstd
	elif [ "${UNAME}" = "Darwin" ]
	then
		set -x -e
		brew update
		brew install autoconf automake libtool pkg-config cmake xz lz4 zstd
	elif [ "${UNAME}" = "Linux" ]
	then
		if [ -f "/etc/debian_version" ]
		then
			apt-get -y update
			apt-get -y install build-essential locales automake libtool bison sharutils pkgconf libacl1-dev libbz2-dev libzip-dev zlib1g-dev liblzma-dev liblz4-dev libzstd-dev libssl-dev lrzip cmake
		elif [ -f "/etc/fedora-release" ]
		then
			dnf -y install make cmake gcc gcc-c++ kernel-devel automake libtool bison sharutils pkgconf libacl-devel librichacl-devel bzip2-devel libzip-devel zlib-devel xz-devel lz4-devel libzstd-devel openssl-devel
		fi
	fi
elif [ "$1" = "test" ]
then
	if [ "${UNAME}" = "FreeBSD" ]
	then
		set -e
		echo "Additional NFSv4 ACL tests"
		CURDIR=`pwd`
		if [ "${BS}" = "cmake" ]
		then
			BIN_SUBDIR="bin"
		else
			BIN_SUBDIR=.
		fi
		BUILDDIR="${CURDIR}/build_ci/${BS}"
		cd "$BUILDDIR"
		TMPDIR=/tmp_acl_nfsv4 ${BIN_SUBDIR}/libarchive_test -r "${CURDIR}/libarchive/test" -v test_acl_platform_nfs4
	fi
else
	echo "Usage $0 install | test_nfsv4_acls"
	exit 1
fi