Skip to content

Commit

Permalink
Merge pull request #2712 from xmudrii/kubepkg-fix-rpms
Browse files Browse the repository at this point in the history
Ensure it's possible to build rpms generated by kubepkg
  • Loading branch information
k8s-ci-robot authored Oct 17, 2022
2 parents 77744ef + e989d08 commit d182780
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 61 deletions.
15 changes: 2 additions & 13 deletions cmd/kubepkg/templates/latest/rpm/cri-tools/cri-tools.spec
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,13 @@ BuildRequires: curl
Command-line utility for interacting with a container runtime.

%prep
%setup -c -a 7 -T -n cri-tools

# TODO: Do we need these?
#%autosetup
#%build
#%configure
#%make_build
%setup -c -a 0 -T -n cri-tools

%install
# TODO: Do we need this?
#rm -rf $RPM_BUILD_ROOT

cd %{_builddir}
mkdir -p %{buildroot}%{_bindir}
install -p -m 755 -t %{buildroot}%{_bindir}/ cri-tools/crictl

# TODO: Do we need this?
#%make_install

%files
%{_bindir}/crictl

Expand Down
16 changes: 4 additions & 12 deletions cmd/kubepkg/templates/latest/rpm/kubeadm/kubeadm.spec
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,16 @@ Command-line utility for administering a Kubernetes cluster.
cp -p %SOURCE0 %{_builddir}/
cp -p %SOURCE1 %{_builddir}/

# TODO: Do we need these?
#%autosetup
#%build
#%configure
#%make_build

%install
# TODO: Do we need this?
#rm -rf $RPM_BUILD_ROOT

cd %{_builddir}
mkdir -p %{buildroot}%{_sysconfdir}/kubernetes/manifests/
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_unitdir}/kubelet.service.d

install -m 755 -d %{buildroot}%{_sysconfdir}/kubernetes/manifests/
install -p -m 755 -t %{buildroot}%{_bindir}/ kubeadm
install -p -m 644 -t %{buildroot}%{_unitdir}/kubelet.service.d/ 10-kubeadm.conf

# TODO: Do we need this?
#%make_install

%files
%{_bindir}/kubeadm
%{_unitdir}/kubelet.service.d/10-kubeadm.conf
Expand Down
12 changes: 1 addition & 11 deletions cmd/kubepkg/templates/latest/rpm/kubectl/kubectl.spec
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,12 @@ Command-line utility for interacting with a Kubernetes cluster.
%prep
cp -p %SOURCE0 %{_builddir}/

# TODO: Do we need these?
#%autosetup
#%build
#%configure
#%make_build

%install
# TODO: Do we need this?
#rm -rf $RPM_BUILD_ROOT

cd %{_builddir}
mkdir -p %{buildroot}/%{_bindir}
install -p -m 755 -t %{buildroot}%{_bindir}/ kubectl

# TODO: Do we need this?
#%make_install

%files
%{_bindir}/kubectl

Expand Down
21 changes: 9 additions & 12 deletions cmd/kubepkg/templates/latest/rpm/kubelet/kubelet.spec
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Summary: Container cluster management
License: ASL 2.0
URL: https://kubernetes.io
Source0: {{ .DownloadLinkBase }}/bin/linux/{{ .GoArch }}/kubelet
Source1: kubelet.env
Source2: kubelet.service

BuildRequires: systemd
BuildRequires: curl
Expand All @@ -23,18 +25,16 @@ The node agent of Kubernetes, the container cluster manager.

%prep
cp -p %SOURCE0 %{_builddir}/

# TODO: Do we need these?
#%autosetup
#%build
#%configure
#%make_build
cp -p %SOURCE1 %{_builddir}/
cp -p %SOURCE2 %{_builddir}/

%install
# TODO: Do we need this?
#rm -rf $RPM_BUILD_ROOT

cd %{_builddir}
mkdir -p %{buildroot}%{_unitdir}/kubelet.service.d/
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}/var/lib/kubelet/
mkdir -p %{buildroot}%{_sysconfdir}/sysconfig/

install -m 755 -d %{buildroot}%{_unitdir}
install -m 755 -d %{buildroot}%{_unitdir}/kubelet.service.d/
install -m 755 -d %{buildroot}%{_bindir}
Expand All @@ -44,9 +44,6 @@ install -p -m 644 -t %{buildroot}%{_unitdir}/ kubelet.service
install -m 755 -d %{buildroot}%{_sysconfdir}/sysconfig/
install -p -m 644 -T kubelet.env %{buildroot}%{_sysconfdir}/sysconfig/kubelet

# TODO: Do we need this?
#%make_install

%files
%{_bindir}/kubelet
%{_unitdir}/kubelet.service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,16 @@ Requires: kubelet
Binaries required to provision container networking.

%prep
%setup -c -D -T -a 5 -n cni-plugins

# TODO: Do we need these?
#%autosetup
#%build
#%configure
#%make_build
%setup -c -D -T -a 0 -n cni-plugins

%install
# TODO: Do we need this?
#rm -rf $RPM_BUILD_ROOT

cd %{_builddir}
mkdir -p %{buildroot}%{_sysconfdir}/cni/net.d/
mkdir -p %{buildroot}/opt/cni/bin
install -m 755 -d %{buildroot}%{_sysconfdir}/cni/net.d/
install -m 755 -d %{buildroot}/opt/cni/bin
mv cni-plugins/* %{buildroot}/opt/cni/bin/

# TODO: Do we need this?
#%make_install

%files
/opt/cni

Expand Down

0 comments on commit d182780

Please sign in to comment.