Skip to content

Commit

Permalink
Fix oc RPM for ART builds
Browse files Browse the repository at this point in the history
  • Loading branch information
tnozicka committed Aug 27, 2019
1 parent 6788d4a commit 18e9d2f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ OUTPUT_DIR :=_output
CROSS_BUILD_BINDIR :=$(OUTPUT_DIR)/bin
RPM_VERSION :=$(shell set -o pipefail && echo '$(SOURCE_GIT_TAG)' | sed -E 's/v([0-9]+\.[0-9]+\.[0-9]+)-.*/\1/')
RPM_EXTRAFLAGS := \
--define 'local_build true' \
--define 'os_git_vars ""' \
--define 'version $(RPM_VERSION)' \
--define 'dist .el7' \
--define 'release 1'
Expand Down
24 changes: 22 additions & 2 deletions oc.spec
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,22 @@
%{!?version: %global version 0.0.1}
%{!?release: %global release 1}


# os_git_vars needed to run hack scripts during rpm builds
%if ! 0%{?os_git_vars:1}
# the string on the line below is replaced by a modified one coming from openshift/doozer - DO NOT MODIFY IT
%global os_git_vars OS_GIT_VERSION='' OS_GIT_COMMIT='' OS_GIT_MAJOR='' OS_GIT_MINOR='' OS_GIT_TREE_STATE=''
%endif

%if ! 0%{?os_git_vars:1}
%global make make
%else
%global make %{os_git_vars} && make SOURCE_GIT_TAG:="${OS_GIT_VERSION}" SOURCE_GIT_COMMIT:="${OS_GIT_COMMIT}" SOURCE_GIT_MAJOR:="${OS_GIT_MAJOR}" SOURCE_GIT_MINOR:="${OS_GIT_MINOR}" SOURCE_GIT_TREE_STATE:="${OS_GIT_TREE_STATE}"
%endif

%if ! 0%{?local_build:1}
Source0: https://%{import_path}/archive/%{commit}/%{name}-%{version}.tar.gz
%endif
Name: openshift-clients
Version: %{version}
Release: %{release}%{dist}
Expand Down Expand Up @@ -48,10 +64,14 @@ Obsoletes: atomic-openshift-clients-redistributable

%prep

%if ! 0%{?local_build:1}
%setup -q
%endif

%build
%ifarch x86_64
# Create Binaries for all supported arches
make build cross-build
%{make} build cross-build
%else
%ifarch %{ix86}
GOOS=linux
Expand All @@ -69,7 +89,7 @@ Obsoletes: atomic-openshift-clients-redistributable
GOOS=linux
GOARCH=s390x
%endif
%{source_git_vars} make build
%{make} build
%endif

%install
Expand Down

0 comments on commit 18e9d2f

Please sign in to comment.