Blob Blame History Raw
%global with_debug 1
%global with_bundled 1

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

%if 0%{?rhel} > 7 && ! 0%{?fedora}
%define gobuild(o:) \
go build -buildmode pie -compiler gc -tags="rpm_crashtraceback libtrust_openssl ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-} -compressdwarf=false -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags'" -a -v -x %{?**};
%endif

%global provider github
%global provider_tld com
%global project containers
%global repo buildah
# https://github.com/containers/buildah
%global import_path %{provider}.%{provider_tld}/%{project}/%{repo}
%global git0 https://%{import_path}

Name: %{repo}
Version: 1.14.9
Release: 1%{?dist}
Summary: A command line tool used for creating OCI Images
License: ASL 2.0
URL: https://%{name}.io
Source0: %{git0}/archive/v%{version}.tar.gz
BuildRequires: golang >= 1.12.12-4
BuildRequires: git
BuildRequires: glib2-devel
BuildRequires: libseccomp-devel
BuildRequires: ostree-devel
BuildRequires: glibc-static
BuildRequires: go-md2man
BuildRequires: gpgme-devel
BuildRequires: device-mapper-devel
BuildRequires: libassuan-devel
BuildRequires: make
Requires: runc >= 1.0.0-26
Requires: containers-common
Recommends: container-selinux
Requires: slirp4netns >= 0.3-0

%description
The %{name} package provides a command line tool which can be used to
* create a working container from scratch
or
* create a working container from an image as a starting point
* mount/umount a working container's root file system for manipulation
* save container's root file system layer to create a new image
* delete a working container or an image

%package tests
Summary: Tests for %{name}
Requires: %{name} = %{version}-%{release}
Requires: bzip2
Requires: podman
Requires: golang

%description tests
%{summary}

This package contains system tests for %{name}

%prep
%autosetup -Sgit
sed -i 's/GOMD2MAN =/GOMD2MAN ?=/' docs/Makefile
sed -i '/docs install/d' Makefile

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

mv vendor src

export GOPATH=$(pwd)/_build:$(pwd)
export BUILDTAGS='seccomp selinux btrfs_noversion exclude_graphdriver_btrfs'
export GO111MODULE=off
rm -f src/github.com/containers/storage/drivers/register/register_btrfs.go
%gobuild -o %{name} %{import_path}/cmd/%{name}
%gobuild -o imgtype %{import_path}/tests/imgtype
GOMD2MAN=go-md2man %{__make} -C docs

%install
export GOPATH=$(pwd)/_build:$(pwd):%{gopath}
make DESTDIR=%{buildroot} PREFIX=%{_prefix} install install.completions
install -d -p %{buildroot}/%{_datadir}/%{name}/test/system
cp -pav tests/. %{buildroot}/%{_datadir}/%{name}/test/system
cp imgtype %{buildroot}/%{_bindir}/%{name}-imgtype
make DESTDIR=%{buildroot} PREFIX=%{_prefix} -C docs install

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

%files
%license LICENSE
%doc README.md
%{_bindir}/%{name}
%{_mandir}/man1/%{name}*
%dir %{_datadir}/bash-completion
%dir %{_datadir}/bash-completion/completions
%{_datadir}/bash-completion/completions/%{name}

%files tests
%license LICENSE
%{_bindir}/%{name}-imgtype
%{_datadir}/%{name}/test

%changelog
* Tue May 19 2020 Jindrich Novy <jnovy@redhat.com> - 1.14.9-1
- update to https://github.com/containers/buildah/releases/tag/v1.14.9
- Related: RHELPLAN-39206

* Fri May 01 2020 Jindrich Novy <jnovy@redhat.com> - 1.14.8-2
- make container-selinux a soft dependency
- Related: #1806044

* Fri Apr 10 2020 Jindrich Novy <jnovy@redhat.com> - 1.14.8-1
- update to https://github.com/containers/buildah/releases/tag/v1.14.8
- Related: RHELPLAN-39206

* Thu Apr 09 2020 Jindrich Novy <jnovy@redhat.com> - 1.14.7-1
- initial rhel8-8.2.1 build
- update to https://github.com/containers/buildah/releases/tag/v1.14.7
- Related: RHELPLAN-39206