-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
ci
executable file
·63 lines (53 loc) · 1.01 KB
/
ci
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
57
58
59
60
61
62
63
#!/bin/sh
set -eu
SUDO=$(which sudo || echo '')
main()
{
if [ $# -lt 1 ]
then
err "Missing argument"
fi
local action=$1
shift
eval "$action $*"
}
err()
{
>&2 echo $*
exit 1
}
lxc()
{
if [ $# -lt 1 ]
then
err "Missing argument"
fi
local version=$1
$SUDO apt update
$SUDO apt install lxc-dev clang meson systemd libdbus-1-dev -y
git clone https://github.com/lxc/lxc.git
cd lxc
case "$version" in
"6.0")
tag="v6.0.0"
;;
"5.0")
tag="lxc-5.0.3"
;;
*)
tag="lxc-$version.0"
;;
esac
git checkout "$tag"
if [ $(echo "$version" | cut -d. -f1) -ge 5 ]
then
meson setup -Dprefix=/usr -Dman=false build
meson compile -C build
$SUDO meson install -C build
else
./autogen.sh
./configure
$SUDO cp src/lxc/attach_options.h src/lxc/lxccontainer.h src/lxc/version.h /usr/include/lxc
fi
}
main $*