aboutsummaryrefslogtreecommitdiffstats
path: root/community/containerd/APKBUILD
blob: afa8917b197ae61afab64548234892718d4e9fe0 (plain) (blame)
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
# Maintainer: Jake Buchholz <tomalok@gmail.com>

pkgname=containerd

# NOTE: containerd's Makefile tries to get REVISION from git, but we're building from a tarball.
_commit=8c906ff108ac28da23f69cc7b74f8e7a470d1df0
pkgver=1.5.0
pkgrel=0
pkgdesc="An open and reliable container runtime"
url="https://containerd.io"
arch="all"
license="Apache-2.0"
depends="runc"
makedepends="btrfs-progs-dev go go-md2man libseccomp-dev"
subpackages="
	$pkgname-doc
	$pkgname-stress
	$pkgname-openrc:openrc:noarch
"
source="containerd-$pkgver.tar.gz::https://github.com/containerd/containerd/archive/v$pkgver.tar.gz
	containerd.confd
	containerd.initd
"
builddir="$srcdir/src/github.com/containerd/containerd"

# secfixes:
#   1.4.4-r0:
#     - CVE-2021-21334
#   1.4.3-r0:
#     - CVE-2020-15257
#   1.3.3-r0:
#     - CVE-2019-19921
#     - CVE-2020-0601
#     - CVE-2020-7919
#     - CVE-2019-11253
#   1.3.1-r0:
#     - CVE-2019-17596
#   1.3.0-r0:
#     - CVE-2019-16884
#   1.2.9-r0:
#     - CVE-2019-9512
#     - CVE-2019-9514
#     - CVE-2019-9515
#   1.2.6-r0:
#     - CVE-2019-9946

prepare() {
	cd "$srcdir"
	export GOPATH="$PWD"
	mkdir -p "$(dirname "$srcdir/src/github.com/containerd/containerd")"
	ln -s "$PWD/$pkgname-$pkgver" "$builddir"
	cd "$builddir"

	default_prepare
}

build() {
	case "$CARCH" in
		mips64*) buildmode=exe;;
		*) buildmode=pie;;
	esac

	export GO111MODULE=on

	make VERSION="v$pkgver" REVISION="$_commit" BUILDMODE="$buildmode" \
		EXTRA_LDFLAGS="-s -w"
	make man
}

check() {
	./bin/containerd --version
}

package() {
	install -d "$pkgdir"/usr/bin/
	install -Dsm755 "$builddir"/bin/* "$pkgdir"/usr/bin/
	install -d "$pkgdir"/usr/share/man/man5/
	install -Dm644 "$builddir"/man/*.5 "$pkgdir"/usr/share/man/man5/
	install -d "$pkgdir"/usr/share/man/man8/
	install -Dm644 "$builddir"/man/*.8 "$pkgdir"/usr/share/man/man8/
	install -d "$pkgdir"/etc/containerd/
	"$pkgdir"/bin/containerd config default | sed "s|/opt/cni/bin|/usr/libexec/cni|g" > "$pkgdir"/etc/containerd/config.toml
}

openrc() {
	pkgdesc="OpenRC init scripts for standalone containerd"
	depends="$pkgname"

	install -Dm755 "$srcdir"/containerd.initd "$subpkgdir"/etc/init.d/containerd
	install -Dm644 "$srcdir"/containerd.confd "$subpkgdir"/etc/conf.d/containerd
}

stress() {
	pkgdesc="containerd-stress utility"
	amove usr/bin/containerd-stress
}

sha512sums="
58163a06c3f1353bcaa485f6eb69b5657f83c4cd19c37deece4df26c78251d2aff4708d915df75a2c1017e620abe23fe824843598648e4e3f4a2d0c023d9b500  containerd-1.5.0.tar.gz
21a9888b684913138ec4a342b0b69e40e9c773ecd329c4e2401a807365586468cb19035583a4fc8b0f86138f5ee4c7fb911c75495263e4b43d2886ea11e0e271  containerd.confd
2818cb9e062a6b75c5e2ad6a076eb26edc9fd9b70356b37f9306d082dc360a2d7bd802531afd8e73998cc0fdaa6ad34cd7a0a1d67bd98ee1bb7f30bab16d6084  containerd.initd
"