Merge "Modify go package to be compatible with golang 1.16.6"

This commit is contained in:
Zuul 2021-08-17 19:09:30 +00:00 committed by Gerrit Code Review
commit 829a3ad6ed
6 changed files with 37 additions and 9 deletions

View File

@ -25,7 +25,11 @@ URL: https://github.com/helm/chartmuseum
BuildRequires: pkgconfig(systemd)
BuildRequires: pkgconfig(libseccomp)
BuildRequires: pkgconfig(libsystemd-journal)
BuildRequires: golang >= 1.10.0
# Build with our own prefered golang, not 1.11 from CentOS
# BuildRequires: golang >= 1.10.0
BuildRequires: golang >= 1.13.0
BuildRequires: rsync
BuildRequires: go-md2man
BuildRequires: go-bindata

View File

@ -20,7 +20,11 @@ Packager: StarlingX
BuildRequires: pkgconfig(systemd)
BuildRequires: pkgconfig(libseccomp)
BuildRequires: pkgconfig(libsystemd-journal)
BuildRequires: golang >= 1.12.16
# Build with our own prefered golang
# BuildRequires: golang >= 1.12.16
BuildRequires: golang >= 1.13
BuildRequires: systemd
BuildRequires: rsync
BuildRequires: go-md2man
@ -60,6 +64,7 @@ rm -rf %{CONTAINERD_DIR}
mkdir -p %{CONTAINERD_DIR}
cp -a %{_builddir}/src/containerd/* %{CONTAINERD_DIR}/
pushd %{CONTAINERD_DIR}
go env -w GO111MODULE=auto
make
popd

View File

@ -52,8 +52,11 @@ Obsoletes: docker-registry <= 0.9.1-5
# e.g. el6 has ppc64 arch without gcc-go, so EA tag is required
ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 %{arm}}
# If go_compiler is not set to 1, there is no virtual provide. Use golang instead.
BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}
# Build with our own prefered golang, not 1.11 from CentOS
# BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}
BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang >= 1.13}
%description
%{summary}
@ -223,6 +226,7 @@ sed -i 's/elliptic.P224(), //' vendor/golang.org/x/crypto/ocsp/ocsp.go
mkdir -p src/github.com/%{project}
ln -s ../../../ src/%{import_path}
export GOPATH=$(pwd):$(pwd)/Godeps/_workspace:%{gopath}
go env -w GO111MODULE=auto
%gobuild -o bin/registry %{import_path}/cmd/registry
%install

View File

@ -34,8 +34,11 @@ Source2: %{system_name}.conf
# e.g. el6 has ppc64 arch without gcc-go, so EA tag is required
ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:x86_64 aarch64 ppc64le s390x}
# If go_compiler is not set to 1, there is no virtual provide. Use golang instead.
BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}
# Build with our own prefered golang, not 1.11 from CentOS
# BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}
BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang >= 1.13}
Obsoletes: etcd3 < 3.0.15
Provides: etcd3 = %{version}-%{release}
@ -64,6 +67,7 @@ mkdir -p src/github.com/coreos
ln -s ../../../ src/github.com/coreos/etcd
export GOPATH=$(pwd):$(pwd)/Godeps/_workspace:%{gopath}
go env -w GO111MODULE=auto
export LDFLAGS="-X %{import_path}/version.GitSHA=%{shortcommit} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n')"

View File

@ -28,6 +28,9 @@
%global kube_version 1.18.1
%global kube_git_version v%{kube_version}
%global go_version 1.13.9
%global go_path /usr/lib/golang-%{go_version}-%{go_version}/bin
# Needed otherwise "version_ldflags=$(kube::version_ldflags)" doesn't work
%global _buildshell /bin/bash
%global _checkshell /bin/bash
@ -765,7 +768,7 @@ building other packages which use %{project}/%{repo}.
Summary: %{summary} - for running unit tests
# below Rs used for testing
Requires: golang >= 1.13.4
Requires: golang-%{go_version}
Requires: etcd >= 2.0.9
Requires: hostname
Requires: rsync
@ -778,7 +781,8 @@ Requires: NetworkManager
%package master
Summary: Kubernetes services for master host
BuildRequires: golang >= 1.13.4
# Build with the recommended golang for this Kubernetes version
BuildRequires: golang-%{go_version}
BuildRequires: systemd
BuildRequires: rsync
BuildRequires: go-md2man
@ -802,7 +806,7 @@ Requires: docker-ce
%endif
Requires: conntrack-tools
BuildRequires: golang >= 1.13.4
BuildRequires: golang-%{go_version}
BuildRequires: systemd
BuildRequires: rsync
BuildRequires: go-md2man
@ -828,7 +832,7 @@ Kubernetes tool for standing up clusters
%package client
Summary: Kubernetes client tools
BuildRequires: golang >= 1.13.4
BuildRequires: golang-%{go_version}
BuildRequires: go-bindata
%description client
@ -873,6 +877,7 @@ mv $(ls | grep -v "^src$") src/k8s.io/kubernetes/.
###############
%build
export PATH=%{go_path}:$PATH
export PBR_VERSION=%{version}
pushd src/k8s.io/kubernetes/
export KUBE_GIT_TREE_STATE="clean"
@ -880,6 +885,9 @@ export KUBE_GIT_COMMIT=%{commit}
export KUBE_GIT_VERSION=%{kube_git_version}
export KUBE_EXTRA_GOPATH=$(pwd)/Godeps/_workspace
# Verify the go version we will build against
go version
# https://bugzilla.redhat.com/show_bug.cgi?id=1392922#c1
%ifarch ppc64le
export GOLDFLAGS='-linkmode=external'

View File

@ -14,7 +14,10 @@ URL: unknown
BuildArch: x86_64
Source: %name-%version.tar.gz
BuildRequires: golang
# Build with our own prefered golang, not 1.11 from CentOS
# BuildRequires: golang
BuildRequires: golang >= 1.13
BuildRequires: systemd
Requires: kubernetes-node
Summary: Kubernetes device plugin for isolcpus