File: docker_install_libvirt.sh

package info (click to toggle)
memkind 1.14.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 8,508 kB
  • sloc: ansic: 72,572; cpp: 39,493; sh: 4,594; perl: 4,250; xml: 2,044; python: 1,753; makefile: 1,393; csh: 7
file content (33 lines) | stat: -rwxr-xr-x 921 bytes parent folder | download | duplicates (2)
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
#!/bin/bash
# SPDX-License-Identifier: BSD-2-Clause
# Copyright (C) 2020 Intel Corporation.

# docker_install_libvirt.sh is called inside a Docker container;
# installs libvirt library
#


set -e
LIBVIRT_LIBRARY_VERSION=6.10.0
LIBVIRT_TAR_XZ=libvirt-"$LIBVIRT_LIBRARY_VERSION".tar.xz

LIBVIRT_TARBALL_URL=https://libvirt.org/sources/"$LIBVIRT_TAR_XZ"

LIBVIRT_LOCAL_DIR="$HOME"/libvirt/"$LIBVIRT_LIBRARY_VERSION"
LIBVIRT_LOCAL_TAR_XZ="$LIBVIRT_LOCAL_DIR"/"$LIBVIRT_TAR_XZ"

# create libvirt directory in home directory
mkdir -p "$LIBVIRT_LOCAL_DIR"

# download and untar libvirt library to libvirt directory
curl -L "$LIBVIRT_TARBALL_URL" -o "$LIBVIRT_LOCAL_TAR_XZ"
tar xvf "$LIBVIRT_LOCAL_TAR_XZ" -C "$LIBVIRT_LOCAL_DIR"  --strip-components=1

# go to libvirt directory and build libvirt library
cd "$LIBVIRT_LOCAL_DIR"

meson configure
meson build --prefix=/usr
ninja -C build
sudo ninja -C build install
sudo ldconfig