# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=containerd
pkgver=1.0.0
pkgrel=1
pkgdesc="An open and reliable container runtime"
url="https://containerd.io/"
arch="all"
license="Apache-2.0"
makedepends="go linux-headers btrfs-progs-dev protobuf-dev"
source="containerd-$pkgver.tar.gz::https://github.com/containerd/containerd/archive/v$pkgver.tar.gz
	"

builddir="$srcdir"/containerd-$pkgver

build() {
	cd "$builddir"
	mkdir src
	mv vendor/* src
	ln -s "$builddir" src/github.com/containerd/containerd
	GOPATH="$PWD" LDFLAGS="" make VERSION="$pkgver" REVISION="$pkgrel"
}

check() {
	cd "$builddir"
	./bin/containerd --version
}

package() {
	cd "$builddir"

	install -d "$pkgdir"/usr/bin/
	install -m755 "$builddir"/bin/* "$pkgdir"/usr/bin/
}

sha512sums="8c1a03de7f30976675e4482b4f18f4b87da56108de4d92f2e33b4cb4f8c188af5b3fad87971a294eac8442a0fb6ddae48cda81334c363203a8c8bdfc09176a7a  containerd-1.0.0.tar.gz"
