Blob Blame History Raw
%if 0%{?fedora} || 0%{?rhel} == 6
%global with_devel 1
%global with_bundled 1
%global with_debug 0
%global with_check 1
%global with_unit_test 0
%else
%global with_devel 0
%global with_bundled 0
%global with_debug 0
%global with_check 0
%global with_unit_test 0
%endif

%if 0%{?with_debug}
%global _dwz_low_mem_die_limit 0
%else
%global debug_package   %{nil}
%endif

%global provider        github
%global provider_tld    com
%global project         kubernetes-incubator
%global repo            cri-o
# https://github.com/kubernetes-incubator/cri-o
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
%global import_path     %{provider_prefix}
%global commit0         91977d3989d1bec715ec8063f447d143e7612d18
%global shortcommit0    %(c=%{commit0}; echo ${c:0:7})

# runc
%global git_runc https://github.com/opencontainers/runc/
%global commit_runc 67bd2ab554bdf8a604f020e57448b37ef2102171
%global shortcommit_runc %(c=%{commit_runc}; echo ${c:0:7})

# CNI plugins
%global git_cni https://github.com/containernetworking/plugins
%global commit_cni dcf7368eeab15e2affc6256f0bb1e84dd46a34de
%global shortcommit_cni %(c=%{commit_cni}; echo ${c:0:7})

%global service_name crio

Name:           cri-o
Version:        1.0.0.alpha.0
Release:        1.git%{shortcommit0}%{?dist}
Summary:        OCI-based implementation of Kubernetes Container Runtime Interface
License:        ASL 2.0
URL:            https://%{provider_prefix}
Source0:        https://github.com/kubernetes-incubator/cri-o/archive/%{commit0}/%{repo}-%{shortcommit0}.tar.gz
Source3:        %{service_name}-network.sysconfig
Source4:        %{service_name}-storage.sysconfig
Source5:        %{git_runc}/archive/%{commit_runc}/runc-%{shortcommit_runc}.tar.gz
Source6:	%{git_cni}/archive/%{commit_cni}/plugins-%{shortcommit_cni}.tar.gz

# e.g. el6 has ppc64 arch without gcc-go, so EA tag is required
#ExclusiveArch:  %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 %{arm}}
# skip s390x (rhbz#1466865)
ExclusiveArch:  x86_64 aarch64 ppc64le
# If go_compiler is not set to 1, there is no virtual provide. Use golang instead.
BuildRequires:  %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}
BuildRequires:  btrfs-progs-devel
BuildRequires:  git
BuildRequires:  glib2-devel
BuildRequires:  glibc-static
BuildRequires:  go-md2man
BuildRequires:  gpgme-devel
BuildRequires:  libassuan-devel
BuildRequires:  libseccomp-static
BuildRequires:  pkgconfig(systemd)
BuildRequires:  device-mapper-devel
Requires(pre):  container-selinux
Requires:       skopeo-containers
Provides:       %{repo} = %{version}-%{release}
Provides:       cri-o
Obsoletes:      ocid <= 0.3
Provides:       ocid = %{version}-%{release}

%if 0%{?centos}
Requires: containernetworking-plugins >= 0.5.2-2
%else
Recommends: containernetworking-plugins >= 0.5.2-2
%endif # centos

%description
%{summary}

%if 0%{?with_devel}
%package devel
Summary:       %{summary}
BuildArch:     noarch

