mirror of
https://abf.rosa.ru/djam/docker-containerd.git
synced 2025-02-23 14:22:50 +00:00
Up to 0.2.5 and tested
This commit is contained in:
parent
355285b03b
commit
9dfb28d5e6
1 changed files with 54 additions and 13 deletions
|
@ -1,31 +1,40 @@
|
|||
%global dist_version 0.2.1
|
||||
%global dist_version 0.2.5
|
||||
|
||||
%global provider github
|
||||
%global provider_tld com
|
||||
%global project docker
|
||||
|
||||
%define project containerd
|
||||
%global repo containerd
|
||||
|
||||
%global import_path %{provider}.%{provider_tld}/%{project}/%{repo}
|
||||
|
||||
#debuginfo not supported with Go
|
||||
%global gopath %{_libdir}/golang
|
||||
%define gosrc %{gopath}/src/pkg/%{import_path}
|
||||
%define gosrc %{gopath}/src/pkg/%{import_path}
|
||||
|
||||
%global commit ca47f7e76a93e9b3768ed084d62318e85bd9f4b2
|
||||
%global commit 2a5e70cbf65457815ee76b7e5dd2a01292d9eca8
|
||||
%global shortcommit %(c=%{commit}; echo ${c:0:7})
|
||||
|
||||
Name: %{project}-%{repo}
|
||||
# Need discuss renaming docker-containerd to containerd
|
||||
# containerd
|
||||
Name: docker-containerd
|
||||
Version: %{dist_version}
|
||||
Release: 3
|
||||
Release: 2
|
||||
Summary: A daemon to control runC
|
||||
License: ASL 2.0
|
||||
Group: System/Kernel and hardware
|
||||
Group: System/Kernel and hardware
|
||||
|
||||
URL: http://www.docker.com
|
||||
URL: https://containerd.io/
|
||||
Source0: https://%{import_path}/archive/v%{dist_version}.tar.gz
|
||||
#Source0: https://%{import_path}/archive/%{commit}.tar.gzS
|
||||
|
||||
BuildRequires: gcc
|
||||
BuildRequires: glibc-static-devel
|
||||
BuildRequires: go-md2man
|
||||
BuildRequires: pkgconfig(systemd)
|
||||
BuildRequires: pkgconfig(devmapper)
|
||||
BuildRequires: btrfs-devel
|
||||
|
||||
|
||||
# ensure build uses golang 1.4 or above
|
||||
BuildRequires: golang >= 1.4
|
||||
|
@ -33,21 +42,37 @@ BuildRequires: golang >= 1.4
|
|||
Requires: opencontainers-runc
|
||||
|
||||
%description
|
||||
containerd is a daemon to control runC, built for performance and density.
|
||||
Containerd is a daemon with an API and a command line client, to manage
|
||||
containers on one machine.
|
||||
|
||||
containerd leverages runC's advanced features such as seccomp and user
|
||||
namespace support as well as checkpoint and restore for cloning and
|
||||
live migration of containers.
|
||||
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.
|
||||
|
||||
%prep
|
||||
#%setup -q -n docker-%{commit}
|
||||
%setup -q -n %{repo}-%{dist_version}
|
||||
%apply_patches
|
||||
|
||||
|
||||
%build
|
||||
#export DOCKER_GITCOMMIT="%{shortcommit}"
|
||||
#export DOCKER_GITCOMMIT="%{shortcommit}/%{version}"
|
||||
|
||||
ln -sf $(pwd) vendor/src/%{import_path}
|
||||
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
|
||||
|
||||
export GOPATH=$(pwd)/vendor:%{gopath}
|
||||
make
|
||||
|
@ -56,6 +81,19 @@ make
|
|||
# install binary
|
||||
install -d %{buildroot}%{_bindir}
|
||||
install -p -m 755 bin/* %{buildroot}%{_bindir}
|
||||
|
||||
# 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...
|
||||
cd %{buildroot}%{_bindir}
|
||||
for i in *; do
|
||||
ln -sf $i docker-$i
|
||||
|
@ -64,3 +102,6 @@ done
|
|||
%files
|
||||
%doc LICENSE.* MAINTAINERS NOTICE README.md
|
||||
%{_bindir}/*
|
||||
%{_presetdir}/86-containerd.preset
|
||||
%{_unitdir}/containerd.service
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue