SHA256
1
0
forked from pool/podman
podman/podman.spec

128 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 98b95ff47f8387f47687fb2d1377b722bd6a2915
# 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.3.1
Release: 0
Summary: Debugging tool for pods and images
License: Apache-2.0
Group: System/Management
Url: https://github.com/projectatomic/libpod
Source0: %{name}-git.%{commit}.tar.xz
Source1: %{name}-rpmlintrc
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-packaging
BuildRequires: libapparmor-devel
BuildRequires: libassuan-devel
BuildRequires: libbtrfs-devel
BuildRequires: libgpgme-devel
BuildRequires: libseccomp-devel
BuildRequires: golang(API) >= 1.7
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