cri-tools/cri-tools.spec

83 lines
2.5 KiB
RPMSpec

#
# spec file for package cri-tools
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define project github.com/kubernetes-incubator/cri-tools
%define commit 653cc8c6509c540b8a7c6f6b43e437c0687a93a7
# rev_list = git rev-list commit | wc -l
%define rev_list 360
Name: cri-tools
Version: 1.0.0alpha+git%{rev_list}
Release: 0
Summary: CLI and validation tools for Kubelet Container Runtime Interface
License: Apache-2.0
Group: System/Management
Url: https://%{project}
Source0: %{name}-git.%{commit}.tar.xz
BuildRequires: go-go-md2man
BuildRequires: golang-packaging
BuildRequires: golang(API) >= 1.7
# disable stripping of binaries
%{go_nostrip}
%description
cri-tools provides a series of debugging and validation tools for
Kubelet CRI, which includes:
- crictl: CLI for kubelet CRI
- critest: validation test suites for kubelet CRI
%prep
%setup -q -n %{name}-git.%{commit}
%build
export GOPATH=$HOME/go
mkdir -pv $HOME/go/src/%{project}
rm -rf $HOME/go/src/%{project}/*
cp -avr * $HOME/go/src/%{project}
cd $HOME/go/src/%{project}
go build -buildmode=pie \
-o bin/crictl \
%{project}/cmd/crictl
go build -buildmode=pie \
-o bin/critest \
%{project}/cmd/critest
# compile the manpages
for md in docs/*.md
do
go-md2man -in $md -out $md
done
rename '.md' '.1' docs/*
%install
cd $HOME/go/src/%{project}
install -D -m 0755 bin/crictl %{buildroot}/%{_bindir}/crictl
install -D -m 0755 bin/critest %{buildroot}/%{_bindir}/critest
install -d %{buildroot}/%{_mandir}/man1
install -D -m 0644 docs/crictl.1 %{buildroot}/%{_mandir}/man1/crictl.1
install -D -m 0644 docs/benchmark.1 %{buildroot}/%{_mandir}/man1/critest-benchmark.1
install -D -m 0644 docs/validation.1 %{buildroot}/%{_mandir}/man1/critest-validation.1
%files
%{_bindir}/crictl
%{_bindir}/critest
%{_mandir}/man1/*
%changelog