%if 0%{?with_check} && ! 0%{?with_bundled}
BuildRequires: golang(github.com/BurntSushi/toml)
BuildRequires: golang(github.com/Microsoft/go-winio)
BuildRequires: golang(github.com/Sirupsen/logrus)
BuildRequires: golang(github.com/containernetworking/cni/libcni)
BuildRequires: golang(github.com/containernetworking/cni/pkg/invoke)
BuildRequires: golang(github.com/containernetworking/cni/pkg/types)
BuildRequires: golang(github.com/containernetworking/cni/pkg/version)
BuildRequires: golang(github.com/containers/image/directory)
BuildRequires: golang(github.com/containers/image/directory/explicitfilepath)
BuildRequires: golang(github.com/containers/image/docker)
BuildRequires: golang(github.com/containers/image/docker/policyconfiguration)
BuildRequires: golang(github.com/containers/image/image)
BuildRequires: golang(github.com/containers/image/manifest)
BuildRequires: golang(github.com/containers/image/oci/layout)
BuildRequires: golang(github.com/containers/image/openshift)
BuildRequires: golang(github.com/containers/image/transports)
BuildRequires: golang(github.com/containers/image/types)
BuildRequires: golang(github.com/containers/image/version)
BuildRequires: golang(github.com/docker/distribution)
BuildRequires: golang(github.com/docker/distribution/context)
BuildRequires: golang(github.com/docker/distribution/digest)
BuildRequires: golang(github.com/docker/distribution/reference)
BuildRequires: golang(github.com/docker/distribution/uuid)
BuildRequires: golang(github.com/docker/docker/api/types/blkiodev)
BuildRequires: golang(github.com/docker/docker/api/types/container)
BuildRequires: golang(github.com/docker/docker/api/types/mount)
BuildRequires: golang(github.com/docker/docker/api/types/strslice)
BuildRequires: golang(github.com/docker/docker/api/types/versions)
BuildRequires: golang(github.com/docker/docker/daemon/graphdriver)
BuildRequires: golang(github.com/docker/docker/image)
BuildRequires: golang(github.com/docker/docker/image/v1)
BuildRequires: golang(github.com/docker/docker/layer)
BuildRequires: golang(github.com/docker/docker/pkg/archive)
BuildRequires: golang(github.com/docker/docker/pkg/chrootarchive)
BuildRequires: golang(github.com/docker/docker/pkg/fileutils)
BuildRequires: golang(github.com/docker/docker/pkg/homedir)
BuildRequires: golang(github.com/docker/docker/pkg/idtools)
BuildRequires: golang(github.com/docker/docker/pkg/ioutils)
BuildRequires: golang(github.com/docker/docker/pkg/longpath)
BuildRequires: golang(github.com/docker/docker/pkg/mount)
BuildRequires: golang(github.com/docker/docker/pkg/plugins)
BuildRequires: golang(github.com/docker/docker/pkg/plugins/transport)
BuildRequires: golang(github.com/docker/docker/pkg/pools)
BuildRequires: golang(github.com/docker/docker/pkg/promise)
BuildRequires: golang(github.com/docker/docker/pkg/random)
BuildRequires: golang(github.com/docker/docker/pkg/reexec)
BuildRequires: golang(github.com/docker/docker/pkg/registrar)
BuildRequires: golang(github.com/docker/docker/pkg/stringid)
BuildRequires: golang(github.com/docker/docker/pkg/system)
BuildRequires: golang(github.com/docker/docker/pkg/truncindex)
BuildRequires: golang(github.com/docker/docker/plugin/getter)
BuildRequires: golang(github.com/docker/docker/reference)
BuildRequires: golang(github.com/docker/go-connections/nat)
BuildRequires: golang(github.com/docker/go-connections/sockets)
BuildRequires: golang(github.com/docker/go-connections/tlsconfig)
BuildRequires: golang(github.com/docker/go-units)
BuildRequires: golang(github.com/docker/libtrust)
BuildRequires: golang(github.com/ghodss/yaml)
BuildRequires: golang(github.com/gogo/protobuf/proto)
BuildRequires: golang(github.com/golang/glog)
BuildRequires: golang(github.com/golang/protobuf/proto)
BuildRequires: golang(github.com/gorilla/context)
BuildRequires: golang(github.com/gorilla/mux)
BuildRequires: golang(github.com/imdario/mergo)
BuildRequires: golang(github.com/opencontainers/image-spec/specs-go)
BuildRequires: golang(github.com/opencontainers/image-spec/specs-go/v1)
BuildRequires: golang(github.com/opencontainers/runc/libcontainer/label)
BuildRequires: golang(github.com/opencontainers/runc/libcontainer/selinux)
BuildRequires: golang(github.com/opencontainers/runc/libcontainer/system)
BuildRequires: golang(github.com/opencontainers/runc/libcontainer/user)
BuildRequires: golang(github.com/opencontainers/runtime-spec/specs-go)
BuildRequires: golang(github.com/opencontainers/runtime-tools/generate)
BuildRequires: golang(github.com/rajatchopra/ocicni)
BuildRequires: golang(github.com/syndtr/gocapability/capability)
BuildRequires: golang(github.com/tchap/go-patricia/patricia)
BuildRequires: golang(github.com/vbatts/tar-split/archive/tar)
BuildRequires: golang(github.com/vbatts/tar-split/tar/asm)
BuildRequires: golang(github.com/vbatts/tar-split/tar/storage)
BuildRequires: golang(golang.org/x/net/context)
BuildRequires: golang(golang.org/x/net/http2)
BuildRequires: golang(golang.org/x/net/http2/hpack)
BuildRequires: golang(golang.org/x/net/internal/timeseries)
BuildRequires: golang(golang.org/x/net/proxy)
BuildRequires: golang(golang.org/x/net/trace)
BuildRequires: golang(golang.org/x/sys/unix)
BuildRequires: golang(google.golang.org/grpc)
BuildRequires: golang(google.golang.org/grpc/codes)
BuildRequires: golang(google.golang.org/grpc/credentials)
BuildRequires: golang(google.golang.org/grpc/grpclog)
BuildRequires: golang(google.golang.org/grpc/internal)
BuildRequires: golang(google.golang.org/grpc/metadata)
BuildRequires: golang(google.golang.org/grpc/naming)
BuildRequires: golang(google.golang.org/grpc/peer)
BuildRequires: golang(google.golang.org/grpc/transport)
BuildRequires: golang(gopkg.in/yaml.v2)
BuildRequires: golang(k8s.io/kubernetes/pkg/fields)
BuildRequires: golang(k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime)
BuildRequires: golang(k8s.io/kubernetes/pkg/selection)
BuildRequires: golang(k8s.io/kubernetes/pkg/util/errors)
BuildRequires: golang(k8s.io/kubernetes/pkg/util/homedir)
BuildRequires: golang(k8s.io/kubernetes/pkg/util/net)
BuildRequires: golang(k8s.io/kubernetes/pkg/util/sets)
%endif

