summaryrefslogtreecommitdiff
path: root/testing/linuxkit/APKBUILD
blob: 6d48affa84db3d6582cc4ea372623be522f54b85 (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
# Maintainer: Hoang Nguyen <folliekazetani@protonmail.com>
pkgname=linuxkit
pkgver=1.0.1
pkgrel=0
pkgdesc="Toolkit for building immutable operating systems for containers"
url="https://github.com/linuxkit/linuxkit"
# 32-bit platforms: github.com/rn/iso9660wrap: integer overflow
# riscv64: fails to build
arch="all !x86 !armhf !armv7 !riscv64"
license="Apache-2.0"
makedepends="go"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/linuxkit/linuxkit/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/$pkgname-$pkgver/src/cmd/linuxkit"

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	local _goldflags="
	-X github.com/linuxkit/linuxkit/src/cmd/linuxkit/version.GitCommit=AlpineLinux
	-X github.com/linuxkit/linuxkit/src/cmd/linuxkit/version.Version=v$pkgver
	"
	go build -v -ldflags "$_goldflags"
}

check() {
	go test ./...
}

package() {
	install -Dm755 $pkgname -t "$pkgdir"/usr/bin/

	mkdir -p "$pkgdir"/usr/share/doc/linuxkit/examples
	cp -r ../../../examples/*.yml "$pkgdir"/usr/share/doc/linuxkit/examples/
}

sha512sums="
4dbde5114a2e9f6adca69170430dbc916ef1d2d3c656b68a96a4eeff4f2dcbe6fd20640c9f28d98f4d7c7f4747a73d7c19fb36624c5d9f2e11565c6dc7ca981d  linuxkit-1.0.1.tar.gz
"