Compare commits

...
Sign in to create a new pull request.

13 commits

Author SHA1 Message Date
Debarshi Ray
6d34184727 Don't use podman(1) when generating the completions
This is actually needed for Fedoras 36 and 37, but, at least currently,
not necessary for Fedoras 38 and 39.

https://github.com/containers/podman/issues/17657
2023-02-28 19:36:56 +01:00
Debarshi Ray
008f2fd173 Update to 0.0.99.4
https://bugzilla.redhat.com/show_bug.cgi?id=2171961
2023-02-28 12:57:28 +01:00
Debarshi Ray
cf648e5aa4 Remove a patch specific to Fedora that doesn't seem necessary anymore
There's no need to do a build just for this.
2023-02-28 12:22:10 +01:00
Debarshi Ray
4daed5535f Simplify and unify the build with RHEL
There's no need to do a build just for this.
2023-02-28 12:21:47 +01:00
Debarshi Ray
b9c4200fe6 Bump the golang requirement to ensure recent CVE fixes
'BuildRequires: golang >= 1.18.9' will ensure that recent CVEs like
CVE-2022-41717 remain fixed.

There's no need to do a build just for this, because the toolbox package
has either already been built with a sufficiently recent golang or will
soon be.

https://bugzilla.redhat.com/show_bug.cgi?id=2161274
2023-02-28 12:17:28 +01:00
Martin Jackson
a5de73782e Fix the ExclusiveArch
The %gometa RPM macro also generates a ExclusiveArch on %golang_arches
or %golang_arches_future depending on whether the -f flag is present or
not.  This was overriding the separately specified ExclusiveArch.

Fallout from ca45ccdce7

https://src.fedoraproject.org/rpms/toolbox/pull-request/12
2023-02-28 12:14:05 +01:00
Debarshi Ray
ca45ccdce7 Add ExclusiveArch to match Podman
There's no golang on %ix86 from RHEL 9 onwards [1], and hence no podman
either [2].

Recently, with Podman 4.4.1, there are also no new podman builds for
%ix86 for Fedora 36 onwards [3].  Arguably, the podman change should
have been limited to Fedora Rawhide, but it's probably not a big problem
because there's no %ix86 install media for Fedora CoreOS, Silverblue or
Workstation.

Note that while %golang_arches on RHEL 9 doesn't include %arm, it's
included in both %golang_arches and %golang_arches_future on Fedora.

[1] go-rpm-macros commit b1500ff47ee8cdd1
    https://src.fedoraproject.org/rpms/go-rpm-macros/c/b1500ff47ee8cdd1

[2] podman commit 555a5a504dd538d5
    https://src.fedoraproject.org/rpms/podman/c/555a5a504dd538d5

[3] podman commit 313c3e86a81c69eb
    https://src.fedoraproject.org/rpms/podman/c/313c3e86a81c69eb
2023-02-28 12:11:28 +01:00
Debarshi Ray
fb48d51300 Use %gomodulesmode introduced in go-rpm-macros-3.0.10
There's no need to do a build just for this.
2023-02-28 12:05:36 +01:00
Debarshi Ray
1cbafd315c Mark and comment out the unused BuildRequires for %check
Fallout from 84e5619113 and
12df1ef16a

There's no need to do a build just for this.
2023-02-28 12:03:02 +01:00
Debarshi Ray
7cae6d8371 Add missing 'BuildRequires: gcc'
A C compiler is necessary to build Toolbx [1].  GCC is being pulled in
by the other BuildRequires, but it's good to explicitly list it since
GCC isn't part of the default buildroot since Fedora 29 [2] and will
prevent the compiler from unexpectedly changing to Clang.

There's no need to do a build just for this.

[1] Upstream commit c8aaed52c547e24e
    c8aaed52c5
    https://github.com/containers/toolbox/pull/923

[2] https://fedoraproject.org/wiki/Changes/Remove_GCC_from_BuildRoot
2023-02-28 12:00:43 +01:00
Debarshi Ray
20d3523877 Drop redundant option from %meson
There's no need to pass the --buildtype=plain option to the %meson RPM
macro, because it's one of the default options used by the macro.

There's no need to do a build just for this.

