diff --git a/containerd.spec b/containerd.spec index 8b45e9b..9b02054 100644 --- a/containerd.spec +++ b/containerd.spec @@ -1,7 +1,31 @@ %global goipath github.com/containerd/containerd Version: 1.2.1 + +%if %{defined fedora} %gometa %bcond_without tests +%else +ExclusiveArch: %{go_arches} +%global debug_package %{nil} +%global gosource https://%{goipath}/archive/v%{version}/containerd-%{version}.tar.gz +%define gobuildroot %{expand: +GO_BUILD_PATH=$PWD/_build +install -m 0755 -vd $(dirname $GO_BUILD_PATH/src/%{goipath}) +ln -fs $PWD $GO_BUILD_PATH/src/%{goipath} +cd $GO_BUILD_PATH/src/%{goipath} +install -m 0755 -vd _bin +export PATH=$PWD/_bin${PATH:+:$PATH} +export GOPATH=$GO_BUILD_PATH:%{gopath} +} +%define gobuild(o:) %{expand: +%global _dwz_low_mem_die_limit 0 +%ifnarch ppc64 +go build -buildmode pie -compiler gc -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags %{?__golang_extldflags}'" -a -v -x %{?**}; +%else +go build -compiler gc -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags %{?__golang_extldflags}'" -a -v -x %{?**}; +%endif +} +%endif Name: containerd