a5c0f1
%global with_debug 1
a5c0f1
%global with_bundled 1
a5c0f1
a5c0f1
%if 0%{?with_debug}
a5c0f1
%global _find_debuginfo_dwz_opts %{nil}
a5c0f1
%global _dwz_low_mem_die_limit 0
a5c0f1
%else
d27d84
%global debug_package %{nil}
a5c0f1
%endif
a5c0f1
a5c0f1
%if 0%{?rhel} > 7 && ! 0%{?fedora}
a5c0f1
%define gobuild(o:) \
b0eee6
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 %{?**};
b0eee6
%endif
a5c0f1
d27d84
%global provider github
d27d84
%global provider_tld com
d27d84
%global project containers
d27d84
%global repo buildah
d27d84
# https://github.com/containers/buildah
d27d84
%global import_path %{provider}.%{provider_tld}/%{project}/%{repo}
b0eee6
%global git0 https://%{import_path}
d27d84
d27d84
Name: %{repo}
43da73
Version: 1.14.9
43da73
Release: 1%{?dist}
d27d84
Summary: A command line tool used for creating OCI Images
d27d84
License: ASL 2.0
d27d84
URL: https://%{name}.io
43da73
Source0: %{git0}/archive/v%{version}.tar.gz
b0eee6
BuildRequires: golang >= 1.12.12-4
d27d84
BuildRequires: git
d27d84
BuildRequires: glib2-devel
b0eee6
BuildRequires: libseccomp-devel
d27d84
BuildRequires: ostree-devel
d27d84
BuildRequires: glibc-static
d27d84
BuildRequires: go-md2man
d27d84
BuildRequires: gpgme-devel
d27d84
BuildRequires: device-mapper-devel
d27d84
BuildRequires: libassuan-devel
b0eee6
BuildRequires: make
d27d84
Requires: runc >= 1.0.0-26
d27d84
Requires: containers-common
43da73
Recommends: container-selinux
b0eee6
Requires: slirp4netns >= 0.3-0
a5c0f1
a5c0f1
%description
a5c0f1
The %{name} package provides a command line tool which can be used to
a5c0f1
* create a working container from scratch
a5c0f1
or
a5c0f1
* create a working container from an image as a starting point
a5c0f1
* mount/umount a working container's root file system for manipulation
a5c0f1
* save container's root file system layer to create a new image
a5c0f1
* delete a working container or an image
a5c0f1
d27d84
%package tests
d27d84
Summary: Tests for %{name}
d27d84
Requires: %{name} = %{version}-%{release}
d27d84
Requires: bzip2
d27d84
Requires: podman
d27d84
Requires: golang
d27d84
d27d84
%description tests
d27d84
%{summary}
d27d84
d27d84
This package contains system tests for %{name}
d27d84
a5c0f1
%prep
43da73
%autosetup -Sgit
b0eee6
sed -i 's/GOMD2MAN =/GOMD2MAN ?=/' docs/Makefile
b0eee6
sed -i '/docs install/d' Makefile
d27d84
a5c0f1
%build
a5c0f1
mkdir _build
a5c0f1
pushd _build
a5c0f1
mkdir -p src/%{provider}.%{provider_tld}/%{project}
a5c0f1
ln -s $(dirs +1 -l) src/%{import_path}
a5c0f1
popd
a5c0f1
a5c0f1
mv vendor src
a5c0f1
d27d84
export GOPATH=$(pwd)/_build:$(pwd)
b0eee6
export BUILDTAGS='seccomp selinux btrfs_noversion exclude_graphdriver_btrfs'
b0eee6
export GO111MODULE=off
b0eee6
rm -f src/github.com/containers/storage/drivers/register/register_btrfs.go
a5c0f1
%gobuild -o %{name} %{import_path}/cmd/%{name}
b0eee6
%gobuild -o imgtype %{import_path}/tests/imgtype
b0eee6
GOMD2MAN=go-md2man %{__make} -C docs
a5c0f1
a5c0f1
%install
a5c0f1
export GOPATH=$(pwd)/_build:$(pwd):%{gopath}
a5c0f1
make DESTDIR=%{buildroot} PREFIX=%{_prefix} install install.completions
d27d84
install -d -p %{buildroot}/%{_datadir}/%{name}/test/system
d27d84
cp -pav tests/. %{buildroot}/%{_datadir}/%{name}/test/system
d27d84
cp imgtype %{buildroot}/%{_bindir}/%{name}-imgtype
b0eee6
make DESTDIR=%{buildroot} PREFIX=%{_prefix} -C docs install
d27d84
a5c0f1
#define license tag if not already defined
a5c0f1
%{!?_licensedir:%global license %doc}
a5c0f1
a5c0f1
%files
a5c0f1
%license LICENSE
a5c0f1
%doc README.md
a5c0f1
%{_bindir}/%{name}
a5c0f1
%{_mandir}/man1/%{name}*
a5c0f1
%dir %{_datadir}/bash-completion
a5c0f1
%dir %{_datadir}/bash-completion/completions
a5c0f1
%{_datadir}/bash-completion/completions/%{name}
a5c0f1
d27d84
%files tests
d27d84
%license LICENSE
d27d84
%{_bindir}/%{name}-imgtype
d27d84
%{_datadir}/%{name}/test
d27d84
a5c0f1
%changelog
43da73
* Tue May 19 2020 Jindrich Novy <jnovy@redhat.com> - 1.14.9-1
43da73
- update to https://github.com/containers/buildah/releases/tag/v1.14.9
43da73
- Related: RHELPLAN-39206
43da73
43da73
* Fri May 01 2020 Jindrich Novy <jnovy@redhat.com> - 1.14.8-2
43da73
- make container-selinux a soft dependency
43da73
- Related: #1806044
43da73
43da73
* Fri Apr 10 2020 Jindrich Novy <jnovy@redhat.com> - 1.14.8-1
43da73
- update to https://github.com/containers/buildah/releases/tag/v1.14.8
43da73
- Related: RHELPLAN-39206
43da73
43da73
* Thu Apr 09 2020 Jindrich Novy <jnovy@redhat.com> - 1.14.7-1
43da73
- initial rhel8-8.2.1 build
43da73
- update to https://github.com/containers/buildah/releases/tag/v1.14.7
43da73
- Related: RHELPLAN-39206