Browse code

build oc, move to clients, move alt clients to redistributable

Troy Dawson authored on 2015/09/24 02:38:02
Showing 1 changed files
... ...
@@ -42,6 +42,7 @@ ExclusiveArch:  x86_64
42 42
 Source0:        https://%{import_path}/archive/%{commit}/%{name}-%{version}.tar.gz
43 43
 BuildRequires:  systemd
44 44
 BuildRequires:  golang >= 1.4
45
+Requires:       %{name}-clients = %{version}-%{release}
45 46
 Obsoletes:      openshift < 1.0.6
46 47
 
47 48
 %description
... ...
@@ -83,12 +84,19 @@ Obsoletes:      tuned-profiles-openshift-node < 1.0.6
83 83
 %{summary}
84 84
 
85 85
 %package clients
86
+Summary:        %{product_name} Client binaries for Linux
87
+Obsoletes:      openshift-clients < 1.0.6
88
+
89
+%description clients
90
+%{summary}
91
+
92
+%package clients-redistributable
86 93
 Summary:        %{product_name} Client binaries for Linux, Mac OSX, and Windows
87 94
 BuildRequires:  golang-pkg-darwin-amd64
88 95
 BuildRequires:  golang-pkg-windows-386
89
-Obsoletes:      openshift-clients < 1.0.6
96
+Obsoletes:      openshift-clients-redistributable < 1.0.6
90 97
 
91
-%description clients
98
+%description clients-redistributable
92 99
 %{summary}
93 100
 
94 101
 %package dockerregistry
... ...
@@ -141,15 +149,14 @@ pushd _thirdpartyhacks
141 141
 popd
142 142
 export GOPATH=$(pwd)/_build:$(pwd)/_thirdpartyhacks:%{buildroot}%{gopath}:%{gopath}
143 143
 # Build all linux components we care about
144
-for cmd in openshift dockerregistry
144
+for cmd in oc openshift dockerregistry
145 145
 do
146 146
         go install -ldflags "%{ldflags}" %{import_path}/cmd/${cmd}
147 147
 done
148 148
 
149 149
 # Build clients for other platforms
150
-# TODO: build cmd/oc instead of openshift
151
-GOOS=windows GOARCH=386 go install -ldflags "%{ldflags}" %{import_path}/cmd/openshift
152
-GOOS=darwin GOARCH=amd64 go install -ldflags "%{ldflags}" %{import_path}/cmd/openshift
150
+GOOS=windows GOARCH=386 go install -ldflags "%{ldflags}" %{import_path}/cmd/oc
151
+GOOS=darwin GOARCH=amd64 go install -ldflags "%{ldflags}" %{import_path}/cmd/oc
153 152
 
154 153
 #Build our pod
155 154
 pushd images/pod/
... ...
@@ -161,7 +168,7 @@ popd
161 161
 install -d %{buildroot}%{_bindir}
162 162
 
163 163
 # Install linux components
164
-for bin in openshift dockerregistry
164
+for bin in oc openshift dockerregistry
165 165
 do
166 166
   echo "+++ INSTALLING ${bin}"
167 167
   install -p -m 755 _build/bin/${bin} %{buildroot}%{_bindir}/${bin}
... ...
@@ -169,9 +176,9 @@ done
169 169
 
170 170
 # Install client executable for windows and mac
171 171
 install -d %{buildroot}%{_datadir}/%{name}/{linux,macosx,windows}
172
-install -p -m 755 _build/bin/openshift %{buildroot}%{_datadir}/%{name}/linux/oc
173
-install -p -m 755 _build/bin/darwin_amd64/openshift %{buildroot}/%{_datadir}/%{name}/macosx/oc
174
-install -p -m 755 _build/bin/windows_386/openshift.exe %{buildroot}/%{_datadir}/%{name}/windows/oc.exe
172
+install -p -m 755 _build/bin/oc %{buildroot}%{_datadir}/%{name}/linux/oc
173
+install -p -m 755 _build/bin/darwin_amd64/oc %{buildroot}/%{_datadir}/%{name}/macosx/oc
174
+install -p -m 755 _build/bin/windows_386/oc.exe %{buildroot}/%{_datadir}/%{name}/windows/oc.exe
175 175
 
176 176
 #Install pod
177 177
 install -p -m 755 images/pod/pod %{buildroot}%{_bindir}/
... ...
@@ -180,11 +187,13 @@ install -d -m 0755 %{buildroot}%{_unitdir}
180 180
 
181 181
 mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
182 182
 
183
-for cmd in oc openshift-router openshift-deploy openshift-sti-build openshift-docker-build origin atomic-enterprise \
184
-  oadm kubectl kubernetes kubelet kube-proxy kube-apiserver kube-controller-manager kube-scheduler ; do
183
+for cmd in openshift-router openshift-deploy openshift-sti-build openshift-docker-build origin atomic-enterprise \
184
+  oadm kubernetes kubelet kube-proxy kube-apiserver kube-controller-manager kube-scheduler ; do
185 185
     ln -s %{_bindir}/openshift %{buildroot}%{_bindir}/$cmd
186 186
 done
187 187
 
188
+ln -s %{_bindir}/oc %{buildroot}%{_bindir}/kubectl
189
+
188 190
 install -d -m 0755 %{buildroot}%{_sysconfdir}/origin/{master,node}
189 191
 
190 192
 # different service for origin vs aos
... ...
@@ -226,7 +235,6 @@ install -p -m 644 rel-eng/completions/bash/* %{buildroot}%{_sysconfdir}/bash_com
226 226
 %files
227 227
 %defattr(-,root,root,-)
228 228
 %doc README.md LICENSE
229
-%{_bindir}/oc
230 229
 %{_bindir}/openshift
231 230
 %{_bindir}/openshift-router
232 231
 %{_bindir}/openshift-deploy
... ...
@@ -235,7 +243,6 @@ install -p -m 644 rel-eng/completions/bash/* %{buildroot}%{_sysconfdir}/bash_com
235 235
 %{_bindir}/origin
236 236
 %{_bindir}/atomic-enterprise
237 237
 %{_bindir}/oadm
238
-%{_bindir}/kubectl
239 238
 %{_bindir}/kubernetes
240 239
 %{_bindir}/kubelet
241 240
 %{_bindir}/kube-proxy
... ...
@@ -365,6 +372,10 @@ if [ "$1" = 0 ]; then
365 365
 fi
366 366
 
367 367
 %files clients
368
+%{_bindir}/oc
369
+%{_bindir}/kubectl
370
+
371
+%files clients-redistributable
368 372
 %{_datadir}/%{name}/linux/oc
369 373
 %{_datadir}/%{name}/macosx/oc
370 374
 %{_datadir}/%{name}/windows/oc.exe