mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-01-18 15:12:02 +01:00
161 lines
3.9 KiB
Plaintext
161 lines
3.9 KiB
Plaintext
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
|
|
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
|
|
pkgname=lxd
|
|
pkgver=3.13
|
|
pkgrel=0
|
|
pkgdesc="a container hypervisor and a new user experience for LXC"
|
|
url="https://linuxcontainers.org/lxd/"
|
|
arch="all"
|
|
license="Apache-2.0"
|
|
depends="
|
|
acl
|
|
xz
|
|
netcat-openbsd
|
|
cgmanager
|
|
squashfs-tools
|
|
rsync
|
|
shadow-uidmap
|
|
lxc
|
|
ip6tables
|
|
dnsmasq
|
|
ca-certificates
|
|
tar
|
|
"
|
|
makedepends="
|
|
lxc-dev
|
|
gettext-dev
|
|
acl-dev
|
|
tcl-dev
|
|
libuv-dev
|
|
libcap-dev
|
|
linux-headers
|
|
|
|
rsync
|
|
go
|
|
intltool
|
|
|
|
libtool
|
|
autoconf
|
|
automake
|
|
"
|
|
subpackages="
|
|
$pkgname-scripts:scripts
|
|
$pkgname-bash-completion:bashcomp:noarch
|
|
$pkgname-openrc
|
|
$pkgname-libs
|
|
"
|
|
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
|
|
"
|
|
|
|
# avoid conflict with system libsqlite3.so.0 by adding a soname prefix.
|
|
# this makes lxd-libs provide so:lxd:libsqlite3.so.0 and lxd depend on
|
|
# so:lxd:libsqlite3.so.0.
|
|
ldpath="/usr/lib/lxd"
|
|
sonameprefix="$pkgname:"
|
|
|
|
_project="github.com/lxc/lxd"
|
|
|
|
|
|
prepare() {
|
|
default_prepare
|
|
update_config_guess
|
|
cd "$builddir"/dist/dqlite
|
|
autoreconf -i
|
|
}
|
|
|
|
build() {
|
|
export GOPATH="$builddir/dist"
|
|
export CGO_LDFLAGS="$CGO_LDFLAGS -lintl"
|
|
cd "$GOPATH"/sqlite
|
|
./configure \
|
|
--prefix=/usr \
|
|
--enable-replication \
|
|
--disable-amalgamation \
|
|
--disable-tcl \
|
|
--libdir=/usr/lib/lxd
|
|
|
|
cd "$GOPATH"/dqlite
|
|
PKG_CONFIG_PATH="${GOPATH}/sqlite/" ./configure \
|
|
--prefix=/usr \
|
|
--libdir=/usr/lib/lxd
|
|
|
|
cd "$GOPATH"/sqlite
|
|
make
|
|
|
|
cd "$GOPATH"/dqlite
|
|
make CFLAGS="-I${GOPATH}/sqlite" LDFLAGS="-L${GOPATH}/sqlite"
|
|
|
|
cd "$builddir"
|
|
go install -v -x $_project/lxc
|
|
export CGO_CFLAGS="-I${GOPATH}/sqlite/ -I${GOPATH}/dqlite/include/"
|
|
export CGO_LDFLAGS="$CGO_LDFLAGS -L${GOPATH}/sqlite/.libs/ -L${GOPATH}/dqlite/.libs/ -Wl,-rpath,/usr/lib/lxd"
|
|
export LD_LIBRARY_PATH="${GOPATH}/sqlite/.libs/:${GOPATH}/dqlite/.libs/"
|
|
go install -v -x -tags libsqlite3 $_project/lxd
|
|
for tool in fuidshift lxc-to-lxd lxd-benchmark lxd-p2c; do
|
|
go install -v -x $_project/$tool
|
|
done
|
|
}
|
|
|
|
package() {
|
|
export GOPATH="$builddir/dist"
|
|
export CGO_LDFLAGS="$CGO_LDFLAGS -lintl"
|
|
cd "$GOPATH"/sqlite
|
|
make DESTDIR="$pkgdir" install
|
|
|
|
cd "$GOPATH"/dqlite
|
|
make DESTDIR="$pkgdir" install
|
|
|
|
rm $pkgdir/usr/bin/sqlite3
|
|
rm -r $pkgdir/usr/include
|
|
|
|
cd $GOPATH
|
|
install -Dm755 bin/$pkgname "$pkgdir"/usr/sbin/$pkgname
|
|
install -Dm755 bin/lxc "$pkgdir"/usr/bin/lxc
|
|
|
|
install -Dm755 "$srcdir"/lxd.initd \
|
|
"$pkgdir"/etc/init.d/lxd
|
|
install -Dm644 "$srcdir"/lxd.confd \
|
|
"$pkgdir"/etc/conf.d/lxd
|
|
}
|
|
|
|
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 python3 py3-lxc"
|
|
|
|
export GOPATH="$builddir/dist"
|
|
cd $GOPATH
|
|
|
|
for tool in fuidshift lxc-to-lxd lxd-benchmark lxd-p2c; do
|
|
install -Dm755 bin/$tool "$subpkgdir"/usr/bin/$tool
|
|
done
|
|
}
|
|
|
|
libs() {
|
|
pkgdesc="LXD bundled libraries"
|
|
depends=
|
|
mkdir -p "$subpkgdir"/usr
|
|
mv "$pkgdir"/usr/lib "$subpkgdir"/usr/
|
|
rm -rf "$subpkgdir"/usr/lib/lxd/pkgconfig \
|
|
"$subpkgdir"/usr/lib/lxd/*.a
|
|
}
|
|
|
|
sha512sums="c97004dc8def3bb5f4db540adedc0e35c0d0998573417ecd8607662e6aeb6565270b26e62f041afe2ac54c4f4f830da38e15e6fbf6980f6df880b86e08618e29 lxd-3.13.tar.gz
|
|
bc32c71f2ce10f508433e1e4651c08c18e8a17e9419a7ce391c0f127fc7cf378c665178926b35eae8813e290d9c5eab3ceb605679fd32efdf2cf98a57cee4127 lxd.confd
|
|
94de0c0d5ab63463a929a4151359950b1117d0ada5ccf0944311cc70c6b6d4c437ccb4158734ab35db67bfb4abc437074c3f3515be4531f63adc74da21fefb5b lxd.initd
|
|
a77a74950110c94727956457843cd3f64c0db901fb05b95ab0edaa966f7fe76a993d86c8a51d14724a11846a69261199594f683dfefa1db633f4ca35c7f23607 lxd-dont-go-get.patch"
|