summaryrefslogtreecommitdiff
path: root/build/ci/cirrus_ci/ci.sh
blob: c07ebfe97beaec62f57f37b69143f9fbc679116a (plain)
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
54
55
56
#!/bin/sh
UNAME=`uname`
if [ "$1" = "prepare" ]
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 > /dev/null
		for pkg in autoconf automake libtool pkg-config cmake xz lz4 zstd
		do
			brew list $pkg > /dev/null && brew upgrade $pkg || brew install $pkg
		done
	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 prepare | test_nfsv4_acls"
	exit 1
fi