+#
+# Conditional build:
+%bcond_with prebuilt # use prebuilt binary
+
Summary: The official GitLab CI runner written in Go
Name: gitlab-runner
Version: 11.0.0
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
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