beef130
#debuginfo not supported with Go
beef130
%global debug_package	%{nil}
beef130
%global import_path	github.com/GoogleCloudPlatform/kubernetes
Eric Paris 45b1935
%global commit		c6158b8aa9c40fbf1732650a8611429536466b21
beef130
%global shortcommit	%(c=%{commit}; echo ${c:0:7})
beef130
beef130
#I really need this, otherwise "version_ldflags=$(kube::version_ldflags)"
beef130
# does not work
beef130
%global _buildshell	/bin/bash
beef130
%global _checkshell	/bin/bash
beef130
beef130
Name:		kubernetes
Eric Paris 64689e5
Version:	0.5
Eric Paris 45b1935
Release:	65.0.git%{shortcommit}%{?dist}
beef130
Summary:	Container cluster management
beef130
License:	ASL 2.0
beef130
URL:		https://github.com/GoogleCloudPlatform/kubernetes
beef130
ExclusiveArch:	x86_64
beef130
Source0:	https://github.com/GoogleCloudPlatform/kubernetes/archive/%{commit}/kubernetes-%{shortcommit}.tar.gz
beef130
Eric Paris 2cc6e51
%if 0%{?fedora}
beef130
Patch1:		0001-remove-all-third-party-software.patch
Eric Paris 45b1935
Patch2:		0002-revert-to-code.google.com-p-go.net-until-fedora-pack.patch
Eric Paris 2cc6e51
%endif
beef130
beef130
%if 0%{?fedora} >= 21 || 0%{?rhel}
beef130
Requires:	docker
beef130
%else
beef130
Requires:	docker-io
beef130
%endif
beef130
beef130
Requires:	etcd
beef130
Requires:	cadvisor
beef130
beef130
Requires(pre):	shadow-utils
beef130
beef130
BuildRequires:	git
beef130
BuildRequires:	golang >= 1.2-7
beef130
BuildRequires:	systemd
beef130
BuildRequires:	golang-cover
beef130
BuildRequires:	etcd
Eric Paris 2cc6e51
Eric Paris 2cc6e51
%if 0%{?fedora}
Eric Paris 2bc7465
BuildRequires:	golang(code.google.com/p/gcfg)
beef130
BuildRequires:	golang(code.google.com/p/goauth2)
Eric Paris 2bc7465
BuildRequires:	golang(code.google.com/p/go.net/context)
Eric Paris 2bc7465
BuildRequires:	golang(code.google.com/p/go.net/html)
Eric Paris 2bc7465
BuildRequires:	golang(code.google.com/p/go.net/websocket)
Eric Paris 06beba7
BuildRequires:	golang(code.google.com/p/google-api-go-client) > 0-0.3
Eric Paris 2bc7465
BuildRequires:	golang(code.google.com/p/go-uuid)
Eric Paris 2bc7465
BuildRequires:	golang(github.com/coreos/go-etcd/etcd)
Eric Paris 2bc7465
BuildRequires:	golang(github.com/elazarl/go-bindata-assetfs)
Eric Paris 06beba7
BuildRequires:	golang(github.com/emicklei/go-restful)
beef130
BuildRequires:	golang(github.com/fsouza/go-dockerclient) > 0-0.6
beef130
BuildRequires:	golang(github.com/golang/glog)
beef130
BuildRequires:	golang(github.com/google/cadvisor)
Eric Paris 2bc7465
BuildRequires:	golang(github.com/google/gofuzz)
Eric Paris 2bc7465
BuildRequires:	golang(github.com/kr/text)
beef130
BuildRequires:	golang(github.com/mitchellh/goamz/aws)
beef130
BuildRequires:	golang(github.com/mitchellh/goamz/ec2)
Eric Paris 2bc7465
BuildRequires:	golang(github.com/mitchellh/mapstructure)
Eric Paris 2bc7465
BuildRequires:	golang(github.com/racker/perigee)
Eric Paris 2bc7465
BuildRequires:	golang(github.com/rackspace/gophercloud)
Eric Paris 6cf9084
BuildRequires:	golang(github.com/skratchdot/open-golang/open)
Eric Paris 2bc7465
BuildRequires:	golang(github.com/spf13/cobra)
Eric Paris 2bc7465
BuildRequires:	golang(github.com/spf13/pflag)
Eric Paris 2bc7465
BuildRequires:	golang(github.com/stretchr/objx)
Eric Paris 2bc7465
BuildRequires:	golang(github.com/stretchr/testify)
Eric Paris 2bc7465
BuildRequires:	golang(github.com/tonnerre/golang-pretty)
Eric Paris 2bc7465
BuildRequires:	golang(github.com/vaughan0/go-ini)
Eric Paris 2bc7465
BuildRequires:	golang(gopkg.in/v1/yaml)
Eric Paris 2cc6e51
%endif
beef130
beef130
%description
beef130
%{summary}
beef130
beef130
%prep
beef130
%autosetup -Sgit -n %{name}-%{commit}
beef130
beef130
%build
beef130
export KUBE_GIT_COMMIT=%{commit}
Eric Paris 45b1935
export KUBE_GIT_VERSION=v0.5-65-gc6158b8aa9c40f
beef130
Eric Paris 2cc6e51
%if 0%{?fedora}
Eric Paris 2cc6e51
export KUBE_GIT_TREE_STATE="dirty"
beef130
export KUBE_EXTRA_GOPATH=%{gopath}
beef130
export KUBE_NO_GODEPS="true"
Eric Paris 2cc6e51
%endif
beef130
Eric Paris 136cda1
hack/build-go.sh --use_go_build
Eric Paris b196e11
beef130
%check
Eric Paris 2cc6e51
%if 0%{?fedora}
beef130
export KUBE_EXTRA_GOPATH=%{gopath}
beef130
export KUBE_NO_GODEPS="true"
Eric Paris 2cc6e51
%endif
Eric Paris b196e11
beef130
echo "******Testing the commands*****"
beef130
hack/test-cmd.sh
Eric Paris 2cc6e51
echo "******Benchmarking kube********"
Eric Paris 2cc6e51
hack/benchmark-go.sh
Eric Paris 2cc6e51
beef130
# In Fedora 20 and RHEL7 the go cover tools isn't available correctly
beef130
%if 0%{?fedora} >= 21
beef130
echo "******Testing the go code******"
beef130
hack/test-go.sh
beef130
echo "******Testing integration******"
Eric Paris 136cda1
hack/test-integration.sh --use_go_build
beef130
%endif
beef130
beef130
%install
Eric Paris b196e11
. hack/lib/init.sh
Eric Paris b196e11
kube::golang::setup_env
Eric Paris b196e11
Eric Paris b196e11
output_path="${KUBE_OUTPUT_BINPATH}/$(kube::golang::current_platform)"
Eric Paris b196e11
Eric Paris 64689e5
binaries=(kube-apiserver kube-controller-manager kube-scheduler kube-proxy kubelet kubectl)
beef130
install -m 755 -d %{buildroot}%{_bindir}
Eric Paris 64689e5
for bin in "${binaries[@]}"; do
beef130
  echo "+++ INSTALLING ${bin}"
