aboutsummaryrefslogtreecommitdiffstats
path: root/community/containerd/APKBUILD
blob: 025f8ece69be0360be6c9f5e36822a0af40c1b33 (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
# Contributor: Jake Buchholz <tomalok@gmail.com>
# 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=a62e1d690afa2b9b1d43f8ece3ff4483
pkgver=1.5.4
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.5.4-r0:
#     - CVE-2021-32760
#   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="
91d2fce2dc218070078f0e9e8141d091eca9f23c0b1ff244180260f214a46cdd66ba5c89472b40c0875cbd25580e19765bb030abf2ad749cfd4eea712dacadc1  containerd-1.5.4.tar.gz
21a9888b684913138ec4a342b0b69e40e9c773ecd329c4e2401a807365586468cb19035583a4fc8b0f86138f5ee4c7fb911c75495263e4b43d2886ea11e0e271  containerd.confd
2818cb9e062a6b75c5e2ad6a076eb26edc9fd9b70356b37f9306d082dc360a2d7bd802531afd8e73998cc0fdaa6ad34cd7a0a1d67bd98ee1bb7f30bab16d6084  containerd.initd
"