Requires:      golang(github.com/BurntSushi/toml)
Requires:      golang(github.com/Microsoft/go-winio)
Requires:      golang(github.com/Sirupsen/logrus)
Requires:      golang(github.com/containernetworking/cni/libcni)
Requires:      golang(github.com/containernetworking/cni/pkg/invoke)
Requires:      golang(github.com/containernetworking/cni/pkg/types)
Requires:      golang(github.com/containernetworking/cni/pkg/version)
Requires:      golang(github.com/containers/image/directory)
Requires:      golang(github.com/containers/image/directory/explicitfilepath)
Requires:      golang(github.com/containers/image/docker)
Requires:      golang(github.com/containers/image/docker/policyconfiguration)
Requires:      golang(github.com/containers/image/image)
Requires:      golang(github.com/containers/image/manifest)
Requires:      golang(github.com/containers/image/oci/layout)
Requires:      golang(github.com/containers/image/openshift)
Requires:      golang(github.com/containers/image/transports)
Requires:      golang(github.com/containers/image/types)
Requires:      golang(github.com/containers/image/version)
Requires:      golang(github.com/docker/distribution)
Requires:      golang(github.com/docker/distribution/context)
Requires:      golang(github.com/docker/distribution/digest)
Requires:      golang(github.com/docker/distribution/reference)
Requires:      golang(github.com/docker/distribution/uuid)
Requires:      golang(github.com/docker/docker/api/types/blkiodev)
Requires:      golang(github.com/docker/docker/api/types/container)
Requires:      golang(github.com/docker/docker/api/types/mount)
Requires:      golang(github.com/docker/docker/api/types/strslice)
Requires:      golang(github.com/docker/docker/api/types/versions)
Requires:      golang(github.com/docker/docker/daemon/graphdriver)
Requires:      golang(github.com/docker/docker/image)
Requires:      golang(github.com/docker/docker/image/v1)
Requires:      golang(github.com/docker/docker/layer)
Requires:      golang(github.com/docker/docker/pkg/archive)
Requires:      golang(github.com/docker/docker/pkg/chrootarchive)
Requires:      golang(github.com/docker/docker/pkg/fileutils)
Requires:      golang(github.com/docker/docker/pkg/homedir)
Requires:      golang(github.com/docker/docker/pkg/idtools)
Requires:      golang(github.com/docker/docker/pkg/ioutils)
Requires:      golang(github.com/docker/docker/pkg/longpath)
Requires:      golang(github.com/docker/docker/pkg/mount)
Requires:      golang(github.com/docker/docker/pkg/plugins)
Requires:      golang(github.com/docker/docker/pkg/plugins/transport)
Requires:      golang(github.com/docker/docker/pkg/pools)
Requires:      golang(github.com/docker/docker/pkg/promise)
Requires:      golang(github.com/docker/docker/pkg/random)
Requires:      golang(github.com/docker/docker/pkg/reexec)
Requires:      golang(github.com/docker/docker/pkg/registrar)
Requires:      golang(github.com/docker/docker/pkg/stringid)
Requires:      golang(github.com/docker/docker/pkg/system)
Requires:      golang(github.com/docker/docker/pkg/truncindex)
Requires:      golang(github.com/docker/docker/plugin/getter)
Requires:      golang(github.com/docker/docker/reference)
Requires:      golang(github.com/docker/go-connections/nat)
Requires:      golang(github.com/docker/go-connections/sockets)
Requires:      golang(github.com/docker/go-connections/tlsconfig)
Requires:      golang(github.com/docker/go-units)
Requires:      golang(github.com/docker/libtrust)
Requires:      golang(github.com/ghodss/yaml)
Requires:      golang(github.com/gogo/protobuf/proto)
Requires:      golang(github.com/golang/glog)
Requires:      golang(github.com/golang/protobuf/proto)
Requires:      golang(github.com/gorilla/context)
Requires:      golang(github.com/gorilla/mux)
Requires:      golang(github.com/imdario/mergo)
Requires:      golang(github.com/opencontainers/image-spec/specs-go)
Requires:      golang(github.com/opencontainers/image-spec/specs-go/v1)
Requires:      golang(github.com/opencontainers/runc/libcontainer/label)
Requires:      golang(github.com/opencontainers/runc/libcontainer/selinux)
Requires:      golang(github.com/opencontainers/runc/libcontainer/system)
Requires:      golang(github.com/opencontainers/runc/libcontainer/user)
Requires:      golang(github.com/opencontainers/runtime-spec/specs-go)
Requires:      golang(github.com/opencontainers/runtime-tools/generate)
Requires:      golang(github.com/rajatchopra/ocicni)
Requires:      golang(github.com/syndtr/gocapability/capability)
Requires:      golang(github.com/tchap/go-patricia/patricia)
Requires:      golang(github.com/vbatts/tar-split/archive/tar)
Requires:      golang(github.com/vbatts/tar-split/tar/asm)
Requires:      golang(github.com/vbatts/tar-split/tar/storage)
Requires:      golang(golang.org/x/net/context)
Requires:      golang(golang.org/x/net/http2)
Requires:      golang(golang.org/x/net/http2/hpack)
Requires:      golang(golang.org/x/net/internal/timeseries)
Requires:      golang(golang.org/x/net/proxy)
Requires:      golang(golang.org/x/net/trace)
Requires:      golang(golang.org/x/sys/unix)
Requires:      golang(google.golang.org/grpc)
Requires:      golang(google.golang.org/grpc/codes)
Requires:      golang(google.golang.org/grpc/credentials)
Requires:      golang(google.golang.org/grpc/grpclog)
Requires:      golang(google.golang.org/grpc/internal)
Requires:      golang(google.golang.org/grpc/metadata)
Requires:      golang(google.golang.org/grpc/naming)
Requires:      golang(google.golang.org/grpc/peer)
Requires:      golang(google.golang.org/grpc/transport)
Requires:      golang(gopkg.in/yaml.v2)
Requires:      golang(k8s.io/kubernetes/pkg/fields)
Requires:      golang(k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime)
Requires:      golang(k8s.io/kubernetes/pkg/selection)
Requires:      golang(k8s.io/kubernetes/pkg/util/errors)
Requires:      golang(k8s.io/kubernetes/pkg/util/homedir)
Requires:      golang(k8s.io/kubernetes/pkg/util/net)
Requires:      golang(k8s.io/kubernetes/pkg/util/sets)

