# Contributor: Carlo Landmeter # Maintainer: pkgname="gitlab-runner" pkgver="12.0.2" pkgrel=2 pkgdesc="GitLab runner for CI/CD jobs" url="https://docs.gitlab.com/runner/" arch="all" license="MIT" makedepends="go" source="https://gitlab.com/gitlab-org/gitlab-runner/-/archive/v$pkgver/gitlab-runner-v$pkgver.tar.gz" builddir="$srcdir/src/gitlab.com/gitlab-org/$pkgname" options="net" subpackages="$pkgname-helper" export GOPATH="$srcdir" export CGO_ENABLED=0 prepare() { mkdir -p ${builddir%/*} mv "$srcdir"/$pkgname-v$pkgver "$builddir"/ default_prepare } build() { local ldflags=" -X gitlab.com/gitlab-org/$pkgname/common.NAME=$pkgname -X gitlab.com/gitlab-org/$pkgname/common.VERSION=$pkgver -X gitlab.com/gitlab-org/$pkgname/common.REVISION=unknown -X gitlab.com/gitlab-org/$pkgname/common.BUILT=$(date -u +%Y-%m-%dT%H:%M:%S%z) -X gitlab.com/gitlab-org/$pkgname/common.BRANCH=unknown -s -w " go build -ldflags "$ldflags" -o bin/gitlab-runner go build -ldflags "$ldflags" -o bin/gitlab-runner-helper \ ./apps/gitlab-runner-helper } package() { install -Dm755 "$builddir"/bin/gitlab-runner \ "$pkgdir"/usr/bin/gitlab-runner } helper() { pkgdesc="$pkgdesc (helper)" install -Dm755 "$builddir"/bin/gitlab-runner-helper \ "$subpkgdir"/usr/bin/gitlab-runner-helper } sha512sums="ccc1f7c8b2123f91e1ad440acaf69b2fdb435dd016c7e0c1d75c6f706d4ff79ea2eb7d34e91986d82afa3606b5453b4fbb18530f553c826809173cf88ecb810f gitlab-runner-v12.0.2.tar.gz"