forked from openshift/kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
openshift.spec
129 lines (110 loc) · 3.56 KB
/
openshift.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#debuginfo not supported with Go
%global debug_package %{nil}
# modifying the Go binaries breaks the DWARF debugging
%global __os_install_post %{_rpmconfigdir}/brp-compress
%global gopath %{_datadir}/gocode
%global import_path k8s.io/kubernetes
%global golang_version 1.15
%{!?commit:
# DO NOT MODIFY: the value on the line below is sed-like replaced by openshift/doozer
%global commit 86b5e46426ba828f49195af21c56f7c6674b48f7
}
%global shortcommit %(c=%{commit}; echo ${c:0:7})
# DO NOT MODIFY: the value on the line below is sed-like replaced by openshift/doozer
%{!?os_git_vars:
%global os_git_vars OS_GIT_VERSION='' OS_GIT_COMMIT='' OS_GIT_MAJOR='' OS_GIT_MINOR='' OS_GIT_TREE_STATE=''
}
%if 0%{?skip_build}
%global do_build 0
%else
%global do_build 1
%endif
%if 0%{?skip_prep}
%global do_prep 0
%else
%global do_prep 1
%endif
%if 0%{?skip_dist}
%global package_dist %{nil}
%else
%global package_dist %{dist}
%endif
%{!?version: %global version 4.0.0}
%{!?release: %global release 1}
Name: openshift
Version: %{version}
Release: %{release}%{package_dist}
Summary: Open Source Container Management by Red Hat
License: ASL 2.0
URL: https://%{import_path}
# If go_arches not defined fall through to implicit golang archs
%if 0%{?go_arches:1}
ExclusiveArch: %{go_arches}
%else
ExclusiveArch: x86_64 aarch64 ppc64le s390x
%endif
# TODO(marun) tar archives are no longer published for 4.x. Should this value be removed?
Source0: https://%{import_path}/archive/%{commit}/%{name}-%{version}.tar.gz
BuildRequires: systemd
BuildRequires: bsdtar
BuildRequires: golang >= %{golang_version}
BuildRequires: krb5-devel
BuildRequires: rsync
%description
OpenShift is a distribution of Kubernetes optimized for enterprise application
development and deployment. OpenShift adds developer and operational centric
tools on top of Kubernetes to enable rapid application development, easy
deployment and scaling, and long-term lifecycle maintenance for small and large
teams and applications. It provides a secure and multi-tenant configuration for
Kubernetes allowing you to safely host many different applications and workloads
on a unified cluster.
%package hyperkube
Summary: OpenShift Kubernetes server commands
Requires: util-linux
Requires: socat
Requires: iptables
Provides: hyperkube = %{version}
Obsoletes: atomic-openshift-hyperkube <= %{version}
Obsoletes: atomic-openshift-node <= %{version}
%description hyperkube
%{summary}
%prep
%if 0%{do_prep}
%setup -q
%endif
%build
%if 0%{do_build}
# Create Binaries only for building arch
%ifarch x86_64
BUILD_PLATFORM="linux/amd64"
%endif
%ifarch ppc64le
BUILD_PLATFORM="linux/ppc64le"
%endif
%ifarch %{arm} aarch64
BUILD_PLATFORM="linux/arm64"
%endif
%ifarch s390x
BUILD_PLATFORM="linux/s390x"
%endif
KUBE_BUILD_PLATFORMS="${BUILD_PLATFORM}" %{os_git_vars} make all WHAT='cmd/kube-apiserver cmd/kube-controller-manager cmd/kube-scheduler cmd/kubelet'
%endif
%install
PLATFORM="$(go env GOHOSTOS)/$(go env GOHOSTARCH)"
install -d %{buildroot}%{_bindir}
# Install linux components
for bin in kube-apiserver kube-controller-manager kube-scheduler kubelet
do
echo "+++ INSTALLING ${bin}"
install -p -m 755 _output/local/bin/${PLATFORM}/${bin} %{buildroot}%{_bindir}/${bin}
done
install -p -m 755 openshift-hack/images/hyperkube/hyperkube %{buildroot}%{_bindir}/hyperkube
%files hyperkube
%license LICENSE
%{_bindir}/hyperkube
%{_bindir}/kube-apiserver
%{_bindir}/kube-controller-manager
%{_bindir}/kube-scheduler
%{_bindir}/kubelet
%defattr(-,root,root,0700)
%changelog