Provides:      golang(%{import_path}/oci) = %{version}-%{release}
Provides:      golang(%{import_path}/server) = %{version}-%{release}
Provides:      golang(%{import_path}/utils) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/BurntSushi/toml)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/Sirupsen/logrus)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/containernetworking/cni/libcni)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/containernetworking/cni/pkg/invoke)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/containernetworking/cni/pkg/types)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/containernetworking/cni/pkg/version)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/containers/image/directory)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/containers/image/directory/explicitfilepath)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/containers/image/docker)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/containers/image/docker/policyconfiguration)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/containers/image/image)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/containers/image/manifest)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/containers/image/oci/layout)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/containers/image/openshift)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/containers/image/transports)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/containers/image/types)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/containers/image/version)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/coreos/go-systemd/daemon)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/docker/distribution)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/docker/distribution/context)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/docker/distribution/digest)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/docker/distribution/reference)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/docker/distribution/uuid)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/docker/docker/api/types/blkiodev)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/docker/docker/api/types/container)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/docker/docker/api/types/mount)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/docker/docker/api/types/strslice)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/docker/docker/api/types/versions)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/docker/docker/daemon/graphdriver)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/docker/docker/image)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/docker/docker/image/v1)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/docker/docker/layer)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/docker/docker/pkg/archive)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/docker/docker/pkg/chrootarchive)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/docker/docker/pkg/fileutils)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/docker/docker/pkg/homedir)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/docker/docker/pkg/idtools)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/docker/docker/pkg/ioutils)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/docker/docker/pkg/mount)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/docker/docker/pkg/plugins)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/docker/docker/pkg/plugins/transport)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/docker/docker/pkg/pools)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/docker/docker/pkg/promise)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/docker/docker/pkg/random)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/docker/docker/pkg/reexec)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/docker/docker/pkg/registrar)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/docker/docker/pkg/stringid)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/docker/docker/pkg/system)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/docker/docker/pkg/truncindex)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/docker/docker/plugin/getter)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/docker/docker/reference)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/docker/go-connections/nat)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/docker/go-connections/sockets)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/docker/go-connections/tlsconfig)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/docker/go-units)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/docker/libtrust)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/ghodss/yaml)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/gogo/protobuf/proto)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/golang/glog)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/golang/protobuf/proto)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/gorilla/context)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/gorilla/mux)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/imdario/mergo)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/opencontainers/image-spec/specs-go)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/opencontainers/image-spec/specs-go/v1)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/opencontainers/runc/libcontainer/label)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/opencontainers/runc/libcontainer/selinux)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/opencontainers/runc/libcontainer/system)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/opencontainers/runc/libcontainer/user)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/opencontainers/runtime-spec/specs-go)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/opencontainers/runtime-tools/generate)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/rajatchopra/ocicni)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/syndtr/gocapability/capability)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/tchap/go-patricia/patricia)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/urfave/cli)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/vbatts/tar-split/archive/tar)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/vbatts/tar-split/tar/asm)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/github.com/vbatts/tar-split/tar/storage)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/golang.org/x/net/context)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/golang.org/x/net/http2)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/golang.org/x/net/http2/hpack)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/golang.org/x/net/proxy)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/golang.org/x/net/trace)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/golang.org/x/sys/unix)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/google.golang.org/grpc)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/google.golang.org/grpc/codes)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/google.golang.org/grpc/credentials)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/google.golang.org/grpc/grpclog)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/google.golang.org/grpc/metadata)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/google.golang.org/grpc/naming)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/google.golang.org/grpc/peer)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/google.golang.org/grpc/transport)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/gopkg.in/yaml.v2)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/k8s.io/kubernetes/pkg/fields)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/k8s.io/kubernetes/pkg/selection)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/k8s.io/kubernetes/pkg/util/errors)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/k8s.io/kubernetes/pkg/util/homedir)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/k8s.io/kubernetes/pkg/util/net)) = %{version}-%{release}
Provides:      bundled(golang(%{import_path}/vendor/src/k8s.io/kubernetes/pkg/util/sets)) = %{version}-%{release}

