From 8e46f370733951e6decec6dd36b0c13308ced2c2 Mon Sep 17 00:00:00 2001
From: caihaomin <caihaomin@huawei.com>
Date: Mon, 21 Jan 2019 22:31:05 +0800
Subject: [PATCH 05/27] containerd: add spec for build

reason:add spec for build

Change-Id: I42d9d32e4898c006194df1ead4735155b4785584
Signed-off-by: caihaomin <caihaomin@huawei.com>
---
 hack/containerd.spec | 46 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)
 create mode 100644 hack/containerd.spec

diff --git a/hack/containerd.spec b/hack/containerd.spec
new file mode 100644
index 0000000..f53c37b
--- /dev/null
+++ b/hack/containerd.spec
@@ -0,0 +1,46 @@
+%global goipath github.com/containerd/containerd
+%global debug_package %{nil}
+Version:        1.2.0
+
+Name:           containerd
+Release:        1%{?dist}
+Summary:        An industry-standard container runtime
+License:        ASL 2.0
+URL:            https://containerd.io
+Source0:        containerd-1.2.0.tar.gz
+
+BuildRequires:  golang glibc-static make
+BuildRequires:  btrfs-progs-devel
+
+
+%description
+containerd is an industry-standard container runtime with an emphasis on
+simplicity, robustness and portability.  It is available as a daemon for Linux
+and Windows, which can manage the complete container lifecycle of its host
+system: image transfer and storage, container execution and supervision,
+low-level storage and network attachments, etc.
+
+
+%prep
+%setup -c -n containerd
+
+%build
+GO_BUILD_PATH=$PWD/_build
+install -m 0755 -vd $(dirname $GO_BUILD_PATH/src/%{goipath})
+ln -fs $PWD $GO_BUILD_PATH/src/%{goipath}
+cd $GO_BUILD_PATH/src/%{goipath}
+export GOPATH=$GO_BUILD_PATH:%{gopath}
+export BUILDTAGS="no_btrfs no_cri"
+make
+
+%install
+install -d $RPM_BUILD_ROOT/%{_bindir}
+install -p -m 755 bin/containerd $RPM_BUILD_ROOT/%{_bindir}/containerd
+install -p -m 755 bin/containerd-shim $RPM_BUILD_ROOT/%{_bindir}/containerd-shim
+
+%files
+%{_bindir}/containerd
+%{_bindir}/containerd-shim
+
+
+%changelog
-- 
2.7.4.3

