Merged update from upstream sources

This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/toolbox.git#61252314d80ed2ca522615900e1d98abb4f76edc
This commit is contained in:
DistroBaker 2021-02-04 21:07:14 +00:00
parent 385ab10aa1
commit 34e225a9e8
7 changed files with 219 additions and 54 deletions

24
.gitignore vendored
View File

@ -1 +1,23 @@
/*.tar.xz /toolbox-0.0.6.tar.xz
/toolbox-0.0.7.tar.xz
/toolbox-0.0.8.tar.xz
/toolbox-0.0.9.tar.xz
/toolbox-0.0.10.tar.xz
/toolbox-0.0.11.tar.xz
/toolbox-0.0.12.tar.xz
/toolbox-0.0.13.tar.xz
/toolbox-0.0.14.tar.xz
/toolbox-0.0.15.tar.xz
/toolbox-0.0.16.tar.xz
/toolbox-0.0.17.tar.xz
/toolbox-0.0.18.tar.xz
/toolbox-0.0.91.tar.xz
/toolbox-0.0.92.tar.xz
/toolbox-0.0.93.tar.xz
/toolbox-0.0.94.tar.xz
/toolbox-0.0.95.tar.xz
/toolbox-0.0.96.tar.xz
/toolbox-0.0.97.tar.xz
/toolbox-0.0.98.tar.xz
/toolbox-0.0.98.1.tar.xz
/toolbox-0.0.99.tar.xz

3
README.md Normal file
View File

@ -0,0 +1,3 @@
# toolbox
The toolbox package

View File

@ -1 +1 @@
SHA512 (toolbox-0.0.99-vendored.tar.xz) = 8a62f8c6b755e9d7f714481ac80abdfe2d09a7392a8dc7fe19778da17df6e8c67760965c380e56e4517025823cc04470fae8b54f1c019689f2f04a3c34f43d6f SHA512 (toolbox-0.0.99.tar.xz) = a2b750894d902575b742249ee89526e876fdbc6353e0aa8aa262f230f6b0c53266c70c93b2921eef3c2189d93dc096bdeee1be11c9aff0ee110a4fcbcb782f88

View File

@ -0,0 +1,73 @@
From 4039c49b0cd2111cd1c505b9a9aef25aeebb6a0e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Harry=20M=C3=ADchal?= <harrymichal@seznam.cz>
Date: Sat, 27 Jun 2020 16:17:56 +0200
Subject: [PATCH] Don't use Go's semantic import versioning
Fedora doesn't support Go modules when building Go programs. This
means that source code using semantic import versioning can't be built.
https://github.com/containers/toolbox/pull/484
---
src/cmd/create.go | 2 +-
src/go.mod | 2 +-
src/go.sum | 4 ++--
src/pkg/utils/utils.go | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/cmd/create.go b/src/cmd/create.go
index 50938890b22f..29bc0f2c42f7 100644
--- a/src/cmd/create.go
+++ b/src/cmd/create.go
@@ -28,7 +28,7 @@ import (
"github.com/containers/toolbox/pkg/podman"
"github.com/containers/toolbox/pkg/shell"
"github.com/containers/toolbox/pkg/utils"
- "github.com/godbus/dbus/v5"
+ "github.com/godbus/dbus"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"golang.org/x/crypto/ssh/terminal"
diff --git a/src/go.mod b/src/go.mod
index 219d3d578992..7e1a6807fd7e 100644
--- a/src/go.mod
+++ b/src/go.mod
@@ -8,7 +8,7 @@ require (
github.com/briandowns/spinner v1.10.0
github.com/docker/go-units v0.4.0
github.com/fsnotify/fsnotify v1.4.7
- github.com/godbus/dbus/v5 v5.0.3
+ github.com/godbus/dbus v4.1.0+incompatible
github.com/mattn/go-isatty v0.0.8
github.com/sirupsen/logrus v1.4.2
github.com/spf13/cobra v0.0.5
diff --git a/src/go.sum b/src/go.sum
index 5a03a6823698..d9ce63604fcf 100644
--- a/src/go.sum
+++ b/src/go.sum
@@ -18,8 +18,8 @@ github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
-github.com/godbus/dbus/v5 v5.0.3 h1:ZqHaoEF7TBzh4jzPmqVhE/5A1z9of6orkAe5uHoAeME=
-github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
+github.com/godbus/dbus v4.1.0+incompatible h1:WqqLRTsQic3apZUK9qC5sGNfXthmPXzUZ7nQPrNITa4=
+github.com/godbus/dbus v4.1.0+incompatible/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
diff --git a/src/pkg/utils/utils.go b/src/pkg/utils/utils.go
index 5455298cbce4..3f7fc26147fc 100644
--- a/src/pkg/utils/utils.go
+++ b/src/pkg/utils/utils.go
@@ -33,7 +33,7 @@ import (
"github.com/acobaugh/osrelease"
"github.com/containers/toolbox/pkg/shell"
"github.com/docker/go-units"
- "github.com/godbus/dbus/v5"
+ "github.com/godbus/dbus"
"github.com/sirupsen/logrus"
"golang.org/x/sys/unix"
)
--
2.25.4

View File

@ -1,30 +1,30 @@
From eac80eca4f0e54e38459438ba56d6172fda8cd32 Mon Sep 17 00:00:00 2001 From e9bfc40bbbf7af1a20819b6840441cbe52a7d1b7 Mon Sep 17 00:00:00 2001
From: Debarshi Ray <rishi@fedoraproject.org> From: Debarshi Ray <rishi@fedoraproject.org>
Date: Mon, 29 Jun 2020 17:57:47 +0200 Date: Mon, 29 Jun 2020 17:57:47 +0200
Subject: [PATCH] build: Make the build flags match RHEL's %{gobuild} for PPC64 Subject: [PATCH] build: Make the build flags match Fedora's %{gobuild} for
PPC64
The Go toolchain doesn't play well with passing compiler and linker The Go toolchain doesn't play well with passing compiler and linker
flags via environment variables. The linker flags require a second flags via environment variables. The linker flags require a second
level of quoting, which leaves the build system without a quote level level of quoting, which leaves the build system without a quote level
to assign the flags to an environment variable like GOFLAGS. to assign the flags to an environment variable like GOFLAGS.
This is one reason why RHEL doesn't have a RPM macro with only the This is one reason why Fedora doesn't have a RPM macro with only the
flags. The %{gobuild} RPM macro includes the entire 'go build ...' flags. The %{gobuild} RPM macro includes the entire 'go build ...'
invocation. invocation.
The Go toolchain also doesn't like the LDFLAGS environment variable as The Go toolchain also doesn't like the LDFLAGS environment variable as
exported by RHEL's %{meson} RPM macro, and RHEL's RPM toolchain doesn't exported by Fedora's %{meson} RPM macro.
like the compressed DWARF data generated by the Go toolchain.
Note that these flags are only meant for the "ppc64" CPU architecture, Note that these flags are only meant for the "ppc64" CPU architecture,
and should be kept updated to match RHEL's Go guidelines. Use and should be kept updated to match Fedora's Go guidelines. Use
'rpm --eval "%{gobuild}"' to expand the %{gobuild} macro. 'rpm --eval "%{gobuild}"' to expand the %{gobuild} macro.
--- ---
src/go-build-wrapper | 3 ++- src/go-build-wrapper | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-) 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/go-build-wrapper b/src/go-build-wrapper diff --git a/src/go-build-wrapper b/src/go-build-wrapper
index 515e1d8a0670..3bd47ce5ae6f 100755 index 515e1d8a0670..8baaff53b329 100755
--- a/src/go-build-wrapper --- a/src/go-build-wrapper
+++ b/src/go-build-wrapper +++ b/src/go-build-wrapper
@@ -27,5 +27,6 @@ if ! cd "$1"; then @@ -27,5 +27,6 @@ if ! cd "$1"; then
@ -33,7 +33,7 @@ index 515e1d8a0670..3bd47ce5ae6f 100755
-go build -trimpath -ldflags "-extldflags '-Wl,--wrap,pthread_sigmask $4' -linkmode external -X github.com/containers/toolbox/pkg/version.currentVersion=$3" -o "$2/toolbox" -go build -trimpath -ldflags "-extldflags '-Wl,--wrap,pthread_sigmask $4' -linkmode external -X github.com/containers/toolbox/pkg/version.currentVersion=$3" -o "$2/toolbox"
+unset LDFLAGS +unset LDFLAGS
+go build -compiler gc -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-} -compressdwarf=false -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -extldflags '-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,--wrap,pthread_sigmask $4' -linkmode external -X github.com/containers/toolbox/pkg/version.currentVersion=$3" -a -v -x -o "$2/toolbox" +go build -compiler gc -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -extldflags '-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,--wrap,pthread_sigmask $4' -linkmode external -X github.com/containers/toolbox/pkg/version.currentVersion=$3" -a -v -x -o "$2/toolbox"
exit "$?" exit "$?"
-- --
2.29.2 2.29.2

View File

@ -1,30 +1,29 @@
From 856a7f524b63f9033c47a8169fbf8a1cfdf69683 Mon Sep 17 00:00:00 2001 From d204528ce3b3c70727c12e1911d1c5562b56d474 Mon Sep 17 00:00:00 2001
From: Debarshi Ray <rishi@fedoraproject.org> From: Debarshi Ray <rishi@fedoraproject.org>
Date: Mon, 29 Jun 2020 17:57:47 +0200 Date: Mon, 29 Jun 2020 17:57:47 +0200
Subject: [PATCH] build: Make the build flags match RHEL's %{gobuild} Subject: [PATCH] build: Make the build flags match Fedora's %{gobuild}
The Go toolchain doesn't play well with passing compiler and linker The Go toolchain doesn't play well with passing compiler and linker
flags via environment variables. The linker flags require a second flags via environment variables. The linker flags require a second
level of quoting, which leaves the build system without a quote level level of quoting, which leaves the build system without a quote level
to assign the flags to an environment variable like GOFLAGS. to assign the flags to an environment variable like GOFLAGS.
This is one reason why RHEL doesn't have a RPM macro with only the This is one reason why Fedora doesn't have a RPM macro with only the
flags. The %{gobuild} RPM macro includes the entire 'go build ...' flags. The %{gobuild} RPM macro includes the entire 'go build ...'
invocation. invocation.
The Go toolchain also doesn't like the LDFLAGS environment variable as The Go toolchain also doesn't like the LDFLAGS environment variable as
exported by RHEL's %{meson} RPM macro, and RHEL's RPM toolchain doesn't exported by Fedora's %{meson} RPM macro.
like the compressed DWARF data generated by the Go toolchain.
Note that these flags are meant for every CPU architecture other than Note that these flags are meant for every CPU architecture other than
PPC64, and should be kept updated to match RHEL's Go guidelines. Use PPC64, and should be kept updated to match Fedora's Go guidelines. Use
'rpm --eval "%{gobuild}"' to expand the %{gobuild} macro. 'rpm --eval "%{gobuild}"' to expand the %{gobuild} macro.
--- ---
src/go-build-wrapper | 3 ++- src/go-build-wrapper | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-) 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/go-build-wrapper b/src/go-build-wrapper diff --git a/src/go-build-wrapper b/src/go-build-wrapper
index 515e1d8a0670..453b4cfa872b 100755 index 515e1d8a0670..013a35e52a1a 100755
--- a/src/go-build-wrapper --- a/src/go-build-wrapper
+++ b/src/go-build-wrapper +++ b/src/go-build-wrapper
@@ -27,5 +27,6 @@ if ! cd "$1"; then @@ -27,5 +27,6 @@ if ! cd "$1"; then
@ -33,7 +32,7 @@ index 515e1d8a0670..453b4cfa872b 100755
-go build -trimpath -ldflags "-extldflags '-Wl,--wrap,pthread_sigmask $4' -linkmode external -X github.com/containers/toolbox/pkg/version.currentVersion=$3" -o "$2/toolbox" -go build -trimpath -ldflags "-extldflags '-Wl,--wrap,pthread_sigmask $4' -linkmode external -X github.com/containers/toolbox/pkg/version.currentVersion=$3" -o "$2/toolbox"
+unset LDFLAGS +unset LDFLAGS
+go build -buildmode pie -compiler gc -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-} -compressdwarf=false -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -extldflags '-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,--wrap,pthread_sigmask $4' -linkmode external -X github.com/containers/toolbox/pkg/version.currentVersion=$3" -a -v -x -o "$2/toolbox" +go build -buildmode pie -compiler gc -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -extldflags '-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,--wrap,pthread_sigmask $4' -linkmode external -X github.com/containers/toolbox/pkg/version.currentVersion=$3" -a -v -x -o "$2/toolbox"
exit "$?" exit "$?"
-- --
2.29.2 2.29.2

View File

@ -1,8 +1,3 @@
# RHEL's RPM toolchain doesn't like the compressed DWARF data generated by the
# Go toolchain.
%global _dwz_low_mem_die_limit 0
%global _find_debuginfo_dwz_opts %{nil}
Name: toolbox Name: toolbox
Version: 0.0.99 Version: 0.0.99
@ -14,26 +9,31 @@ Summary: Unprivileged development environment
License: ASL 2.0 License: ASL 2.0
URL: https://github.com/containers/%{name} URL: https://github.com/containers/%{name}
Source0: https://github.com/containers/%{name}/releases/download/%{version}/%{name}-%{version}.tar.xz
# https://github.com/containers/%%{name}/releases/download/%%{version}/%%{name}-%%{version}.tar.xz # Fedora specific
# A vendored tarball was created from the upstream tarball: Patch100: toolbox-Don-t-use-Go-s-semantic-import-versioning.patch
# $ cd src Patch101: toolbox-Make-the-build-flags-match-Fedora-s-gobuild.patch
# $ go mod vendor Patch102: toolbox-Make-the-build-flags-match-Fedora-s-gobuild-for-PPC64.patch
Source0: %{name}-%{version}-vendored.tar.xz
# RHEL specific
Patch100: toolbox-Make-the-build-flags-match-RHEL-s-gobuild.patch
Patch101: toolbox-Make-the-build-flags-match-RHEL-s-gobuild-for-PPC64.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1905383
ExcludeArch: %{ix86}
BuildRequires: ShellCheck
BuildRequires: golang >= 1.13 BuildRequires: golang >= 1.13
BuildRequires: go-md2man BuildRequires: golang-github-cpuguy83-md2man
BuildRequires: golang(github.com/HarryMichal/go-version)
BuildRequires: golang(github.com/acobaugh/osrelease)
BuildRequires: golang(github.com/briandowns/spinner) >= 1.10.0
BuildRequires: golang(github.com/docker/go-units) >= 0.4.0
BuildRequires: golang(github.com/fsnotify/fsnotify) >= 1.4.7
BuildRequires: golang(github.com/godbus/dbus) >= 5.0.3
BuildRequires: golang(github.com/mattn/go-isatty) >= 0.0.12
BuildRequires: golang(github.com/sirupsen/logrus) >= 1.4.2
BuildRequires: golang(github.com/spf13/cobra) >= 0.0.5
BuildRequires: golang(golang.org/x/sys/unix)
BuildRequires: meson BuildRequires: meson
BuildRequires: pkgconfig(bash-completion) BuildRequires: pkgconfig(bash-completion)
BuildRequires: systemd BuildRequires: systemd
Requires: flatpak-session-helper
Requires: podman >= 1.4.0 Requires: podman >= 1.4.0
@ -42,11 +42,82 @@ Toolbox is a tool for Linux operating systems, which allows the use of
containerized command line environments. It is built on top of Podman and containerized command line environments. It is built on top of Podman and
other standard container technologies from OCI. other standard container technologies from OCI.
# The list of requires packages for -support and -experience should be in sync with:
# https://github.com/containers/toolbox/blob/master/images/fedora/f33/extra-packages
%package support
Summary: Required packages for the container image to support %{name}
# These are really required to make the image work with toolbox
Requires: passwd
Requires: shadow-utils
Requires: vte-profile
%description support
The %{name}-support package contains all the required packages that are needed
to be installed in the OCI image to make it work with %{name}.
The %{name}-support package should be typically installed from the Dockerfile
if the image isn't based on the fedora-toolbox image.
%package experience
Summary: Set of packages to enhance the %{name} experience
Requires: %{name}-support = %{version}-%{release}
Requires: bash-completion
Requires: bzip2
Requires: diffutils
Requires: dnf-plugins-core
Requires: findutils
Requires: flatpak-spawn
Requires: fpaste
Requires: git
Requires: gnupg
Requires: gnupg2-smime
Requires: gvfs-client
Requires: hostname
Requires: iputils
Requires: jwhois
Requires: keyutils
Requires: krb5-libs
Requires: less
Requires: lsof
Requires: man-db
Requires: man-pages
Requires: mlocate
Requires: mtr
Requires: nss-mdns
Requires: openssh-clients
Requires: pigz
Requires: procps-ng
Requires: rsync
Requires: sudo
Requires: tcpdump
Requires: time
Requires: traceroute
Requires: tree
Requires: unzip
Requires: wget
Requires: which
Requires: words
Requires: xorg-x11-xauth
Requires: xz
Requires: zip
%description experience
The %{name}-experience package contains all the packages that should be
installed in the container to provide the same default experience as working
on the host.
The %{name}-experience package should be typically installed from the
Dockerfile if the image isn't based on the fedora-toolbox image.
%package tests %package tests
Summary: Tests for %{name} Summary: Tests for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release} Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: bats
%description tests %description tests
The %{name}-tests package contains system tests for %{name}. The %{name}-tests package contains system tests for %{name}.
@ -54,38 +125,31 @@ The %{name}-tests package contains system tests for %{name}.
%prep %prep
%setup -q %setup -q
%patch100 -p1
%ifnarch ppc64 %ifnarch ppc64
%patch100 -p1
%else
%patch101 -p1 %patch101 -p1
%else
%patch102 -p1
%endif %endif
# %%gomkdir is absent from RHEL 8. %gomkdir
GOBUILDDIR="$(pwd)/_build"
GOSOURCEDIR="$(pwd)"
if [[ ! -e "$GOBUILDDIR/bin" ]] ; then
install -m 0755 -vd "$GOBUILDDIR/bin"
fi
if [[ ! -e "$GOBUILDDIR/src/%{goipath}" ]] ; then
install -m 0755 -vd "$(dirname $GOBUILDDIR/src/%{goipath})"
ln -fs "$GOSOURCEDIR" "$GOBUILDDIR/src/%{goipath}"
fi
cd "$GOBUILDDIR/src/%{goipath}"
%build %build
export GO111MODULE=off export GO111MODULE=off
GOBUILDDIR="$(pwd)/_build" export GOPATH=%{gobuilddir}:%{gopath}
export GOPATH="$GOBUILDDIR:%{gopath}"
export CGO_CFLAGS="%{optflags} -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" export CGO_CFLAGS="%{optflags} -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
ln -s src/cmd cmd ln -s src/cmd cmd
ln -s src/pkg pkg ln -s src/pkg pkg
ln -s src/vendor vendor
%meson --buildtype=plain -Dprofile_dir=%{_sysconfdir}/profile.d %meson --buildtype=plain -Dprofile_dir=%{_sysconfdir}/profile.d
%meson_build %meson_build
%check
%meson_test
%install %install
%meson_install %meson_install
@ -100,13 +164,17 @@ ln -s src/vendor vendor
%{_sysconfdir}/profile.d/%{name}.sh %{_sysconfdir}/profile.d/%{name}.sh
%{_tmpfilesdir}/%{name}.conf %{_tmpfilesdir}/%{name}.conf
%files support
%files experience
%files tests %files tests
%{_datadir}/%{name} %{_datadir}/%{name}
%changelog %changelog
* Thu Jan 14 2021 Jindrich Novy <jnovy@redhat.com> - 0.0.99-2 * Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.99-2
- Update to 0.0.99 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Tue Jan 12 2021 Debarshi Ray <rishi@fedoraproject.org> - 0.0.99-1 * Tue Jan 12 2021 Debarshi Ray <rishi@fedoraproject.org> - 0.0.99-1
- Update to 0.0.99 - Update to 0.0.99