%description devel
%{summary}

This package contains library source intended for
building other packages which use import path with
%{import_path} prefix.
%endif

%if 0%{?with_unit_test} && 0%{?with_devel}
%package unit-test-devel
Summary:         Unit tests for %{name} package
%if 0%{?with_check}
#Here comes all BuildRequires: PACKAGE the unit tests
#in %%check section need for running
%endif

# test subpackage tests code from devel subpackage
Requires:        %{name}-devel = %{version}-%{release}

%description unit-test-devel
%{summary}

This package contains unit tests for project
providing packages with %{import_path} prefix.
%endif

%prep
%autosetup -Sgit -n %{name}-%{commit0}
sed -i 's/\/usr\/local\/bin\/crio/\/usr\/bin\/crio/g' contrib/systemd/%{service_name}.service

tar zxf %{SOURCE5}
tar zxf %{SOURCE6}

%build
mkdir _build
pushd _build
mkdir -p src/%{provider}.%{provider_tld}/{%{project},opencontainers}
ln -s $(dirs +1 -l) src/%{import_path}
ln -s $(dirs +1 -l)/runc-%{commit_runc} src/%{provider}.%{provider_tld}/opencontainers/runc
popd

ln -s vendor src

make docs
export GOPATH=$(pwd)/_build:$(pwd):$(pwd):%{gopath}
make binaries

