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