#!/usr/bin/env sh

set -ex
export "BUILDMODE"="-buildmode=pie"
export "BUILDTAGS"="seccomp urfave_cli_no_docs"
export "CGO_ENABLED"="1"
export "GIT_COMMIT"="c241c0bb5e60a8e8c1b2e53d4eca8d0068d8d57e"
export "GOEXPERIMENT"="nosystemcrypto"
export "REVISION"="8"

(
cd runc

LDFLAGS="-X main.gitCommit=${GIT_COMMIT} -X main.extraVersion=-${REVISION}"
go build -mod=vendor -trimpath -tags "${BUILDTAGS}" -ldflags "${LDFLAGS}" -o runc .
make man

)