./%{service_name} \
  --selinux=true \
  --storage-driver=overlay2 \
  --runtime /usr/libexec/%{service_name}/runc \
  --conmon /usr/libexec/%{service_name}/conmon \
  --cgroup-manager=systemd config > %{service_name}.conf

pushd _build/src/github.com/opencontainers/runc
make BUILDTAGS="seccomp selinux"
popd

%install
make DESTDIR=%{buildroot} PREFIX=%{buildroot}%{_prefix} install.config install.systemd install.completions

# install binaries
install -dp %{buildroot}{%{_bindir},%{_libexecdir}/%{service_name}}
install -p -m 755 %{service_name} %{buildroot}%{_bindir}
install -p -m 755 crioctl %{buildroot}%{_bindir}
install -p -m 755 kpod %{buildroot}%{_bindir}
install -p -m 755 conmon/conmon %{buildroot}%{_libexecdir}/%{service_name}
install -p -m 755 pause/pause %{buildroot}%{_libexecdir}/%{service_name}

install -p -m 755 runc-%{commit_runc}/runc %{buildroot}%{_libexecdir}/%{service_name}

install -dp %{buildroot}%{_sysconfdir}/cni/net.d
install -p -m 644 contrib/cni/10-crio-bridge.conf %{buildroot}%{_sysconfdir}/cni/net.d/100-crio-bridge.conf
install -p -m 644 contrib/cni/99-loopback.conf %{buildroot}%{_sysconfdir}/cni/net.d/200-loopback.conf

install -dp %{buildroot}%{_sysconfdir}/sysconfig
install -p -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/sysconfig/%{service_name}-network
install -p -m 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/sysconfig/%{service_name}-storage

