6e8f39
# RHEL's RPM toolchain doesn't like the compressed DWARF data generated by the
6e8f39
# Go toolchain.
6e8f39
%global _dwz_low_mem_die_limit 0
6e8f39
%global _find_debuginfo_dwz_opts %{nil}
6e8f39
6e8f39
Name:          toolbox
6e8f39
Version:       0.0.99.3
6e8f39
6e8f39
%global goipath github.com/containers/%{name}
6e8f39
%gometa
6e8f39
6e8f39
Release:       0.4%{?dist}
6e8f39
Summary:       Unprivileged development environment
6e8f39
6e8f39
License:       ASL 2.0
6e8f39
URL:           https://github.com/containers/%{name}
6e8f39
6e8f39
# https://github.com/containers/%%{name}/releases/download/%%{version}/%%{name}-%%{version}.tar.xz
6e8f39
# A vendored tarball was created from the upstream tarball:
6e8f39
# $ cd src
6e8f39
# $ go mod vendor
6e8f39
Source0:       %{name}-%{version}-vendored.tar.xz
6e8f39
Source1:       %{name}.conf
6e8f39
6e8f39
# RHEL specific
6e8f39
Patch100:      toolbox-Make-the-build-flags-match-RHEL-s-gobuild.patch
6e8f39
Patch101:      toolbox-Make-the-build-flags-match-RHEL-s-gobuild-for-PPC64.patch
6e8f39
Patch102:      toolbox-cmd-run-Make-sosreport-work-by-setting-the-HOST-envi.patch
6e8f39
Patch103:      toolbox-cmd-root-Suggest-a-way-forward-if-coreos-toolbox-was.patch
6e8f39
6e8f39
# https://bugzilla.redhat.com/show_bug.cgi?id=1905383
6e8f39
ExcludeArch:   %{ix86}
6e8f39
6e8f39
BuildRequires: golang >= 1.13
6e8f39
BuildRequires: go-md2man
6e8f39
BuildRequires: meson
6e8f39
BuildRequires: pkgconfig(bash-completion)
6e8f39
BuildRequires: systemd
6e8f39
6e8f39
Requires:      containers-common
6e8f39
Requires:      podman >= 1.4.0
6e8f39
6e8f39
6e8f39
%description
6e8f39
Toolbox is a tool for Linux operating systems, which allows the use of
6e8f39
containerized command line environments. It is built on top of Podman and
6e8f39
other standard container technologies from OCI.
6e8f39
6e8f39
6e8f39
%package       tests
6e8f39
Summary:       Tests for %{name}
6e8f39
6e8f39
Requires:      %{name}%{?_isa} = %{version}-%{release}
6e8f39
6e8f39
%description   tests
6e8f39
The %{name}-tests package contains system tests for %{name}.
6e8f39
6e8f39
6e8f39
%prep
6e8f39
%setup -q
6e8f39
6e8f39
%ifnarch ppc64
6e8f39
%patch100 -p1
6e8f39
%else
6e8f39
%patch101 -p1
6e8f39
%endif
6e8f39
6e8f39
%patch102 -p1
6e8f39
%patch103 -p1
6e8f39
6e8f39
# %%gomkdir is absent from RHEL 8.
6e8f39
GOBUILDDIR="$(pwd)/_build"
6e8f39
GOSOURCEDIR="$(pwd)"
6e8f39
if [[ ! -e "$GOBUILDDIR/bin" ]] ; then
6e8f39
  install -m 0755 -vd "$GOBUILDDIR/bin"
6e8f39
fi
6e8f39
if [[ ! -e "$GOBUILDDIR/src/%{goipath}" ]] ; then
6e8f39
  install -m 0755 -vd "$(dirname $GOBUILDDIR/src/%{goipath})"
6e8f39
  ln -fs "$GOSOURCEDIR" "$GOBUILDDIR/src/%{goipath}"
