From bc0f80b980b139073e02b72740ca55977afa22a78de814e08078ed2d2126f759 Mon Sep 17 00:00:00 2001
From: Dominique Leuenberger <dleuenberger@suse.com>
Date: Mon, 19 Feb 2018 12:00:31 +0000
Subject: [PATCH] Accepting request 575782 from devel:CaaSP:Head:ControllerNode

- Add requirement on libcontainers-common, which now provides the
  /etc/containers/policy.json config.
- Use golang-packaging macros.
- Set version to +git%{rev_list} scheme as there's no official release yet.
- Spec file cleanups via spec-cleaner.
- Add requirement on libcontainers-{common,image,storage}, which provide
  configuration files, manpages and debugging tools useful and required by
  podman.
- Fix typo to provide the correct package.
- Replace tabs with spaces.
- Fix libostree-devel %if condition for TW, Leap 15+ and SLES 15+.
- Use `%fdupes %buildroot/%_prefix` since `fdupes %buildroot` is not allowed
  because you cannot make hardlinks between certain partitions.
- Add podman package: podman is a simple client only tool to help with
  debugging issues when daemons such as CRI runtime and the kubelet are not
  responding or failing.

OBS-URL: https://build.opensuse.org/request/show/575782
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/podman?expand=0&rev=1
---
 .gitattributes                                |  23 ++++
 .gitignore                                    |   1 +
 _service                                      |  16 +++
 ...a0671b48ffdeda68895e0b7d97b252d66d9.tar.xz |   3 +
 podman.changes                                |  35 +++++
 podman.spec                                   | 128 ++++++++++++++++++
 6 files changed, 206 insertions(+)
 create mode 100644 .gitattributes
 create mode 100644 .gitignore
 create mode 100644 _service
 create mode 100644 podman-git.c60d8a0671b48ffdeda68895e0b7d97b252d66d9.tar.xz
 create mode 100644 podman.changes
 create mode 100644 podman.spec

diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..9b03811
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,23 @@
+## Default LFS
+*.7z filter=lfs diff=lfs merge=lfs -text
+*.bsp filter=lfs diff=lfs merge=lfs -text
+*.bz2 filter=lfs diff=lfs merge=lfs -text
+*.gem filter=lfs diff=lfs merge=lfs -text
+*.gz filter=lfs diff=lfs merge=lfs -text
+*.jar filter=lfs diff=lfs merge=lfs -text
+*.lz filter=lfs diff=lfs merge=lfs -text
+*.lzma filter=lfs diff=lfs merge=lfs -text
+*.obscpio filter=lfs diff=lfs merge=lfs -text
+*.oxt filter=lfs diff=lfs merge=lfs -text
+*.pdf filter=lfs diff=lfs merge=lfs -text
+*.png filter=lfs diff=lfs merge=lfs -text
+*.rpm filter=lfs diff=lfs merge=lfs -text
+*.tbz filter=lfs diff=lfs merge=lfs -text
+*.tbz2 filter=lfs diff=lfs merge=lfs -text
+*.tgz filter=lfs diff=lfs merge=lfs -text
+*.ttf filter=lfs diff=lfs merge=lfs -text
+*.txz filter=lfs diff=lfs merge=lfs -text
+*.whl filter=lfs diff=lfs merge=lfs -text
+*.xz filter=lfs diff=lfs merge=lfs -text
+*.zip filter=lfs diff=lfs merge=lfs -text
+*.zst filter=lfs diff=lfs merge=lfs -text
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..57affb6
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+.osc
diff --git a/_service b/_service
new file mode 100644
index 0000000..968b162
--- /dev/null
+++ b/_service
@@ -0,0 +1,16 @@
+<services>
+
+<service name="tar_scm" mode="disabled">
+<param name="url">https://github.com/projectatomic/libpod.git</param>
+<param name="scm">git</param>
+<param name="filename">podman</param>
+<param name="versionformat">git.%H</param>
+<param name="revision">c60d8a0671b48ffdeda68895e0b7d97b252d66d9</param>
+</service>
+
+<service name="recompress" mode="disabled">
+<param name="file">*.tar</param>
+<param name="compression">xz</param>
+</service>
+
+</services>
diff --git a/podman-git.c60d8a0671b48ffdeda68895e0b7d97b252d66d9.tar.xz b/podman-git.c60d8a0671b48ffdeda68895e0b7d97b252d66d9.tar.xz
new file mode 100644
index 0000000..473a7e3
--- /dev/null
+++ b/podman-git.c60d8a0671b48ffdeda68895e0b7d97b252d66d9.tar.xz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4bccc9b9d505d0d23a6bdf7d1558ddc802be4d4c70adc714f74fc7fef90c866a
+size 4619644
diff --git a/podman.changes b/podman.changes
new file mode 100644
index 0000000..487f842
--- /dev/null
+++ b/podman.changes
@@ -0,0 +1,35 @@
+-------------------------------------------------------------------
+Fri Feb  9 15:55:16 UTC 2018 - vrothberg@suse.com
+
+- Add requirement on libcontainers-common, which now provides the
+  /etc/containers/policy.json config.
+- Use golang-packaging macros.
+- Set version to +git%{rev_list} scheme as there's no official release yet.
+- Spec file cleanups via spec-cleaner.
+- Add requirement on libcontainers-{common,image,storage}, which provide
+  configuration files, manpages and debugging tools useful and required by
+  podman.
+
+-------------------------------------------------------------------
+Wed Feb  7 08:51:16 UTC 2018 - vrothberg@suse.com
+
+- Fix typo to provide the correct package.
+- Replace tabs with spaces.
+
+-------------------------------------------------------------------
+Mon Feb  5 06:40:05 UTC 2018 - vrothberg@suse.com
+
+- Fix libostree-devel %if condition for TW, Leap 15+ and SLES 15+.
+
+-------------------------------------------------------------------
+Thu Feb  1 12:38:03 UTC 2018 - vrothberg@suse.com
+
+- Use `%fdupes %buildroot/%_prefix` since `fdupes %buildroot` is not allowed
+  because you cannot make hardlinks between certain partitions.
+
+-------------------------------------------------------------------
+Tue Jan 30 15:33:21 UTC 2018 - vrothberg@suse.com
+
+- Add podman package: podman is a simple client only tool to help with
+  debugging issues when daemons such as CRI runtime and the kubelet are not
+  responding or failing.
diff --git a/podman.spec b/podman.spec
new file mode 100644
index 0000000..0cb8618
--- /dev/null
+++ b/podman.spec
@@ -0,0 +1,128 @@
+#
+# spec file for package podman
+#
+# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+#
+# All modifications and additions to the file contributed by third parties
+# remain the property of their copyright owners, unless otherwise agreed
+# upon. The license for this file, and modifications and additions to the
+# file, is the same license as for the pristine package itself (unless the
+# license for the pristine package is not an Open Source License, in which
+# case the license is the MIT License). An "Open Source License" is a
+# license that conforms to the Open Source Definition (Version 1.9)
+# published by the Open Source Initiative.
+
+# Please submit bugfixes or comments via http://bugs.opensuse.org/
+#
+
+
+%define project github.com/projectatomic/libpod
+%define commit c60d8a0671b48ffdeda68895e0b7d97b252d66d9
+# rev_list = git rev-list commit | wc -l
+%define rev_list 375
+# Build with libostree-devel in Tumbleweed, Leap 15 and SLES 15
+%if 0%{?suse_version} >= 1500
+%define with_libostree 1
+%endif
+Name:           podman
+Version:        0+git%{rev_list}
+Release:        0
+Summary:        Debugging tool for pods and images
+License:        Apache-2.0
+Group:          System/Management
+URL:            https://%{project}
+Source0:        %{name}-git.%{commit}.tar.xz
+BuildRequires:  bash-completion
+BuildRequires:  cni
+BuildRequires:  device-mapper-devel
+BuildRequires:  fdupes
+BuildRequires:  glib2-devel-static
+BuildRequires:  glibc-devel-static
+BuildRequires:  go-go-md2man
+BuildRequires:  golang(API) >= 1.7
+BuildRequires:  golang-packaging
+BuildRequires:  libapparmor-devel
+BuildRequires:  libassuan-devel
+BuildRequires:  libbtrfs-devel
+BuildRequires:  libgpgme-devel
+BuildRequires:  libseccomp-devel
+Requires:       cni
+Requires:       cri-o
+Requires:       libcontainers-common
+Requires:       libcontainers-image
+Requires:       libcontainers-storage
+Requires:       runc >= 1.0.0~rc4
+%{go_nostrip}
+%if 0%{?with_libostree}
+BuildRequires:  libostree-devel
+%endif
+
+%description
+podman is a simple client only tool to help with debugging issues when daemons
+such as CRI runtime and the kubelet are not responding or failing. A shared API
+layer could be created to share code between the daemon and podman. podman does
+not require any daemon running. podman utilizes the same underlying components
+that crio uses i.e. containers/image, container/storage,
+oci-runtime-tool/generate, runc or any other OCI compatible runtime. podman
+shares state with crio and so has the capability to debug pods/images created
+by crio.
+
+%prep
+%setup -q -n %{name}-git.%{commit}
+
+%build
+# We can't use symlinks here because go-list gets confused by symlinks, so we
+# have to copy the source to $HOME/go and then use that as the GOPATH.
+export GOPATH=$HOME/go
+mkdir -pv $HOME/go/src/%{project}
+rm -rf $HOME/go/src/%{project}/*
+cp -avr * $HOME/go/src/%{project}
+cd $HOME/go/src/%{project}
+
+%if 0%{?with_libostree}
+echo "Compiling with libostree support"
+export BUILDTAGS="seccomp apparmor"
+%else
+echo "Compiling without libostree support"
+export BUILDTAGS="seccomp apparmor containers_image_ostree_stub"
+%endif
+
+# Build podman
+go build -tags "$BUILDTAGS" \
+         -i -ldflags '-s -w -X main.podmanVersion=%{version} -X main.gitCommit=%{git_commit}' \
+         -o bin/podman \
+         %{project}/cmd/podman
+
+# Build manpages
+make %{?_smp_mflags} docs
+
+%check
+# Too many tests fail due to the restricted permissions in the build enviroment.
+# Updates must be tested manually.
+
+%install
+cd $HOME/go/src/%{project}
+
+# Binaries
+install -D -m 0755 bin/podman %{buildroot}/%{_bindir}/podman
+# Manpages
+install -d %{buildroot}/%{_mandir}/man1
+install -m 0644 docs/podman-*.1 %{buildroot}/%{_mandir}/man1
+# Configs
+install -D -m 0644 cni/87-podman-bridge.conflist %{buildroot}/%{_sysconfdir}/cni/net.d/87-podman-bridge.conflist
+# Completion
+install -D -m 0644 completions/bash/podman %{buildroot}/%{_sysconfdir}/bash_completion.d/podman
+
+%fdupes %{buildroot}/%{_prefix}
+
+%files
+# Binaries
+%{_bindir}/podman
+# Manpages
+%{_mandir}/man1/podman-*
+# Configs
+%config %{_sysconfdir}/cni/net.d/87-podman-bridge.conflist
+# Completion
+%config %{_sysconfdir}/bash_completion.d/podman
+
+%changelog