Blob Blame History Raw
diff --git a/Makefile b/Makefile
index 56db39c..5f66311 100644
--- a/Makefile
+++ b/Makefile
@@ -234,6 +234,15 @@ build-cross: clean
 	hack/build-cross.sh
 .PHONY: build-cross
 
+# Build the release binaries for only the platform of the build host
+# (no cross compile)
+#
+# Example:
+#   make build-platform
+build-platform: clean
+       hack/build-platform.sh
+.PHONY: build-platform
+
 # Install travis dependencies
 #
 # Example:
diff --git a/hack/build-platform.sh b/hack/build-platform.sh
new file mode 100755
index 0000000..8f7312a
--- /dev/null
+++ b/hack/build-platform.sh
@@ -0,0 +1,54 @@
+#!/bin/bash
+
+# Build all compile targets and the base binaries for only the platform of the
+# host it's building on. (i.e. - no cross compile)
+STARTTIME=$(date +%s)
+source "$(dirname "${BASH_SOURCE}")/lib/init.sh"
+
+source <(go env)
+platforms=( "${GOHOSTOS}/${GOARCH}" )
+if [[ -n "${OS_ONLY_BUILD_PLATFORMS:-}" ]]; then
+  filtered=()
+  for platform in "${platforms[@]}"; do
+    if [[ "${platform}" =~ "${OS_ONLY_BUILD_PLATFORMS}" ]]; then
+      filtered+=("${platform}")
+    fi
+  done
+  platforms=("${filtered[@]}")
+fi
+
+# Build the primary client/server for the host platform
+OS_BUILD_PLATFORMS=("${platforms[@]}")
+case "${GOHOSTOS}/${GOARCH}" in
+  "linux/amd64")
+    OS_GOFLAGS_LINUX_AMD64="-tags=gssapi" os::build::build_binaries "${OS_CROSS_COMPILE_TARGETS[@]}"
+    ;;
+  "linux/arm64")
+    OS_GOFLAGS_LINUX_ARM64="-tags=gssapi" os::build::build_binaries "${OS_CROSS_COMPILE_TARGETS[@]}"
+    ;;
+  "linux/386")
+    OS_GOFLAGS_LINUX_386="-tags=gssapi" os::build::build_binaries "${OS_CROSS_COMPILE_TARGETS[@]}"
+    ;;
+  "linux/arm")
+    OS_GOFLAGS_LINUX_ARM="-tags=gssapi" os::build::build_binaries "${OS_CROSS_COMPILE_TARGETS[@]}"
+    ;;
+  "linux/ppc64")
+    OS_GOFLAGS_LINUX_PPC64="-tags=gssapi" os::build::build_binaries "${OS_CROSS_COMPILE_TARGETS[@]}"
+    ;;
+  "linux/ppc64le")
+    OS_GOFLAGS_LINUX_PPC64LE="-tags=gssapi" os::build::build_binaries "${OS_CROSS_COMPILE_TARGETS[@]}"
+    ;;
+esac
+
+# Pass the necessary tags
+OS_GOFLAGS="${OS_GOFLAGS:-} ${OS_IMAGE_COMPILE_GOFLAGS}" os::build::build_static_binaries "${OS_IMAGE_COMPILE_TARGETS[@]:-}" "${OS_SCRATCH_IMAGE_COMPILE_TARGETS[@]:-}"
+
+# Make the primary client/server release.
+OS_RELEASE_ARCHIVE="openshift-origin"
+os::build::place_bins "${OS_CROSS_COMPILE_BINARIES[@]}"
+
+# Make the image binaries release.
+OS_RELEASE_ARCHIVE="openshift-origin-image"
+os::build::place_bins "${OS_IMAGE_COMPILE_BINARIES[@]}"
+
+ret=$?; ENDTIME=$(date +%s); echo "$0 took $(($ENDTIME - $STARTTIME)) seconds"; exit "$ret"
diff --git a/origin.spec b/origin.spec
index f225228..b5e13da 100644
--- a/origin.spec
+++ b/origin.spec
@@ -207,7 +207,11 @@ of docker.  Exclude those versions of docker.
 
 %build
 # Create Binaries
+%if 0%{?make_redistributable}
 %{os_git_vars} hack/build-cross.sh
+%else
+%{os_git_vars} hack/build-go.sh
+%endif
 
 %if 0%{build_tests}
 # Create extended.test
@@ -549,12 +553,12 @@ fi
 /usr/sbin/%{name}-docker-excluder
 
 %post docker-excluder
-# we always want to run this, since the 
+# we always want to run this, since the
 #   package-list may be different with each version
 %{name}-docker-excluder exclude
 
 %preun docker-excluder
-# we always want to clear this out, since the 
+# we always want to clear this out, since the
 #   package-list may be different with each version
 /usr/sbin/%{name}-docker-excluder unexclude