mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2024-11-18 22:54:00 +00:00
76 lines
3.6 KiB
Bash
76 lines
3.6 KiB
Bash
# Maintainer: Sven-Hendrik Haase <sh@lutzhaase.com>
|
|
# Contributor: Lubomir 'Kuci' Kucera <kuci24-at-gmail-dot-com>
|
|
|
|
# ALARM: Alexander Eisele <alexander@eiselecloud.de>
|
|
# - add _pkgarch variable for build and output filename instead of static arm64
|
|
|
|
buildarch=4
|
|
|
|
pkgname=gitlab-runner
|
|
pkgver=11.11.2
|
|
pkgrel=1
|
|
pkgdesc="The official GitLab CI runner written in Go"
|
|
arch=('x86_64' 'armv7h')
|
|
url='https://gitlab.com/gitlab-org/gitlab-runner'
|
|
license=('GPL3')
|
|
depends=('ca-certificates' 'curl' 'git' 'glibc' 'tar')
|
|
makedepends=('git' 'go-pie' 'git' 'mercurial')
|
|
install='gitlab-runner.install'
|
|
replaces=('gitlab-ci-multi-runner')
|
|
backup=('etc/gitlab-runner/config.toml')
|
|
noextract=("prebuilt-${pkgver}-x86_64.tar.xz"
|
|
"prebuilt-${pkgver}-arm.tar.xz")
|
|
|
|
source=("$pkgname-$pkgver.tar.gz::https://gitlab.com/api/v4/projects/gitlab-org%2Fgitlab-runner/repository/archive?sha=v${pkgver}"
|
|
"prebuilt-${pkgver}-x86_64.tar.xz::https://gitlab-runner-downloads.s3.amazonaws.com/v${pkgver}/helper-images/prebuilt-x86_64.tar.xz"
|
|
"prebuilt-${pkgver}-arm.tar.xz::https://gitlab-runner-downloads.s3.amazonaws.com/v${pkgver}/helper-images/prebuilt-arm.tar.xz"
|
|
"gitlab-runner.service"
|
|
"gitlab-runner.sysusers"
|
|
"gitlab-runner.tmpfiles"
|
|
"config.toml")
|
|
sha512sums=('fda3e866c9ccf13c28469541f3c1e7a0ba3e4da722a06288db24cee30ed24c8abf3c1f15a579ee092ab8288e2aee1d2b48df6c0133ab9171042a37706b1a818b'
|
|
'fccec2f0c382534e79d29c66c3c6d4f9dfe3136503f27bb9fa8d3ce714def78f810543fb6cbf125d025c8c277550267af8960d5ae993b4c67050bc62563eee5c'
|
|
'45570a3da1edb2461cbfc0582178462d3529117000b0266b54ee63e9588b4313c7631969b80997d4c312509a2f4c2e947030caabd08f44cddca645d1f36b19ec'
|
|
'8a5a8b7654d3864722e784b2814c6278c17876f1c0c4fc0676fbcf6817ad2ba4be55501e67ce88c62b5b63ca886b01afc6feac98ba49842acd244abdd1a8296f'
|
|
'8aa7f08702e99053c696fcc2aaba83beb9e9cd6f31973d82862db9350ac46df3a095377625d31fe909677525290d2de922d7a97930ed235774cb8f0da8944d40'
|
|
'6751d9fa0b27172d1b419c4138f5ac15cbc7c9147653a7258cf1470216142c637210bb60608c7ed0974e0e4057e5ddeae32225df1bb36e7dd1f20fec71e33cc3'
|
|
'f39c23fc06636f31c3fadb9a630c54527e8255098f18d275772cb30875d0a7463717101704070d432f2b69ab71f076a9538172a439bc307722dad2c7e260f752')
|
|
|
|
_srcdir="gitlab-runner-v${pkgver}-"
|
|
case $CARCH in
|
|
x86_64) _pkgarch="amd64";;
|
|
armv7h) _pkgarch="arm";;
|
|
esac
|
|
|
|
prepare() {
|
|
local revision=$(ls -d ${_srcdir}* | rev | cut -c 33-40 | rev)
|
|
|
|
mkdir -p "${srcdir}/src/gitlab.com/gitlab-org/"
|
|
ln -sf "${srcdir}/${_srcdir}"* "${srcdir}/src/gitlab.com/gitlab-org/gitlab-runner"
|
|
cd "${srcdir}/src/gitlab.com/gitlab-org/gitlab-runner"
|
|
|
|
local version=$(cat VERSION)
|
|
|
|
sed -i "s/export VERSION.*/export VERSION = $version/" Makefile
|
|
sed -i "s/REVISION := .*/REVISION := $revision/" Makefile
|
|
|
|
make version
|
|
|
|
ln -sf "${srcdir}/prebuilt-${pkgver}-x86_64.tar.xz" prebuilt-x86_64.tar.xz
|
|
ln -sf "${srcdir}/prebuilt-${pkgver}-arm.tar.xz" prebuilt-arm.tar.xz
|
|
}
|
|
|
|
build() {
|
|
cd "${srcdir}/src/gitlab.com/gitlab-org/gitlab-runner"
|
|
make BUILD_PLATFORMS="-osarch linux/${_pkgarch}" build;
|
|
}
|
|
|
|
package() {
|
|
cd "${srcdir}/src/gitlab.com/gitlab-org/gitlab-runner"
|
|
|
|
install -Dm644 "${srcdir}/config.toml" "${pkgdir}/etc/gitlab-runner/config.toml"
|
|
install -Dm644 "${srcdir}/gitlab-runner.service" "${pkgdir}/usr/lib/systemd/system/gitlab-runner.service"
|
|
install -Dm644 "${srcdir}/gitlab-runner.sysusers" "${pkgdir}/usr/lib/sysusers.d/gitlab-runner.conf"
|
|
install -Dm644 "${srcdir}/gitlab-runner.tmpfiles" "${pkgdir}/usr/lib/tmpfiles.d/gitlab-runner.conf"
|
|
install -Dm755 "out/binaries/gitlab-runner-linux-${_pkgarch}" "${pkgdir}/usr/bin/gitlab-runner"
|
|
}
|