blob: f7c699e3260cadc606fc37449e6a84337fb4c18c (
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
|
# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=lxd
pkgver=4.19
pkgrel=0
pkgdesc="a container hypervisor and a new user experience for LXC"
url="https://linuxcontainers.org/lxd/"
arch="all !mips !mips64"
license="Apache-2.0"
pkggroups="$pkgname"
depends="
acl
attr
netcat-openbsd
cgmanager
squashfs-tools
rsync
dqlite
shadow-uidmap
lxc
ip6tables
dnsmasq
ca-certificates
tar
iproute2
xz
"
makedepends="
lxc-dev
gettext-dev
acl-dev
acl-static
tcl-dev
libuv-dev
eudev-dev
libcap-dev
linux-headers
rsync
go
intltool
libtool
autoconf
automake
patchelf
dqlite-dev
dqlite-static
lz4-dev
sqlite-dev
sqlite-static
raft-dev
raft-static
gettext-static
zlib-static
libuv-static
libseccomp-static
libcap-static
"
subpackages="
$pkgname-scripts:scripts:noarch
$pkgname-bash-completion
$pkgname-openrc
$pkgname-doc
"
install="$pkgname.pre-install"
options="!check"
source="https://linuxcontainers.org/downloads/lxd/lxd-$pkgver.tar.gz
$pkgname.confd
$pkgname.initd
"
ldpath="/usr/lib/lxd"
sonameprefix="$pkgname:"
build() {
export GOPATH="$builddir/_dist"
export GOFLAGS="$GOFLAGS -buildmode=pie -trimpath"
export CGO_LDFLAGS="-lintl $LDFLAGS"
export CGO_LDFLAGS_ALLOW="(-Wl,-wrap,pthread_create)|(-Wl,-z,now)"
export GO111MODULE=on
mkdir -p bin
go build -v -tags "netgo" -ldflags '-extldflags "-static -lm -ldl -lz -lpthread -lz -lintl -lraft -ldqlite -luv -lseccomp -lcap"' -o bin/ ./lxd-p2c/...
go build -v -tags "agent" -ldflags '-extldflags "-static -lm -ldl -lz -lpthread -lz -lintl -lraft -ldqlite -luv -lseccomp -lcap"' -o bin/ ./lxd-agent/...
for tool in fuidshift lxc lxc-to-lxd lxd lxd-benchmark; do
go build -v -tags "libsqlite3" -o bin/ ./$tool/...
done
}
package() {
for tool in lxc fuidshift lxc-to-lxd lxd lxd-benchmark lxd-p2c lxd-agent; do
install -p -Dm755 "bin/$tool" "$pkgdir/usr/bin/$tool"
done
install -Dm755 bin/$pkgname "$pkgdir"/usr/sbin/$pkgname
install -Dm755 bin/lxc "$pkgdir"/usr/bin/lxc
patchelf --set-rpath "/usr/lib/lxd" "$pkgdir/usr/sbin/lxd"
install -Dm755 "$srcdir"/lxd.initd \
"$pkgdir"/etc/init.d/lxd
install -Dm644 "$srcdir"/lxd.confd \
"$pkgdir"/etc/conf.d/lxd
mkdir -p "$pkgdir"/var/lib/lxd
chmod 755 "$pkgdir"/var/lib/lxd
chgrp $pkggroups "$pkgdir"/var/lib/lxd
mkdir -p "$pkgdir/usr/share/doc/$pkgname"
cat > "$pkgdir"/usr/share/doc/$pkgname/README.alpine <<EOF
-----------------------------------
Be sure to add your local user to the lxd group.
EOF
}
bashcomp() {
depends="bash"
pkgdesc="Bash completions for $pkgname"
install_if="$pkgname=$pkgver-r$pkgrel bash-completion"
cd $builddir
mkdir -p "$subpkgdir"/usr/share/bash-completion/completions
cp scripts/bash/lxd-client "$subpkgdir"/usr/share/bash-completion/completions/lxd-client
}
scripts() {
pkgdesc="LXD scripts"
depends="$pkgname py3-lxc jq"
cd $builddir
export GOPATH="$builddir/_dist"
install -Dm755 scripts/empty-lxd.sh "$subpkgdir"/usr/bin/empty-lxd.sh
}
sha512sums="
8569912999af71c92740c060f85ea2a37b1943e924ab4be62421c96cb1ee05a3eb2802f130fc11774cb036d8348260ca65d63b6da2ca3fe6f75a681a36d62dfd lxd-4.19.tar.gz
1bbb26a61b3812e6eb4c3cb7db6c2d9adb43195f96f317d6bba1ace6a97f1faed0677a12c3827002bc147edba9b355f0e7ead3960d254a131b25fb8c060ea8d0 lxd.confd
eb16aaa1121dda7687dd40d017e127478a72ddbc16658c31631265f0e4f05b2256e858dde40f4af08f8889651fa1898c8a65aa6826a9a9542cb4ae1f4bbf76ca lxd.initd
"
|