@@ -72,6 +72,17 @@ Requires: %{name} = %{version}-%{release}
72
72
%description -n tuned-profiles-openshift-node
73
73
%{summary }
74
74
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 }
75
86
76
87
%prep
77
88
%setup -q
@@ -97,23 +108,36 @@ pushd _thirdpartyhacks
97
108
src
98
109
popd
99
110
export GOPATH= $(pwd)/_build:$(pwd)/_thirdpartyhacks:%{buildroot }%{gopath }:%{gopath }
100
-
101
111
# Default to building all of the components
102
- for cmd in openshift
112
+ for OS in linux darwin windows
103
113
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
106
125
done
107
126
# set the IMAGES
108
127
sed -i 's|IMAGES= .*|IMAGES= %{docker_images }|' rel-eng/openshift-{master,node}.sysconfig
109
128
110
129
%install
111
130
112
131
install -d %{buildroot }%{_bindir }
132
+ install -d %{buildroot }%{_datadir }/%{name }/macosx
133
+ install -d %{buildroot }%{_datadir }/%{name }/windows
134
+
113
135
for bin in openshift
114
136
do
115
137
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
117
141
done
118
142
119
143
install -d -m 0755 %{buildroot }/etc/%{name }
@@ -195,6 +219,12 @@ if [ "$1" = 0 ]; then
195
219
/usr/sbin/tuned-adm profile $recommended > /dev/null 2>&1
196
220
fi
197
221
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
+
198
228
199
229
%changelog
200
230
*
Mon Jan 26 2015 Scott Dodson <[email protected] > 0.2-3
0 commit comments