Fallout from 33bd39b0f9
2023-02-23 19:16:32 +01:00
Fedora Release Engineering
84e5619113 Sync packaging changes from CentOS Stream 2023-02-23 19:14:56 +01:00
Yaakov Selkowitz
f24f9e1c6a Use vendored dependencies for RHEL 2023-02-23 19:07:28 +01:00
8 changed files with 182 additions and 220 deletions

2
.gitignore vendored
View file

@ -28,3 +28,5 @@
/toolbox-0.0.99.2^2.git40fbd377ed0b.tar.xz
/toolbox-0.0.99.2^3.git075b9a8d2779.tar.xz
/toolbox-0.0.99.3.tar.xz
/toolbox-0.0.99.3-vendor.tar.xz
/toolbox-0.0.99.4-vendored.tar.xz

View file

@ -1 +1 @@
SHA512 (toolbox-0.0.99.3.tar.xz) = d9e4bd1cc7667b6ecdcf25a2c3ad7d7d67cc997168a41e668c936d2de24db774331a78a1b4a06b63e7cef8e0dc4ac5651591b6d9cec0d8e81be2b2dd64854dca
SHA512 (toolbox-0.0.99.4-vendored.tar.xz) = 882cd6ec1c1a193af8774dfdfd0aff72d376c4fec3e0cc702e2d524353c051e408eab2ac3fb43ec00fe622b46ac89fdbe97aca2f7cfbe3822e5d3ff1743f2fd0

View file

@ -1,72 +0,0 @@
From 40fbd377ed0b94060ae5fb2a60289500b66486dc Mon Sep 17 00:00:00 2001
From: Oliver Gutierrez <ogutsua@gmail.com>
Date: Thu, 29 Jul 2021 14:12:41 +0100
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.
---
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 8b31365..502f691 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 cce3e5a..eb7f70c 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 fbad155..737f058 100644
--- a/src/go.sum
+++ b/src/go.sum
@@ -20,8 +20,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 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
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=
diff --git a/src/pkg/utils/utils.go b/src/pkg/utils/utils.go
index ae7c596..4d1556a 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"
"github.com/spf13/viper"
"golang.org/x/sys/unix"
--
2.31.1

View file

