Skip to content

Commit fac1104

Browse files
author
OpenShift Bot
committed
Merge pull request #1582 from sdodson/cross-platform
Merged by openshift-bot
2 parents 783f200 + 5bce31d commit fac1104

File tree

1 file changed

+35
-5
lines changed

1 file changed

+35
-5
lines changed

openshift.spec

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,17 @@ Requires: %{name} = %{version}-%{release}
7272
%description -n tuned-profiles-openshift-node
7373
%{summary}
7474

75+
%package -n osc-macosx-amd64
76+
Summary: Openshift Client Packages for Mac OSX
77+
BuildRequires: golang-pkg-darwin-amd64
78+
%description -n osc-macosx-amd64
79+
%{summary}
80+
81+
%package -n osc-windows-386
82+
Summary: OpenShift Client Packages for Windows
83+
BuildRequires: golang-pkg-windows-386
84+
%description -n osc-windows-386
85+
%{summary}
7586

7687
%prep
7788
%setup -q
@@ -97,23 +108,36 @@ pushd _thirdpartyhacks
97108
src
98109
popd
99110
export GOPATH=$(pwd)/_build:$(pwd)/_thirdpartyhacks:%{buildroot}%{gopath}:%{gopath}
100-
101111
# Default to building all of the components
102-
for cmd in openshift
112+
for OS in linux darwin windows
103113
do
104-
#go build %{import_path}/cmd/${cmd}
105-
go build -ldflags "%{ldflags}" %{import_path}/cmd/${cmd}
114+
export GOOS=${OS}
115+
for cmd in openshift
116+
do
117+
if [ $GOOS == 'windows' ]
118+
then
119+
export GOARCH='386'
120+
else
121+
export GOARCH='amd64'
122+
fi
123+
go install -ldflags "%{ldflags}" %{import_path}/cmd/${cmd}
124+
done
106125
done
107126
# set the IMAGES
108127
sed -i 's|IMAGES=.*|IMAGES=%{docker_images}|' rel-eng/openshift-{master,node}.sysconfig
109128

110129
%install
111130

112131
install -d %{buildroot}%{_bindir}
132+
install -d %{buildroot}%{_datadir}/%{name}/macosx
133+
install -d %{buildroot}%{_datadir}/%{name}/windows
134+
113135
for bin in openshift
114136
do
115137
echo "+++ INSTALLING ${bin}"
116-
install -p -m 755 ${bin} %{buildroot}%{_bindir}/${bin}
138+
install -p -m 755 _build/bin/${bin} %{buildroot}%{_bindir}/${bin}
139+
install -p -m 755 _build/bin/darwin_amd64/${bin} %{buildroot}%{_datadir}/%{name}/macosx/osc
140+
install -p -m 755 _build/bin/windows_386/${bin}.exe %{buildroot}%{_datadir}/%{name}/windows/osc.exe
117141
done
118142

119143
install -d -m 0755 %{buildroot}/etc/%{name}
@@ -195,6 +219,12 @@ if [ "$1" = 0 ]; then
195219
/usr/sbin/tuned-adm profile $recommended > /dev/null 2>&1
196220
fi
197221

222+
%files -n osc-macosx-amd64
223+
%{_datadir}/%{name}/macosx/osc
224+
225+
%files -n osc-windows-386
226+
%{_datadir}/%{name}/windows/osc.exe
227+
198228

199229
%changelog
200230
* Mon Jan 26 2015 Scott Dodson <[email protected]> 0.2-3

0 commit comments

Comments
 (0)