#!/usr/bin/env sh

set -ex
export "BUILDMODE"="-buildmode=pie"
export "BUILDTAGS"="seccomp urfave_cli_no_docs"
export "CGO_ENABLED"="1"
export "GIT_COMMIT"="eeb7e6024f9ee43876301b1d23c353384fa6dcdd"
export "GOEXPERIMENT"="nosystemcrypto"
export "REVISION"="22"
export "VERSION"="1.2.8"

(
cd runc

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

)
