[packages/gitlab-runner] add bcond to build with prebuilt image (for ac)
glen
glen at pld-linux.org
Mon Oct 1 10:00:41 CEST 2018
commit 06f8fc9ba0f643ff06fb5a4851eecdeb5f45df56
Author: Elan Ruusamäe <glen at pld-linux.org>
Date: Mon Oct 1 10:56:34 2018 +0300
add bcond to build with prebuilt image (for ac)
theoretically could install package built on th on ac, as result is just
binary with libc linkage
however, too new binutils/glibc feature is attached to binary:
rtld(GNU_HASH) is needed by gitlab-runner-11.0.0-1.x86_64
binary prebuilt by upstream is more relaxed,
but just installing the binary will leave you without initscript
https://docs.gitlab.com/runner/install/linux-manually.html
gitlab-runner.spec | 12 ++++++++++++
1 file changed, 12 insertions(+)
---
diff --git a/gitlab-runner.spec b/gitlab-runner.spec
index 3fe981f..0d539f8 100644
--- a/gitlab-runner.spec
+++ b/gitlab-runner.spec
@@ -1,3 +1,7 @@
+#
+# Conditional build:
+%bcond_with prebuilt # use prebuilt binary
+
Summary: The official GitLab CI runner written in Go
Name: gitlab-runner
Version: 11.0.0
@@ -6,6 +10,10 @@ License: MIT
Group: Development/Building
Source0: https://gitlab.com/gitlab-org/gitlab-runner/repository/archive.tar.bz2?ref=v%{version}&/%{name}-%{version}.tar.bz2
# Source0-md5: d35d4d5c4d82bb68285c678be932299a
+%if %{with prebuilt}
+Source1: https://gitlab-runner-downloads.s3.amazonaws.com/v%{version}/binaries/gitlab-runner-linux-amd64
+# Source1-md5: 2fc56f01f932a14a807e37195d08bcf2
+%endif
Source3: %{name}.init
Source4: %{name}.sysconfig
Source5: %{name}.service
@@ -75,12 +83,16 @@ export GOPATH=$(pwd)
cd src/%{import_path}
export PATH=$(pwd):$PATH
+%if %{without prebuilt}
%{__make} version | tee version.txt
CN=gitlab.com/gitlab-org/gitlab-runner/common
DT=$(date -u +%%Y-%%m-%%dT%%H:%%M:%%S%%:z)
LDFLAGS="-X $CN.VERSION=%{version} -X $CN.REVISION=v%{version} -X $CN.BRANCH=v%{version} -X $CN.BUILT=$DT"
%gobuild
+%else
+install -p %{SOURCE1} gitlab-runner
+%endif
# verify that version matches
./gitlab-runner -v > v
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/gitlab-runner.git/commitdiff/06f8fc9ba0f643ff06fb5a4851eecdeb5f45df56
More information about the pld-cvs-commit
mailing list