]> git.pld-linux.org Git - packages/gitlab-runner.git/commitdiff
add bcond to build with prebuilt image (for ac)
authorElan Ruusamäe <glen@pld-linux.org>
Mon, 1 Oct 2018 07:56:34 +0000 (10:56 +0300)
committerElan Ruusamäe <glen@pld-linux.org>
Mon, 1 Oct 2018 07:56:36 +0000 (10:56 +0300)
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

index 3fe981f68891e16791f29473356855d4647e9c5f..0d539f8231d8f309b9e782fb4a76aa1630fa3a51 100644 (file)
@@ -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
 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
 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
 Source3:       %{name}.init
 Source4:       %{name}.sysconfig
 Source5:       %{name}.service
@@ -75,12 +83,16 @@ export GOPATH=$(pwd)
 cd src/%{import_path}
 export PATH=$(pwd):$PATH
 
 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
 %{__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
 
 # verify that version matches
 ./gitlab-runner -v > v
This page took 0.078195 seconds and 4 git commands to generate.