@ -0,0 +1,89 @@
From fc5f568c5d82f4a16982268fa67092e52be91fbe Mon Sep 17 00:00:00 2001
From: Debarshi Ray <rishi@fedoraproject.org>
Date: Tue, 28 Feb 2023 17:12:04 +0100
Subject: [PATCH] cmd/root: Don't use podman(1) when generating the completions
Ever since commit bafbbe81c9220cb3, the shell completions are generated
while building Toolbx using the 'completion' command. This involves
running toolbox(1) itself, and hence invoking 'podman version' to decide
if 'podman system migrate' is needed or not.
Unfortunately, some build environments, like Fedora's, are set up inside
a chroot(2) or systemd-nspawn(1) or similar, where 'podman version' may
not work because it does various things with namespaces(7) and clone(2)
that can, under certain circumstances, encounter an EPERM.
Therefore, it's better to avoid using podman(1) when generating the
shell completions, especially, since they are generated by Cobra itself
and podman(1) is not involved at all.
Note that podman(1) is needed when the generated shell completions are
actually used in interactive command line environments. The shell
completions invoke the hidden '__complete' command to get the results
that are presented to the user, and, if needed, 'podman system migrate'
will continue to be run as part of that.
This partially reverts commit f3e005d0142d7ec76d5ac8f0a2f331a52fd46011
because podman(1) is now only an optional runtime dependency for the
system tests.
https://github.com/containers/podman/issues/17657
---
meson.build | 2 +-
src/cmd/root.go | 9 +++++++--
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/meson.build b/meson.build
index 6f044bb204e3..653a3d3ac588 100644
--- a/meson.build
+++ b/meson.build
@@ -18,12 +18,12 @@ subid_dep = cc.find_library('subid', has_headers: ['shadow/subid.h'])
go = find_program('go')
go_md2man = find_program('go-md2man')
-podman = find_program('podman')
bats = find_program('bats', required: false)
codespell = find_program('codespell', required: false)
htpasswd = find_program('htpasswd', required: false)
openssl = find_program('openssl', required: false)
+podman = find_program('podman', required: false)
shellcheck = find_program('shellcheck', required: false)
skopeo = find_program('skopeo', required: false)
diff --git a/src/cmd/root.go b/src/cmd/root.go
index 304b03dcd889..9975ccc7a4c8 100644
--- a/src/cmd/root.go
+++ b/src/cmd/root.go
@@ -166,7 +166,7 @@ func preRun(cmd *cobra.Command, args []string) error {
logrus.Debugf("TOOLBOX_PATH is %s", toolboxPath)
- if err := migrate(); err != nil {
+ if err := migrate(cmd, args); err != nil {
return err
}
@@ -211,13 +211,18 @@ func rootRun(cmd *cobra.Command, args []string) error {
return rootRunImpl(cmd, args)
}
-func migrate() error {
+func migrate(cmd *cobra.Command, args []string) error {
logrus.Debug("Migrating to newer Podman")
if utils.IsInsideContainer() {
return nil
}
+ if cmdName, completionCmdName := cmd.Name(), completionCmd.Name(); cmdName == completionCmdName {
+ logrus.Debugf("Migration not needed: command %s doesn't need it", cmdName)
+ return nil
+ }
+
configDir, err := os.UserConfigDir()
if err != nil {
logrus.Debugf("Migrating to newer Podman: failed to get the user config directory: %s", err)
--
2.39.1

View file

@ -1,4 +1,4 @@
From 32aa30a17358598f568991a5375f6182e4135648 Mon Sep 17 00:00:00 2001
From 17a0e519fd9b1e721b35a823bd244a28e3f87a4a Mon Sep 17 00:00:00 2001
From: Debarshi Ray <rishi@fedoraproject.org>
Date: Mon, 29 Jun 2020 17:57:47 +0200
Subject: [PATCH] build: Make the build flags match Fedora's %{gobuild} for
@ -24,22 +24,22 @@ and should be kept updated to match Fedora's Go guidelines. Use
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/src/go-build-wrapper b/src/go-build-wrapper
index ef4aafc8b024..f8ea8370792c 100755
index c572d6dfb02b..cae2de426a96 100755
--- a/src/go-build-wrapper
+++ b/src/go-build-wrapper
@@ -32,9 +32,9 @@ if ! cd "$1"; then
@@ -33,9 +33,9 @@ if ! cd "$1"; then
exit 1
fi
-tags=""
+tags="-tags rpm_crashtraceback,${BUILDTAGS:-}"
if $6; then
if $7; then
- tags="-tags migration_path_for_coreos_toolbox"
+ tags="$tags,migration_path_for_coreos_toolbox"
fi
if ! libc_dir=$("$4" --print-file-name=libc.so); then
@@ -69,11 +69,16 @@ fi
if ! libc_dir=$("$5" --print-file-name=libc.so); then
@@ -70,11 +70,16 @@ fi
dynamic_linker="/run/host$dynamic_linker_canonical_dirname/$dynamic_linker_basename"
@ -50,14 +50,14 @@ index ef4aafc8b024..f8ea8370792c 100755
+ -compiler gc \
$tags \
- -trimpath \
- -ldflags "-extldflags '-Wl,-dynamic-linker,$dynamic_linker -Wl,-rpath,/run/host$libc_dir_canonical_dirname' -linkmode external -X github.com/containers/toolbox/pkg/version.currentVersion=$3" \
+ -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -compressdwarf=false -extldflags '-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,-dynamic-linker,$dynamic_linker -Wl,-rpath,/run/host$libc_dir_canonical_dirname' -linkmode external -X github.com/containers/toolbox/pkg/version.currentVersion=$3" \
- -ldflags "-extldflags '-Wl,-dynamic-linker,$dynamic_linker -Wl,-rpath,/run/host$libc_dir_canonical_dirname' -linkmode external -X github.com/containers/toolbox/pkg/version.currentVersion=$4" \
+ -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -compressdwarf=false -extldflags '-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -Wl,-dynamic-linker,$dynamic_linker -Wl,-rpath,/run/host$libc_dir_canonical_dirname' -linkmode external -X github.com/containers/toolbox/pkg/version.currentVersion=$4" \
+ -a \
+ -v \
+ -x \
-o "$2/toolbox"
-o "$2/$3"
exit "$?"
--
2.31.1
2.39.1

View file

@ -1,4 +1,4 @@
From 6d913f1fbd6e609957bb01273504b2f479e1b546 Mon Sep 17 00:00:00 2001
From fd03e31c7d789413700db84af02894d5be70b5ee Mon Sep 17 00:00:00 2001
From: Debarshi Ray <rishi@fedoraproject.org>
Date: Mon, 29 Jun 2020 17:57:47 +0200
Subject: [PATCH] build: Make the build flags match Fedora's %{gobuild}
@ -23,22 +23,22 @@ PPC64, and should be kept updated to match Fedora's Go guidelines. Use
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/src/go-build-wrapper b/src/go-build-wrapper
index ef4aafc8b024..4354beceb215 100755
index c572d6dfb02b..0e6a2efa6853 100755
--- a/src/go-build-wrapper
+++ b/src/go-build-wrapper
@@ -32,9 +32,9 @@ if ! cd "$1"; then
@@ -33,9 +33,9 @@ if ! cd "$1"; then
exit 1
fi
-tags=""
+tags="-tags rpm_crashtraceback,${BUILDTAGS:-}"
if $6; then
if $7; then
- tags="-tags migration_path_for_coreos_toolbox"
+ tags="$tags,migration_path_for_coreos_toolbox"
fi
if ! libc_dir=$("$4" --print-file-name=libc.so); then
@@ -69,11 +69,17 @@ fi
if ! libc_dir=$("$5" --print-file-name=libc.so); then
@@ -70,11 +70,17 @@ fi
dynamic_linker="/run/host$dynamic_linker_canonical_dirname/$dynamic_linker_basename"
@ -50,14 +50,14 @@ index ef4aafc8b024..4354beceb215 100755
+ -compiler gc \
$tags \
- -trimpath \
- -ldflags "-extldflags '-Wl,-dynamic-linker,$dynamic_linker -Wl,-rpath,/run/host$libc_dir_canonical_dirname' -linkmode external -X github.com/containers/toolbox/pkg/version.currentVersion=$3" \
+ -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -compressdwarf=false -extldflags '-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,-dynamic-linker,$dynamic_linker -Wl,-rpath,/run/host$libc_dir_canonical_dirname' -linkmode external -X github.com/containers/toolbox/pkg/version.currentVersion=$3" \
- -ldflags "-extldflags '-Wl,-dynamic-linker,$dynamic_linker -Wl,-rpath,/run/host$libc_dir_canonical_dirname' -linkmode external -X github.com/containers/toolbox/pkg/version.currentVersion=$4" \
+ -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -compressdwarf=false -extldflags '-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -Wl,-dynamic-linker,$dynamic_linker -Wl,-rpath,/run/host$libc_dir_canonical_dirname' -linkmode external -X github.com/containers/toolbox/pkg/version.currentVersion=$4" \
+ -a \
+ -v \
+ -x \
-o "$2/toolbox"
-o "$2/$3"
exit "$?"
--
2.31.1
2.39.1

View file

@ -1,95 +0,0 @@
From e598e2160323b63310ad7b6def723eb1f8767f90 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20M=C3=ADchal?= <harrymichal@seznam.cz>
Date: Thu, 11 Nov 2021 18:18:52 +0200
Subject: [PATCH 02/13] cmd/root: Work around Cobra 1.1.2's handling of usage
functions
In version 1.1.2 of Cobra has been included a change[0] that changes
how custom usage functions are handled.
Example of the wrong behaviour:
$ toolbox --foo
Error: unknown flag: --foo
Run 'toolbox --help' for usage.Error: Run 'toolbox --help' for usage.
Desired behaviour:
$ toolbox --foo
Error: unknown flag: --foo
Run 'toolbox --help' for usage.
A workaround is to define a template string for the usage instead. The
template uses the templating language of Go[1]. See the default
template string in version 1.2.1[2].
Because the template is set only once, the executableBase needs to be
set before the template is applied. That required the move of
setUpGlobals() into init() of the cmd package. This is a better place
for the function call as init() is called earlier than Execute()[3].
Upstream issue: https://github.com/spf13/cobra/issues/1532
[0] https://github.com/spf13/cobra/pull/1044
[1] https://pkg.go.dev/text/template
[2] https://github.com/spf13/cobra/blob/v1.2.1/command.go#L491
[3] https://golang.org/doc/effective_go#init
https://github.com/containers/toolbox/pull/917
---
src/cmd/root.go | 20 ++++++++------------
1 file changed, 8 insertions(+), 12 deletions(-)
diff --git a/src/cmd/root.go b/src/cmd/root.go
index eb0622f..ad0753b 100644
--- a/src/cmd/root.go
+++ b/src/cmd/root.go
@@ -62,11 +62,6 @@ var (
)
func Execute() {
- if err := setUpGlobals(); err != nil {
- fmt.Fprintf(os.Stderr, "Error: %s\n", err)
- os.Exit(1)
- }
-
if err := rootCmd.Execute(); err != nil {
os.Exit(1)
}
@@ -75,6 +70,11 @@ func Execute() {
}
func init() {
+ if err := setUpGlobals(); err != nil {
+ fmt.Fprintf(os.Stderr, "Error: %s\n", err)
+ os.Exit(1)
+ }
+
persistentFlags := rootCmd.PersistentFlags()
persistentFlags.BoolVarP(&rootFlags.assumeYes,
@@ -96,7 +96,9 @@ func init() {
persistentFlags.CountVarP(&rootFlags.verbose, "verbose", "v", "Set log-level to 'debug'")
rootCmd.SetHelpFunc(rootHelp)
- rootCmd.SetUsageFunc(rootUsage)
+
+ usageTemplate := fmt.Sprintf("Run '%s --help' for usage.", executableBase)
+ rootCmd.SetUsageTemplate(usageTemplate)
}
func preRun(cmd *cobra.Command, args []string) error {
@@ -188,12 +190,6 @@ func rootRun(cmd *cobra.Command, args []string) error {
return rootRunImpl(cmd, args)
}
-func rootUsage(cmd *cobra.Command) error {
- err := fmt.Errorf("Run '%s --help' for usage.", executableBase)
- fmt.Fprintf(os.Stderr, "%s", err)
- return err
-}
-
func migrate() error {
logrus.Debug("Migrating to newer Podman")
--
2.34.1

View file

@ -1,42 +1,55 @@
%global __brp_check_rpaths %{nil}
Name: toolbox
Version: 0.0.99.3
Version: 0.0.99.4
%global goipath github.com/containers/%{name}
%gometa
Release: 6%{?dist}
%if 0%{?rhel} == 9
%gometa
%else
%gometa -f
%endif
Release: 1%{?dist}
Summary: Tool for containerized command line environments on Linux
License: ASL 2.0
URL: https://containertoolbx.org/
Source0: https://github.com/containers/%{name}/releases/download/%{version}/%{name}-%{version}.tar.xz
Source0: https://github.com/containers/%{name}/releases/download/%{version}/%{name}-%{version}-vendored.tar.xz
# Upstream
Patch0: toolbox-Don-t-use-podman-1-when-generating-the-comp.patch
# Fedora specific
Patch100: toolbox-Don-t-use-Go-s-semantic-import-versioning.patch
Patch101: toolbox-Make-the-build-flags-match-Fedora-s-gobuild.patch
Patch102: toolbox-Make-the-build-flags-match-Fedora-s-gobuild-for-PPC64.patch
Patch103: toolbox-cmd-root-Work-around-Cobra-1.1.2-s-handling-of-usage.patch
Patch100: toolbox-Make-the-build-flags-match-Fedora-s-gobuild.patch
Patch101: toolbox-Make-the-build-flags-match-Fedora-s-gobuild-for-PPC64.patch
BuildRequires: ShellCheck
BuildRequires: gcc
BuildRequires: go-md2man
BuildRequires: golang >= 1.13
BuildRequires: golang(github.com/HarryMichal/go-version)
BuildRequires: golang(github.com/acobaugh/osrelease)
BuildRequires: golang(github.com/briandowns/spinner) >= 1.10.0
BuildRequires: golang >= 1.18.9
%if ! 0%{?rhel}
BuildRequires: golang(github.com/HarryMichal/go-version) >= 1.0.1
BuildRequires: golang(github.com/acobaugh/osrelease) >= 0.1.0
BuildRequires: golang(github.com/briandowns/spinner) >= 1.17.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/stretchr/testify) >= 1.7.0
BuildRequires: golang(github.com/spf13/cobra) >= 0.0.5
BuildRequires: golang(github.com/spf13/viper) >= 1.3.2
BuildRequires: golang(golang.org/x/crypto/ssh/terminal)
BuildRequires: golang(github.com/fsnotify/fsnotify) >= 1.5.1
BuildRequires: golang(github.com/godbus/dbus) >= 5.0.6
BuildRequires: golang(github.com/sirupsen/logrus) >= 1.8.1
BuildRequires: golang(github.com/spf13/cobra) >= 1.3.0
BuildRequires: golang(github.com/spf13/viper) >= 1.10.1
BuildRequires: golang(golang.org/x/sys/unix)
BuildRequires: golang(golang.org/x/term)
# for tests
# BuildRequires: codespell
# BuildRequires: golang(github.com/stretchr/testify) >= 1.7.0
# BuildRequires: ShellCheck
%endif
BuildRequires: meson >= 0.58.0
BuildRequires: pkgconfig(bash-completion)
BuildRequires: pkgconfig(fish)
BuildRequires: shadow-utils-subid-devel
BuildRequires: systemd
BuildRequires: systemd-rpm-macros
Requires: containers-common
@ -49,6 +62,8 @@ 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
other standard container technologies from OCI.
%if ! 0%{?rhel}
# 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
@ -122,6 +137,7 @@ 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.
%endif
%package tests
Summary: Tests for %{name}
@ -139,26 +155,26 @@ The %{name}-tests package contains system tests for %{name}.
%prep
%setup -q
%patch100 -p1
%patch0 -p1
%ifnarch ppc64
%patch101 -p1
%patch100 -p1
%else
%patch102 -p1
%patch101 -p1
%endif
%patch103 -p1
%gomkdir
%gomkdir -s %{_builddir}/%{extractdir}/src %{?rhel:-k}
%build
export GO111MODULE=off
export %{gomodulesmode}
export GOPATH=%{gobuilddir}:%{gopath}
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/pkg pkg
%meson --buildtype=plain -Dprofile_dir=%{_sysconfdir}/profile.d -Dtmpfiles_dir=%{_tmpfilesdir}
%meson \
-Dprofile_dir=%{_sysconfdir}/profile.d \
-Dtmpfiles_dir=%{_tmpfilesdir} \
-Dzsh_completions_dir=%{_datadir}/zsh/site-functions
%meson_build
@ -172,24 +188,46 @@ ln -s src/pkg pkg
%files
%doc CODE-OF-CONDUCT.md NEWS README.md SECURITY.md
%license COPYING
%license COPYING %{?rhel:src/vendor/modules.txt}
%{_bindir}/%{name}
%{_datadir}/bash-completion
%{_datadir}/fish
%{_datadir}/zsh
%{_mandir}/man1/%{name}.1*
%{_mandir}/man1/%{name}-*.1*
%{_mandir}/man5/%{name}.conf.5*
%config(noreplace) %{_sysconfdir}/containers/%{name}.conf
%{_sysconfdir}/profile.d/%{name}.sh
%{_tmpfilesdir}/%{name}.conf
%if ! 0%{?rhel}
%files support
%files experience
%endif
%files tests
%{_datadir}/%{name}
%changelog
* Wed Feb 22 2023 Debarshi Ray <rishi@fedoraproject.org> - 0.0.99.4-1
- Update to 0.0.99.4
* Wed Feb 22 2023 Martin Jackson <mhjacks@swbell.net> - 0.0.99.3-10
- Fix the ExclusiveArch
* Tue Feb 21 2023 Debarshi Ray <rishi@fedoraproject.org> - 0.0.99.3-9
- Add ExclusiveArch to match Podman
* Thu Feb 02 2023 Yaakov Selkowitz <yselkowi@redhat.com> - 0.0.99.3-8
- Sync packaging changes from CentOS Stream
* Thu Dec 22 2022 Yaakov Selkowitz <yselkowi@redhat.com> - 0.0.99.3-7
- Use vendored dependencies for RHEL/ELN builds
* Tue Jul 19 2022 Maxwell G <gotmax@e.email> - 0.0.99.3-6
- Rebuild for CVE-2022-{1705,32148,30631,30633,28131,30635,30632,30630,1962} in
golang