mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-02-04 23:42:07 +01:00
142 lines
3.8 KiB
Plaintext
142 lines
3.8 KiB
Plaintext
# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
|
|
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
|
|
pkgname=lxd
|
|
pkgver=4.15
|
|
pkgrel=1
|
|
pkgdesc="a container hypervisor and a new user experience for LXC"
|
|
url="https://linuxcontainers.org/lxd/"
|
|
arch="all !mips !mips64"
|
|
license="Apache-2.0"
|
|
depends="
|
|
acl
|
|
netcat-openbsd
|
|
cgmanager
|
|
squashfs-tools
|
|
rsync
|
|
dqlite
|
|
sqlite-replication
|
|
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-replication-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
|
|
"
|
|
install="$pkgname.pre-install"
|
|
options="!check"
|
|
source="https://linuxcontainers.org/downloads/$pkgname/$pkgname-$pkgver.tar.gz
|
|
$pkgname.confd
|
|
$pkgname.initd
|
|
lxd-dont-go-get.patch
|
|
add-missing-includes.patch
|
|
"
|
|
ldpath="/usr/lib/lxd"
|
|
sonameprefix="$pkgname:"
|
|
|
|
_project="github.com/lxc/lxd"
|
|
|
|
build() {
|
|
export GOPATH="$builddir/_dist"
|
|
export GOFLAGS="-buildmode=pie -trimpath"
|
|
export CGO_CFLAGS="$CFLAGS -I/usr/include/sqlite-replication"
|
|
export CGO_LDFLAGS="-lintl $LDFLAGS -L/usr/lib/sqlite-replication -Wl,-R/usr/lib/sqlite-replication"
|
|
export CGO_LDFLAGS_ALLOW="-Wl,-wrap,pthread_create"
|
|
export GO111MODULE=off
|
|
|
|
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() {
|
|
cd $builddir
|
|
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
|
|
|
|
# BASH Completion
|
|
mkdir -p "$pkgdir"/usr/share/bash-completion/completions
|
|
cp scripts/bash/lxd-client "$pkgdir"/usr/share/bash-completion/completions/lxd-client
|
|
}
|
|
|
|
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"
|
|
|
|
export GOPATH="$builddir/_dist"
|
|
cd $builddir
|
|
|
|
install -Dm755 scripts/empty-lxd.sh "$subpkgdir"/usr/bin/empty-lxd.sh
|
|
}
|
|
|
|
sha512sums="
|
|
64c8b9473e950b191b2228835822ef4261c922c0cc240dd79e6826a615ee35e965b08e9bfd26707d07fb6e2c19ddc6a93f53adc6847826f8a139b77bc4056c30 lxd-4.15.tar.gz
|
|
bc32c71f2ce10f508433e1e4651c08c18e8a17e9419a7ce391c0f127fc7cf378c665178926b35eae8813e290d9c5eab3ceb605679fd32efdf2cf98a57cee4127 lxd.confd
|
|
94de0c0d5ab63463a929a4151359950b1117d0ada5ccf0944311cc70c6b6d4c437ccb4158734ab35db67bfb4abc437074c3f3515be4531f63adc74da21fefb5b lxd.initd
|
|
58bcdde8b6d845ea70b0e81973ecc42e62a912b995684692a7f7fd2eb99e258381f33ba588033963d0d371f5c7849e0777a6b27304d80d31da7c8146e27a6139 lxd-dont-go-get.patch
|
|
c9291e7df7e7d62324d6f31460268b138eaeb7928b2aceb9e1763bc123c4410557a887847e441c03efb92642a6c39c8db6557e2af6a738ac46a9df93b5ac1d3b add-missing-includes.patch
|
|
"
|