Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 1739445: Fix oc rpm for ART builds #71

Merged
merged 1 commit into from
Aug 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions Makefile
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 ignore' \
--define 'version $(RPM_VERSION)' \
--define 'dist .el7' \
--define 'release 1'
Expand Down
39 changes: 35 additions & 4 deletions oc.spec
Expand Up @@ -12,6 +12,25 @@
%{!?version: %global version 0.0.1}
%{!?release: %global release 1}

%{!?commit:
# DO NOT MODIFY: the value on the line below is sed-like replaced by openshift/doozer
%global commit e0a5699f2049372633b18c43a98a522999b1f297
}

%if ! 0%{?os_git_vars:1}
# DO NOT MODIFY: the value on the line below is sed-like replaced by openshift/doozer
%global os_git_vars OS_GIT_VERSION='' OS_GIT_COMMIT='' OS_GIT_MAJOR='' OS_GIT_MINOR='' OS_GIT_TREE_STATE=''
%endif

%if "%{os_git_vars}" == "ignore"
%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 +67,22 @@ Obsoletes: atomic-openshift-clients-redistributable

%prep

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

%build
%if ! 0%{?local_build:1}
mkdir -p "$(dirname __gopath/src/%{import_path})"
mkdir -p "$(dirname __gopath/src/%{import_path})"
ln -s "$(pwd)" "__gopath/src/%{import_path}"
export GOPATH=$(pwd)/__gopath:%{gopath}
cd "__gopath/src/%{import_path}"
%endif

%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,14 +100,14 @@ Obsoletes: atomic-openshift-clients-redistributable
GOOS=linux
GOARCH=s390x
%endif
%{source_git_vars} make build
%{make} build
%endif

%install
install -d %{buildroot}%{_bindir}

# Install for the local platform
install -p -m 755 oc %{buildroot}%{_bindir}/oc
# Install for the local platform
install -p -m 755 ./oc %{buildroot}%{_bindir}/oc

%ifarch x86_64
# Install client executable for windows and mac
Expand Down