podman/podman.spec
Dominique Leuenberger bc0f80b980 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
2018-02-19 12:00:31 +00:00

129 lines
4.1 KiB
RPMSpec

#
# 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