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         7cc84922b3ef896e32bf56dd16ceb9fddcb18cb2
%global shortcommit0    %(c=%{commit0}; echo ${c:0:7})

%global git1            https://github.com/containernetworking/cni
%global commit1         98ff61aac32dcf2eb3044a0d5e5f1814837b3c75
%global shortcommit1    %(c=%{commit1}; echo ${c:0:7})


Name:           ocid
Version:        0
Release:        0.13.git%{shortcommit0}%{?dist}
Summary:        OCI-based implementation of Kubernetes Container Runtime Interface
License:        ASL 2.0
URL:            https://%{provider_prefix}
Source0:        https://github.com/runcom/ocid-1/archive/%{commit0}/%{repo}-%{shortcommit0}.tar.gz
Source1:        Godeps.json
Source2:        %{git1}/archive/%{commit1}/cni-%{shortcommit1}.tar.gz
Source3:        %{name}.service
Source4:        %{name}-network.sysconfig
Source5:        %{name}-storage.sysconfig

# 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}}
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:  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:       runc >= 1.0.0-1.rc2
Requires:       skopeo-containers
Provides:       %{repo} = %{version}-%{release}
Provides:       cri-o

%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
%setup -q -n %{name}-1-%{commit0}
cp %{SOURCE1} .
cp %{SOURCE3} contrib/systemd/.

tar zxf %{SOURCE2}

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

ln -s vendor src

export GOPATH=$(pwd)/_build:$(pwd):%{gopath}
make all
_build/bin/ocid --selinux=true config > ocid.conf

pushd cni-%{commit1}
./build

%install
export GOPATH=$(pwd)/_build:$(pwd):%{gopath}

%make_install DESTDIR=%{buildroot} PREFIX=%{buildroot}/usr install.config install.systemd install.completions

install -dp %{buildroot}%{_libexecdir}/%{name}/cni
install -p -m 755 cni-%{commit1}/bin/* %{buildroot}%{_libexecdir}/%{name}/cni

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

%{buildroot}%{_bindir}/%{name} --root %{_sharedstatedir}/containers \
--storage-driver=devmapper config > \
%{buildroot}%{_sysconfdir}/%{name}/%{name}.conf
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

%preun
%systemd_preun %{name}

%postun
%systemd_postun_with_restart %{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 Godeps.json
%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 Godeps.json
%endif

%files
%license LICENSE
%doc README.md Godeps.json
%{_bindir}/%{name}
%{_bindir}/kpod
%{_bindir}/ocic
%{_mandir}/man1/kpod*
%{_mandir}/man5/%{name}.conf.5*
%{_mandir}/man8/%{name}.8*
%dir %{_sysconfdir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf
%config(noreplace) %{_sysconfdir}/%{name}/seccomp.json
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}-storage
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}-network
%dir %{_libexecdir}/%{name}
%{_libexecdir}/%{name}/conmon
%{_libexecdir}/%{name}/pause
%dir %{_libexecdir}/%{name}/cni
%{_libexecdir}/%{name}/cni/*
%{_unitdir}/%{name}.service
%dir %{_sharedstatedir}/containers
%{_datadir}/bash-completion/completions/*

%changelog
* 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