Eric Paris 64689e5
  install -p -m 755 -t %{buildroot}%{_bindir} ${output_path}/${bin}
beef130
done
beef130
beef130
# install the bash completion
beef130
install -d -m 0755 %{buildroot}%{_datadir}/bash-completion/completions/
Eric Paris c335feb
install -t %{buildroot}%{_datadir}/bash-completion/completions/ contrib/completions/bash/kubectl
beef130
beef130
# install config files
beef130
install -d -m 0755 %{buildroot}%{_sysconfdir}/%{name}
Eric Paris 4596a26
install -m 644 -t %{buildroot}%{_sysconfdir}/%{name} contrib/init/systemd/environ/*
beef130
beef130
# install service files
beef130
install -d -m 0755 %{buildroot}%{_unitdir}
Eric Paris 4596a26
install -m 0644 -t %{buildroot}%{_unitdir} contrib/init/systemd/*.service
beef130
Eric Paris 6cf9084
# install manpages
Eric Paris 6cf9084
install -d %{buildroot}%{_mandir}/man1
Eric Paris 6cf9084
install -p -m 644 docs/man/man1/* %{buildroot}%{_mandir}/man1
Eric Paris 6cf9084
0fced5c
# install the place the kubelet defaults to put volumes
0fced5c
install -d %{buildroot}/var/lib/kubelet
0fced5c
beef130
%files
beef130
%doc README.md LICENSE CONTRIB.md CONTRIBUTING.md DESIGN.md
Eric Paris 6cf9084
%{_mandir}/man1/*
beef130
%{_bindir}/kube-apiserver
Eric Paris 2bc7465
%{_bindir}/kubectl
beef130
%{_bindir}/kube-controller-manager
beef130
%{_bindir}/kubelet
beef130
%{_bindir}/kube-proxy
beef130
%{_bindir}/kube-scheduler
beef130
%{_unitdir}/kube-apiserver.service
beef130
%{_unitdir}/kubelet.service
beef130
%{_unitdir}/kube-scheduler.service
beef130
%{_unitdir}/kube-controller-manager.service
beef130
%{_unitdir}/kube-proxy.service
beef130
%dir %{_sysconfdir}/%{name}
Eric Paris 4596a26
%{_datadir}/bash-completion/completions/kubectl
0fced5c
%dir /var/lib/kubelet
beef130
%config(noreplace) %{_sysconfdir}/%{name}/config
beef130
%config(noreplace) %{_sysconfdir}/%{name}/apiserver
beef130
%config(noreplace) %{_sysconfdir}/%{name}/controller-manager
beef130
%config(noreplace) %{_sysconfdir}/%{name}/proxy
beef130
%config(noreplace) %{_sysconfdir}/%{name}/kubelet
beef130
%config(noreplace) %{_sysconfdir}/%{name}/scheduler
beef130
beef130
%pre
beef130
getent group kube >/dev/null || groupadd -r kube
beef130
getent passwd kube >/dev/null || useradd -r -g kube -d / -s /sbin/nologin \
beef130
        -c "Kubernetes user" kube
beef130
%post
Eric Paris c335feb
%systemd_post kube-apiserver kube-scheduler kube-controller-manager kubelet kube-proxy
beef130
beef130
%preun
Eric Paris c335feb
%systemd_preun kube-apiserver kube-scheduler kube-controller-manager kubelet kube-proxy
beef130
beef130
%postun
beef130
%systemd_postun
beef130
beef130
%changelog
Eric Paris 45b1935
* Thu Nov 20 2014 Eric Paris <eparis@redhat.com> - 0.5-65.0.gitc6158b8
Eric Paris 45b1935
- Bump to upstream c6158b8aa9c40fbf1732650a8611429536466b21
Eric Paris 06beba7
- include go-restful build requirement
Eric Paris 45b1935
Eric Paris 64689e5
* Tue Nov 18 2014 Eric Paris <eparis@redhat.com> - 0.5-14.0.gitdf0981b
Eric Paris 64689e5
- Bump to upstream df0981bc01c5782ad30fc45cb6f510f365737fc1
Eric Paris 64689e5
Eric Paris 63dea91
* Tue Nov 11 2014 Eric Paris <eparis@redhat.com> - 0.4-680.0.git30fcf24
Eric Paris 63dea91
- Bump to upstream 30fcf241312f6d0767c7d9305b4c462f1655f790
Eric Paris 63dea91
Eric Paris ac1c449
* Mon Nov 10 2014 Eric Paris <eparis@redhat.com> - 0.4-633.0.git6c70227
Eric Paris ac1c449
- Bump to upstream 6c70227a2eccc23966d32ea6d558ee05df46e400
Eric Paris ac1c449
Eric Paris b2a24d6
* Fri Nov 07 2014 Eric Paris <eparis@redhat.com> - 0.4-595.0.gitb695650
Eric Paris b2a24d6
- Bump to upstream b6956506fa2682afa93770a58ea8c7ba4b4caec1
Eric Paris b2a24d6
Eric Paris 2cc6e51
* Thu Nov 06 2014 Eric Paris <eparis@redhat.com> - 0.4-567.0.git3b1ef73
Eric Paris 2cc6e51
- Bump to upstream 3b1ef739d1fb32a822a22216fb965e22cdd28e7f
Eric Paris 2cc6e51
Eric Paris 2cc6e51
* Thu Nov 06 2014 Eric Paris <eparis@redhat.com> - 0.4-561.0.git06633bf
Eric Paris 2cc6e51
- Bump to upstream 06633bf4cdc1ebd4fc848f85025e14a794b017b4
Eric Paris 2cc6e51
- Make spec file more RHEL/CentOS friendly
Eric Paris 2cc6e51
Eric Paris 136cda1
* Tue Nov 04 2014 Eric Paris 
Eric Paris 136cda1
- Bump to upstream 5a649f2b9360a756fc8124897d3453a5fa9473a6
Eric Paris 136cda1
Eric Paris a933945
* Mon Nov 03 2014 Eric Paris 
Eric Paris a933945
- Bump to upstream a4abafea02babc529c9b5b9c825ba0bb3eec74c6
Eric Paris a933945
Eric Paris b196e11
* Mon Nov 03 2014 Eric Paris 
Eric Paris b196e11
- Bump to upstream 808be2d13b7bf14a3cf6985bc7c9d02f48a3d1e0
Eric Paris b196e11
- Includes upstream change to remove --machines from the APIServer
Eric Paris b196e11
- Port to new build system
Eric Paris 6d7725e
- Start running %check tests again
Eric Paris 6d7725e
Eric Paris c638c2e
* Fri Oct 31 2014 Eric Paris 
Eric Paris c638c2e
- Bump to upstream a18cdac616962a2c486feb22afa3538fc3cf3a3a
Eric Paris c638c2e
Eric Paris 109846f
* Thu Oct 30 2014 Eric Paris 
Eric Paris 109846f
- Bump to upstream 78df01172af5cc132b7276afb668d31e91e61c11
Eric Paris 109846f
Eric Paris 98657e1
* Wed Oct 29 2014 Eric Paris 
Eric Paris 98657e1
- Bump to upstream 8e1d41670783cb75cf0c5088f199961a7d8e05e5
Eric Paris 98657e1
Eric Paris 904dfa7
* Tue Oct 28 2014 Eric Paris 
Eric Paris 904dfa7
- Bump to upstream 1c61486ec343246a81f62b4297671217c9576df7
Eric Paris 904dfa7
Eric Paris 2b03304
* Mon Oct 27 2014 Eric Paris 
Eric Paris 2b03304
- Bump to upstream dc7e3d6601a89e9017ca9db42c09fd0ecb36bb36
Eric Paris 2b03304
Eric Paris f86849e
* Fri Oct 24 2014 Eric Paris 
Eric Paris f86849e
- Bump to upstream e46af6e37f6e6965a63edb8eb8f115ae8ef41482
Eric Paris f86849e
Eric Paris bd32eac
* Thu Oct 23 2014 Eric Paris 
Eric Paris bd32eac
- Bump to upstream 77d2815b86e9581393d7de4379759c536df89edc
Eric Paris bd32eac
Eric Paris c335feb
* Wed Oct 22 2014 Eric Paris 
Eric Paris c335feb
- Bump to upstream 97dd7302ac2c2b9458a9348462a614ebf394b1ed
Eric Paris c335feb
- Use upstream kubectl bash completion instead of in-repo
Eric Paris c335feb
- Fix systemd_post and systemd_preun since we are using upstream service files
Eric Paris c335feb
Eric Paris d21193a
* Tue Oct 21 2014 Eric Paris 
Eric Paris d21193a
- Bump to upstream e8686429c4aa63fc73401259c8818da168a7b85e
Eric Paris d21193a
Eric Paris 4596a26
* Mon Oct 20 2014 Eric Paris 
Eric Paris 4596a26
- Bump to upstream d5377e4a394b4fc6e3088634729b538eac124b1b
Eric Paris 4596a26
- Use in tree systemd unit and Environment files
Eric Paris 4596a26
- Include kubectl bash completion from outside tree
Eric Paris 4596a26
Eric Paris 2bc7465
* Fri Oct 17 2014 Eric Paris 
Eric Paris 2bc7465
- Bump to upstream b01126322b826a15db06f6eeefeeb56dc06db7af
Eric Paris 2bc7465
- This is a major non backward compatible change.
Eric Paris 2bc7465
Eric Paris 6cf9084
* Thu Oct 16 2014 Eric Paris <eparis@redhat.com> - 0.4-0.0.git4452163
Eric Paris 6cf9084
- rebase to v0.4
Eric Paris 6cf9084
- include man pages
Eric Paris 6cf9084
0fced5c
* Tue Oct 14 2014 jchaloup <jchaloup@redhat.com> - 0.3-0.3.git98ac8e1
0fced5c
- create /var/lib/kubelet
0fced5c
- Use bash completions from upstream
0fced5c
- Bump to upstream 98ac8e178fcf1627399d659889bcb5fe25abdca4
0fced5c
- all by Eric Paris
0fced5c
beef130
* Mon Sep 29 2014 Jan Chaloupka <jchaloup@redhat.com> - 0.3-0.2.git88fdb65
beef130
- replace * with coresponding files
beef130
- remove dependency on gcc
beef130
beef130
* Wed Sep 24 2014 Eric Paris 
beef130
- Bump to upstream 88fdb659bc44cf2d1895c03f8838d36f4d890796
beef130
beef130
* Tue Sep 23 2014 Eric Paris 
beef130
- Bump to upstream bab5082a852218bb65aaacb91bdf599f9dd1b3ac
beef130
beef130
* Fri Sep 19 2014 Eric Paris 
beef130
- Bump to upstream 06316f486127697d5c2f5f4c82963dec272926cf
beef130
beef130
* Thu Sep 18 2014 Eric Paris 
beef130
- Bump to upstream f7a5ec3c36bd40cc2216c1da331ab647733769dd
beef130
beef130
* Wed Sep 17 2014 Eric Paris 
beef130
- Try to intelligently determine the deps
beef130
beef130
* Wed Sep 17 2014 Eric Paris 
beef130
- Bump to upstream ac8ee45f4fc4579b3ed65faafa618de9c0f8fb26
beef130
beef130
* Mon Sep 15 2014 Eric Paris 
beef130
- Bump to upstream 24b5b7e8d3a8af1eecf4db40c204e3c15ae955ba
beef130
beef130
* Thu Sep 11 2014 Eric Paris 
beef130
- Bump to upstream cc7999c00a40df21bd3b5e85ecea3b817377b231
beef130
beef130
* Wed Sep 10 2014 Eric Paris 
beef130
- Add bash completions
beef130
beef130
* Wed Sep 10 2014 Eric Paris 
beef130
- Bump to upstream 60d4770127d22e51c53e74ca94c3639702924bd2
beef130
beef130
* Mon Sep 08 2014 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0.1-0.4.git6ebe69a
beef130
- prefer autosetup instead of setup (revert setup change in 0-0.3.git)
beef130
https://fedoraproject.org/wiki/Autosetup_packaging_draft
beef130
- revert version number to 0.1
beef130
beef130
* Mon Sep 08 2014 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0-0.3.git6ebe69a
beef130
- gopath defined in golang package already
beef130
- package owns /etc/kubernetes
beef130
- bash dependency implicit
beef130
- keep buildroot/$RPM_BUILD_ROOT macros consistent
beef130
- replace with macros wherever possible
beef130
- set version, release and source tarball prep as per
beef130
https://fedoraproject.org/wiki/Packaging:SourceURL#Github
beef130
beef130
* Mon Sep 08 2014 Eric Paris <eparis@redhat.com>
beef130
- make services restart automatically on error
beef130
beef130
* Sat Sep 06 2014 Eric Paris 
beef130
- Bump to upstream 6ebe69a8751508c11d0db4dceb8ecab0c2c7314a
beef130
beef130
* Wed Aug 13 2014 Eric Paris <eparis@redhat.com>
beef130
- update to upstream
beef130
- redo build to use project scripts
beef130
- use project scripts in %check
beef130
- rework deletion of third_party packages to easily detect changes
beef130
- run apiserver and controller-manager as non-root
beef130
beef130
* Mon Aug 11 2014 Adam Miller <maxamillion@redhat.com>
beef130
- update to upstream
beef130
- decouple the rest of third_party
beef130
beef130
* Thu Aug 7 2014 Eric Paris <eparis@redhat.com>
beef130
- update to head
beef130
- update package to include config files
beef130
beef130
* Wed Jul 16 2014 Colin Walters <walters@redhat.com>
beef130
- Initial package