2017-09-11 14:29:16 +03:00
|
|
|
%global dist_version 0.2.5
|
2016-06-17 15:20:11 +03:00
|
|
|
|
|
|
|
%global provider github
|
|
|
|
%global provider_tld com
|
2017-09-11 14:29:16 +03:00
|
|
|
|
|
|
|
%define project containerd
|
2016-06-17 15:20:11 +03:00
|
|
|
%global repo containerd
|
2017-09-11 14:29:16 +03:00
|
|
|
|
2016-06-17 15:20:11 +03:00
|
|
|
%global import_path %{provider}.%{provider_tld}/%{project}/%{repo}
|
|
|
|
|
|
|
|
#debuginfo not supported with Go
|
|
|
|
%global gopath %{_libdir}/golang
|
2017-09-11 14:29:16 +03:00
|
|
|
%define gosrc %{gopath}/src/pkg/%{import_path}
|
2016-06-17 15:20:11 +03:00
|
|
|
|
2017-09-11 14:29:16 +03:00
|
|
|
%global commit 2a5e70cbf65457815ee76b7e5dd2a01292d9eca8
|
2016-06-17 15:20:11 +03:00
|
|
|
%global shortcommit %(c=%{commit}; echo ${c:0:7})
|
|
|
|
|
2017-09-11 14:29:16 +03:00
|
|
|
# Need discuss renaming docker-containerd to containerd
|
|
|
|
# containerd
|
|
|
|
Name: docker-containerd
|
2016-06-17 15:20:11 +03:00
|
|
|
Version: %{dist_version}
|
2017-09-21 12:39:08 +03:00
|
|
|
Release: 3
|
2016-06-17 15:20:11 +03:00
|
|
|
Summary: A daemon to control runC
|
|
|
|
License: ASL 2.0
|
2017-09-11 14:29:16 +03:00
|
|
|
Group: System/Kernel and hardware
|
2016-06-17 15:20:11 +03:00
|
|
|
|
2017-09-11 14:29:16 +03:00
|
|
|
URL: https://containerd.io/
|
2016-06-17 15:20:11 +03:00
|
|
|
Source0: https://%{import_path}/archive/v%{dist_version}.tar.gz
|
|
|
|
#Source0: https://%{import_path}/archive/%{commit}.tar.gzS
|
|
|
|
|
|
|
|
BuildRequires: gcc
|
|
|
|
BuildRequires: glibc-static-devel
|
2017-09-11 14:29:16 +03:00
|
|
|
BuildRequires: go-md2man
|
|
|
|
BuildRequires: pkgconfig(systemd)
|
|
|
|
BuildRequires: pkgconfig(devmapper)
|
|
|
|
BuildRequires: btrfs-devel
|
|
|
|
|
2016-06-17 15:20:11 +03:00
|
|
|
|
|
|
|
# ensure build uses golang 1.4 or above
|
|
|
|
BuildRequires: golang >= 1.4
|
|
|
|
|
2017-09-21 12:39:08 +03:00
|
|
|
Requires: runc
|
2016-06-17 15:20:11 +03:00
|
|
|
|
|
|
|
%description
|
2017-09-11 14:29:16 +03:00
|
|
|
Containerd is a daemon with an API and a command line client, to manage
|
|
|
|
containers on one machine.
|
2016-06-17 15:20:11 +03:00
|
|
|
|
2017-09-11 14:29:16 +03:00
|
|
|
It uses runC to run containers according to the OCI specification.
|
|
|
|
Containerd has advanced features such as seccomp and user namespace
|
|
|
|
support as well as checkpoint and restore for cloning and live migration
|
|
|
|
of containers.
|
2016-06-17 15:20:11 +03:00
|
|
|
|
|
|
|
%prep
|
|
|
|
#%setup -q -n docker-%{commit}
|
|
|
|
%setup -q -n %{repo}-%{dist_version}
|
2017-09-11 14:29:16 +03:00
|
|
|
%apply_patches
|
|
|
|
|
2016-06-17 15:20:11 +03:00
|
|
|
|
|
|
|
%build
|
|
|
|
#export DOCKER_GITCOMMIT="%{shortcommit}"
|
|
|
|
#export DOCKER_GITCOMMIT="%{shortcommit}/%{version}"
|
|
|
|
|
2017-09-11 14:29:16 +03:00
|
|
|
mkdir -p vendor/src/github.com/docker/containerd
|
|
|
|
for i in *; do
|
|
|
|
[ -d $i ] && ln -s `pwd`/$i vendor/src/github.com/docker/containerd/
|
|
|
|
done
|
|
|
|
|
|
|
|
cat >vendor/src/github.com/docker/containerd/version.go <<'EOF'
|
|
|
|
package containerd;
|
|
|
|
const Version = "%{version}";
|
|
|
|
const GitCommit = "%{commit}";
|
|
|
|
const VersionMajor = 0;
|
|
|
|
const VersionMinor = 2;
|
|
|
|
const VersionPatch = 5;
|
|
|
|
EOF
|
2016-06-17 15:20:11 +03:00
|
|
|
|
|
|
|
export GOPATH=$(pwd)/vendor:%{gopath}
|
|
|
|
make
|
|
|
|
|
|
|
|
%install
|
|
|
|
# install binary
|
|
|
|
install -d %{buildroot}%{_bindir}
|
|
|
|
install -p -m 755 bin/* %{buildroot}%{_bindir}
|
2017-09-11 14:29:16 +03:00
|
|
|
|
|
|
|
# install systemd/init scripts
|
|
|
|
install -d %{buildroot}%{_unitdir}
|
|
|
|
sed -e 's,/usr/local,%{_prefix},g' hack/containerd.service >%{buildroot}%{_unitdir}/containerd.service
|
|
|
|
|
|
|
|
find %{buildroot} -name "*~" -exec rm -rf {} \;
|
|
|
|
|
|
|
|
install -d %{buildroot}%{_presetdir}
|
|
|
|
cat > %{buildroot}%{_presetdir}/86-containerd.preset << EOF
|
|
|
|
enable containerd.service
|
|
|
|
EOF
|
|
|
|
|
|
|
|
# Docker expects stuff to be named its way...
|
2016-06-17 15:20:11 +03:00
|
|
|
cd %{buildroot}%{_bindir}
|
|
|
|
for i in *; do
|
|
|
|
ln -sf $i docker-$i
|
|
|
|
done
|
|
|
|
|
|
|
|
%files
|
|
|
|
%doc LICENSE.* MAINTAINERS NOTICE README.md
|
|
|
|
%{_bindir}/*
|
2017-09-11 14:29:16 +03:00
|
|
|
%{_presetdir}/86-containerd.preset
|
|
|
|
%{_unitdir}/containerd.service
|
|
|
|
|