6e8f39
fi
6e8f39
cd "$GOBUILDDIR/src/%{goipath}"
6e8f39
6e8f39
6e8f39
%build
6e8f39
export GO111MODULE=off
6e8f39
GOBUILDDIR="$(pwd)/_build"
6e8f39
export GOPATH="$GOBUILDDIR:%{gopath}"
6e8f39
export CGO_CFLAGS="%{optflags} -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
6e8f39
ln -s src/cmd cmd
6e8f39
ln -s src/pkg pkg
6e8f39
ln -s src/vendor vendor
6e8f39
%meson --buildtype=plain -Dprofile_dir=%{_sysconfdir}/profile.d
6e8f39
%meson_build
6e8f39
6e8f39
6e8f39
%install
6e8f39
%meson_install
6e8f39
install -m0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/containers/%{name}.conf
6e8f39
6e8f39
6e8f39
%files
6e8f39
%doc CODE-OF-CONDUCT.md NEWS README.md SECURITY.md
6e8f39
%license COPYING
6e8f39
%{_bindir}/%{name}
6e8f39
%{_datadir}/bash-completion
6e8f39
%{_mandir}/man1/%{name}.1*
6e8f39
%{_mandir}/man1/%{name}-*.1*
6e8f39
%config(noreplace) %{_sysconfdir}/containers/%{name}.conf
6e8f39
%{_sysconfdir}/profile.d/%{name}.sh
6e8f39
%{_tmpfilesdir}/%{name}.conf
6e8f39
6e8f39
%files tests
6e8f39
%{_datadir}/%{name}
6e8f39
6e8f39
6e8f39
%changelog
91885e
* Mon Sep 20 2021 Jindrich Novy <jnovy@redhat.com> - 0.0.99.3-0.4
6e8f39
- Switch to using the Toolbox-specific UBI image by default
91885e
- Related: #2001445
6e8f39
6e8f39
* Thu Sep 02 2021 Debarshi Ray <rishi@fedoraproject.org> - 0.0.99.3-0.3
6e8f39
- Suggest a way forward if coreos/toolbox was used
91885e
Resolves: #1998191, #2000914
6e8f39
6e8f39
* Thu Aug 26 2021 Jindrich Novy <jnovy@redhat.com> - 0.0.99.3-0.2
6e8f39
- Make sosreport work by setting the HOST environment variable
6e8f39
- Related: #1934415
6e8f39
6e8f39
* Wed Aug 11 2021 Jindrich Novy <jnovy@redhat.com> - 0.0.99.3-0.1
6e8f39
- change release to 0.x so it is obvious it is devel version
6e8f39
- Related: #1934415
6e8f39
6e8f39
* Thu Aug 05 2021 Jindrich Novy <jnovy@redhat.com> - 0.0.99.3-1
6e8f39
- Fix the build on CentOS Stream
6e8f39
- Related: #1934415
6e8f39
6e8f39
* Wed Jul 28 2021 Jindrich Novy <jnovy@redhat.com> - 0.0.99.2^1.git660b6970e998-1
6e8f39
- Add support for configuration files
6e8f39
Resolves: #1940082
6e8f39
- Related: #1934415
6e8f39
6e8f39
* Mon Jul 26 2021 Jindrich Novy <jnovy@redhat.com> - 0.0.99.2-4
6e8f39
- Instead of offering to log into a registry, just mention 'podman login'
6e8f39
- Related: #1934415
6e8f39
6e8f39
* Sat Jul 10 2021 Jindrich Novy <jnovy@redhat.com> - 0.0.99.2-3
6e8f39
- Expose the host's entire / in the container at /run/host
6e8f39
- Related: #1934415
6e8f39
6e8f39
* Mon Jul 05 2021 Jindrich Novy <jnovy@redhat.com> - 0.0.99.2-2
6e8f39
- Actually apply the patch to make 'toolbox' create or fall back to a
6e8f39
  container if possible
6e8f39
- Support logging into a registry if necessary
6e8f39
- Related: #1934415
6e8f39
6e8f39
* Fri Jul 02 2021 Jindrich Novy <jnovy@redhat.com> - 0.0.99.2-1
6e8f39
- Update to 0.0.99.2
6e8f39
- Make 'toolbox' create or fall back to a container if possible
6e8f39
Resolves: #1914687
6e8f39
- Related: #1934415
6e8f39
6e8f39
* Tue Jan 12 2021 Jindrich Novy <jnovy@redhat.com> - 0.0.99-1
6e8f39
- Update to 0.0.99
6e8f39
- Related: #1883490
6e8f39
6e8f39
* Tue Jan 12 2021 Jindrich Novy <jnovy@redhat.com> - 0.0.98.1-3
6e8f39
- remove bats as it's not present in RHEL
6e8f39
- Related: #1883490
6e8f39
6e8f39
* Mon Jan 11 2021 Jindrich Novy <jnovy@redhat.com> - 0.0.98.1-2
6e8f39
- harden the toolbox binary
6e8f39
- minor fixes
6e8f39
- Related: #1883490
6e8f39
6e8f39
* Fri Jan 08 2021 Debarshi Ray <rishi@fedoraproject.org> - 0.0.98.1-1
6e8f39
- Rebase to github.com/containers/toolbox