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
|
#!/bin/bash
# Copyright (c) Contributors to the Apptainer project, established as
# Apptainer a Series of LF Projects LLC.
# For website terms of use, trademark policy, privacy policy and other
# project policies see https://lfprojects.org/policies
#
# Install dependencies. The compiled tools are expected to be in
# subdirectories under the current directory as produced by the
# compile-dependencies script. The install prefix is passed in as $1,
# default taken from LIBEXECDIR in builddir/Makefile.
if [ -n "$2" ] || [[ "$1" = -* ]]; then
echo "Usage: $0 [LIBEXECDIR]" >&2
echo "The default LIBEXECDIR is taken from builddir/Makefile" >&2
exit 2
fi
if [ -n "$1" ]; then
LIBEXECDIR="$1"
elif [ ! -f builddir/Makefile ]; then
echo "builddir/Makefile not found" >&2
else
LIBEXECDIR="$(sed -n 's/^LIBEXECDIR := //p' builddir/Makefile)"
fi
DIR="$LIBEXECDIR/apptainer/bin"
if [ ! -d "$DIR" ]; then
echo "$DIR does not exist" >&2
exit 1
fi
if [ ! -w "$DIR" ]; then
echo "$DIR does is not writable" >&2
exit 1
fi
set -ex
for CMD in squashfs-tools-*/squashfs-tools/{mksquashfs,unsquashfs} squashfuse-*/squashfuse_ll e2fsprogs-*/fuse2fs fuse-overlayfs-*/fuse-overlayfs gocryptfs-*/gocryptfs; do
if [ ! -f "$CMD" ]; then
echo "$CMD not found" >&2
exit 1
fi
cp -f $CMD $DIR
done
|