install -dp %{buildroot}%{_mandir}/man{1,5,8}
install -m 644 docs/*.1 %{buildroot}%{_mandir}/man1
install -m 644 docs/*.5 %{buildroot}%{_mandir}/man5
install -m 644 docs/*.8 %{buildroot}%{_mandir}/man8

mkdir -p %{buildroot}%{_sharedstatedir}/containers

# source codes for building projects
%if 0%{?with_devel}
install -d -p %{buildroot}/%{gopath}/src/%{import_path}/
echo "%%dir %%{gopath}/src/%%{import_path}/." >> devel.file-list
# find all *.go but no *_test.go files and generate devel.file-list
for file in $(find . -iname "*.go" \! -iname "*_test.go") ; do
    echo "%%dir %%{gopath}/src/%%{import_path}/$(dirname $file)" >> devel.file-list
    install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file)
    cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file
    echo "%%{gopath}/src/%%{import_path}/$file" >> devel.file-list
done
%endif

# testing files for this project
%if 0%{?with_unit_test} && 0%{?with_devel}
install -d -p %{buildroot}/%{gopath}/src/%{import_path}/
# find all *_test.go files and generate unit-test.file-list
for file in $(find . -iname "*_test.go"); do
    echo "%%dir %%{gopath}/src/%%{import_path}/$(dirname $file)" >> devel.file-list
    install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file)
    cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file
    echo "%%{gopath}/src/%%{import_path}/$file" >> unit-test-devel.file-list
done
%endif

%if 0%{?with_devel}
sort -u -o devel.file-list devel.file-list
%endif

%check
%if 0%{?with_check} && 0%{?with_unit_test} && 0%{?with_devel}
%if ! 0%{?with_bundled}
export GOPATH=%{buildroot}/%{gopath}:%{gopath}
%else
export GOPATH=%{buildroot}/%{gopath}:$(pwd)/Godeps/_workspace:%{gopath}
%endif

%endif

%post
%systemd_post %{service_name}

%preun
%systemd_preun %{service_name}

%postun
%systemd_postun_with_restart %{service_name}

#define license tag if not already defined
%{!?_licensedir:%global license %doc}

%if 0%{?with_devel}
%files devel -f devel.file-list
%license LICENSE
%doc README.md code-of-conduct.md
%dir %{gopath}/src/%{provider}.%{provider_tld}/%{project}
%endif

%if 0%{?with_unit_test} && 0%{?with_devel}
%files unit-test-devel -f unit-test-devel.file-list
%license LICENSE
%doc README.md code-of-conduct.md
%endif

%files
%license LICENSE
%doc README.md
%{_bindir}/%{service_name}
%{_bindir}/kpod
%{_bindir}/%{service_name}ctl
%{_mandir}/man1/kpod*
%{_mandir}/man5/%{service_name}.conf.5*
%{_mandir}/man8/%{service_name}.8*
%dir %{_sysconfdir}/%{service_name}
%config(noreplace) %{_sysconfdir}/%{service_name}/%{service_name}.conf
%config(noreplace) %{_sysconfdir}/%{service_name}/seccomp.json
%config(noreplace) %{_sysconfdir}/sysconfig/%{service_name}-storage
%config(noreplace) %{_sysconfdir}/sysconfig/%{service_name}-network
%config(noreplace) %{_sysconfdir}/cni/net.d/100-%{service_name}-bridge.conf
%config(noreplace) %{_sysconfdir}/cni/net.d/200-loopback.conf
%dir %{_libexecdir}/%{service_name}
%{_libexecdir}/%{service_name}/conmon
%{_libexecdir}/%{service_name}/pause
%{_libexecdir}/%{service_name}/runc
%{_unitdir}/%{service_name}.service
%{_unitdir}/%{service_name}-shutdown.service
%dir %{_sharedstatedir}/containers
%{_datadir}/bash-completion/completions/*

%changelog
* Fri Jun 30 2017 Lokesh Mandvekar <lsm5@fedoraproject.org> - 1.0.0.alpha.0-1.git91977d3
- built commit 91977d3
- remove cri-o-cni subpackage
- require containernetworking-plugins >= 0.5.2-2 (same as containernetworking-cni)
- skip s390x build (rhbz#1466865)

* Fri Jun 23 2017 Antonio Murdaca <runcom@fedoraproject.org> - 1.0.0.alpha.0-0.git5dcbdc0.3
- rebuilt to include cri-o-cni sub package

* Wed Jun 21 2017 Antonio Murdaca <runcom@fedoraproject.org> - 1.0.0.alpha.0-0.git5dcbdc0.2
- rebuilt for s390x

* Wed Jun 21 2017 Antonio Murdaca <runcom@fedoraproject.org> - 1.0.0.alpha.0-0.git5dcbdc0.1
- built first alpha release

* Fri May 5 2017 Dan Walsh <dwalsh@redhat.com> 0.3-0.gitf648cd6e
- Bump up version to 0.3

* Tue Mar 21 2017 Dan Walsh <dwalsh@redhat.com> 0.2-1.git7d7570e
- Bump up version to 0.2

* Tue Mar 21 2017 Dan Walsh <dwalsh@redhat.com> 0.1-1.git9bf26b5
- Bump up version to 0.1

* Mon Feb 13 2017 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0-0.15.git0639f06
- built commit 0639f06
- packaging workarounds for 'go install'

* Wed Feb 8 2017 Dan Walsh <dwalsh@redhat.com> 0-0.14.git6bd7c53
- Use newer versions of runc
- Applying k8s kubelet v3 api to cri-o server
- Applying k8s.io v3 API for ocic and ocid
- doc: Add instruction to run cri-o with kubernetes
- Lots of  updates of container/storage and containers/image

* Mon Jan 23 2017 Peter Robinson <pbrobinson@fedoraproject.org> 0-0.13.git7cc8492
- Build on all kubernetes arches

* Fri Jan 20 2017 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0-0.12.git7cc8492
- add bash completion
- From: Daniel J Walsh <dwalsh@redhat.com>

* Thu Jan 19 2017 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0-0.11.git7cc8492
- remove trailing whitespace from unitfile

* Thu Jan 19 2017 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0-0.10.git7cc8492
- built commit 7cc8492
- packaging fixes from Nalin Dahyabhai <nalin@redhat.com>

* Thu Jan 19 2017 Dan Walsh <dwalsh@redhat.com> - 0-0.9.gitb9dc097
- Change to require skopeo-containers
- Merge Nalind/storage patch
-    Now uses Storage for Image Management

* Mon Jan 16 2017 Lokesh Manvekar <lsm5@fedoraproject.org> - 0-0.8.git2e6070f
- packaging changes from Nalin Dahyabhai <nalin@redhat.com>
- Don't make the ExecReload setting part of the ExecStart setting.
- Create ocid.conf in install, not in check.
- Own /etc/ocid.
- Install an "anything goes" pulling policy for a default.

* Thu Dec 22 2016 Dan Walsh <dwalsh@redhat.com> - 0-0.7.git2e6070f
- Switch locate to /var/lib/containers for images

* Thu Dec 22 2016 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0-0.6.git2e6070f
- built commit 2e6070f

* Wed Dec 21 2016 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0-0.5.git36dfef5
- install plugins into /usr/libexec/ocid/cni/
- require runc >= 1.0.0 rc2

* Wed Dec 21 2016 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0-0.4.git36dfef5
- built runcom/alpha commit 36dfef5
- cni bundled for now

* Thu Dec 15 2016 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0-0.3.gitc57530e
- Resolves: #1392977 - first upload to Fedora
- add build deps, enable only for x86_64 (doesn't build on i686)

* Thu Dec 15 2016 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0-0.2.gitc57530e
- add Godeps.json

* Tue Nov 08 2016 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0-0.1.gitc57530e
- First package for Fedora