From: Elan Ruusamäe Date: Mon, 1 Oct 2018 07:56:34 +0000 (+0300) Subject: add bcond to build with prebuilt image (for ac) X-Git-Tag: auto/th/gitlab-runner-11.1.0-0.4~3 X-Git-Url: http://git.pld-linux.org/?p=packages%2Fgitlab-runner.git;a=commitdiff_plain;h=06f8fc9 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 --- 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