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