9aee22
# RHEL's RPM toolchain doesn't like the compressed DWARF data generated by the
9aee22
# Go toolchain.
9aee22
%global _dwz_low_mem_die_limit 0
9aee22
%global _find_debuginfo_dwz_opts %{nil}
9aee22
9aee22
Name:          toolbox
70c93c
Version:       0.0.99.3
9aee22
9aee22
%global goipath github.com/containers/%{name}
9aee22
%gometa
9aee22
9aee22
Release:       1%{?dist}
9aee22
Summary:       Unprivileged development environment
9aee22
9aee22
License:       ASL 2.0
9aee22
URL:           https://github.com/containers/%{name}
9aee22
9aee22
# https://github.com/containers/%%{name}/releases/download/%%{version}/%%{name}-%%{version}.tar.xz
9aee22
# A vendored tarball was created from the upstream tarball:
9aee22
# $ cd src
9aee22
# $ go mod vendor
9aee22
Source0:       %{name}-%{version}-vendored.tar.xz
70c93c
Source1:       %{name}.conf
9aee22
9aee22
# RHEL specific
9aee22
Patch100:      toolbox-Make-the-build-flags-match-RHEL-s-gobuild.patch
9aee22
Patch101:      toolbox-Make-the-build-flags-match-RHEL-s-gobuild-for-PPC64.patch
70c93c
Patch102:      toolbox-cmd-run-Make-sosreport-work-by-setting-the-HOST-envi.patch
70c93c
Patch103:      toolbox-cmd-root-Suggest-a-way-forward-if-coreos-toolbox-was.patch
9aee22
9aee22
# https://bugzilla.redhat.com/show_bug.cgi?id=1905383
9aee22
ExcludeArch:   %{ix86}
9aee22
9aee22
BuildRequires: golang >= 1.13
9aee22
BuildRequires: go-md2man
9aee22
BuildRequires: meson
9aee22
BuildRequires: pkgconfig(bash-completion)
9aee22
BuildRequires: systemd
9aee22
70c93c
Requires:      containers-common
9aee22
Requires:      podman >= 1.4.0
9aee22
9aee22
9aee22
%description
9aee22
Toolbox is a tool for Linux operating systems, which allows the use of
9aee22
containerized command line environments. It is built on top of Podman and
9aee22
other standard container technologies from OCI.
9aee22
9aee22
9aee22
%package       tests
9aee22
Summary:       Tests for %{name}
9aee22
9aee22
Requires:      %{name}%{?_isa} = %{version}-%{release}
9aee22
9aee22
%description   tests
9aee22
The %{name}-tests package contains system tests for %{name}.
9aee22
9aee22
9aee22
%prep
9aee22
%setup -q
9aee22
9aee22
%ifnarch ppc64
9aee22
%patch100 -p1
9aee22
%else
9aee22
%patch101 -p1
9aee22
%endif
9aee22
70c93c
%patch102 -p1
70c93c
%patch103 -p1
70c93c
9aee22
# %%gomkdir is absent from RHEL 8.
9aee22
GOBUILDDIR="$(pwd)/_build"
9aee22
GOSOURCEDIR="$(pwd)"
9aee22
if [[ ! -e "$GOBUILDDIR/bin" ]] ; then
9aee22
  install -m 0755 -vd "$GOBUILDDIR/bin"
9aee22
fi
9aee22
if [[ ! -e "$GOBUILDDIR/src/%{goipath}" ]] ; then
9aee22
  install -m 0755 -vd "$(dirname $GOBUILDDIR/src/%{goipath})"
9aee22
  ln -fs "$GOSOURCEDIR" "$GOBUILDDIR/src/%{goipath}"
9aee22
fi
9aee22
cd "$GOBUILDDIR/src/%{goipath}"
9aee22
9aee22
9aee22
%build
9aee22
export GO111MODULE=off
9aee22
GOBUILDDIR="$(pwd)/_build"
9aee22
export GOPATH="$GOBUILDDIR:%{gopath}"
9aee22
export CGO_CFLAGS="%{optflags} -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
9aee22
ln -s src/cmd cmd
9aee22
ln -s src/pkg pkg
9aee22
ln -s src/vendor vendor
9aee22
%meson --buildtype=plain -Dprofile_dir=%{_sysconfdir}/profile.d
9aee22
%meson_build
9aee22
9aee22
9aee22
%install
9aee22
%meson_install
70c93c
install -m0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/containers/%{name}.conf
9aee22
9aee22
9aee22
%files
9aee22
%doc CODE-OF-CONDUCT.md NEWS README.md SECURITY.md
9aee22
%license COPYING
9aee22
%{_bindir}/%{name}
9aee22
%{_datadir}/bash-completion
9aee22
%{_mandir}/man1/%{name}.1*
9aee22
%{_mandir}/man1/%{name}-*.1*
70c93c
%config(noreplace) %{_sysconfdir}/containers/%{name}.conf
9aee22
%{_sysconfdir}/profile.d/%{name}.sh
9aee22
%{_tmpfilesdir}/%{name}.conf
9aee22
9aee22
%files tests
9aee22
%{_datadir}/%{name}
9aee22
9aee22
9aee22
%changelog
70c93c
* Thu Dec 23 2021 Jindrich Novy <jnovy@redhat.com> - 0.0.99.3-1
70c93c
- Sync toolbox version with rhel8-8.6.0
70c93c
- Related: #2034066
70c93c
9aee22
* Tue Jan 12 2021 Jindrich Novy <jnovy@redhat.com> - 0.0.99-1
9aee22
- Update to 0.0.99
9aee22
- Related: #1883490
9aee22
9aee22
* Tue Jan 12 2021 Jindrich Novy <jnovy@redhat.com> - 0.0.98.1-3
9aee22
- remove bats as it's not present in RHEL
9aee22
- Related: #1883490
9aee22
9aee22
* Mon Jan 11 2021 Jindrich Novy <jnovy@redhat.com> - 0.0.98.1-2
9aee22
- harden the toolbox binary
9aee22
- minor fixes
9aee22
- Related: #1883490
9aee22
9aee22
* Fri Jan 08 2021 Debarshi Ray <rishi@fedoraproject.org> - 0.0.98.1-1
9aee22
- Rebase to github.com/containers/toolbox