Debian Codegraph @

hacking/installdeps.sh

raw
1 #!/bin/bash
2 set -xeuo pipefail
3
4 # Handle Fedora derivatives or others that have composefs
5 # shipped already.
6
7 if test -x /usr/bin/dnf; then
8 . /etc/os-release
9 case "${ID_LIKE:-}" in
10 *rhel*) dnf config-manager --set-enabled crb ;;
11 esac
12 dnf -y install dnf-utils tar git meson;
13 dnf -y builddep composefs
14 exit 0
15 fi
16
17 export DEBIAN_FRONTEND=noninteractive
18
19 PACKAGES=" \
20 automake \
21 libtool \
22 autoconf \
23 autotools-dev \
24 git \
25 make \
26 tar \
27 gcc \
28 libssl-dev \
29 libfsverity-dev \
30 pkg-config \
31 libfuse3-dev \
32 python3 \
33 libcap2-bin \
34 meson \
35 "
36
37 # Split required and optional packages based on input variable ALLOW_MISSING:
38 PACKAGES_REQUIRED=""
39 PACKAGES_OPTIONAL=""
40
41 for pkg in $PACKAGES; do
42 if [[ " ${ALLOW_MISSING:-} " == *" ${pkg} "* ]]; then
43 PACKAGES_OPTIONAL+=" ${pkg}"
44 else
45 PACKAGES_REQUIRED+=" ${pkg}"
46 fi
47 done
48
49 # Install packages:
50 if [ -n "${PACKAGES_REQUIRED}" ]; then
51 apt -y update
52 apt-get install -y $PACKAGES_REQUIRED
53 fi
54
55 if [ -n "${PACKAGES_OPTIONAL}" ]; then
56 apt -y update
57 apt-get install -y --ignore-missing $PACKAGES_OPTIONAL || true
58 fi