diff --git a/create-vendor-tarball.sh b/create-vendor-tarball.sh index 2c30eec..175dcd4 100755 --- a/create-vendor-tarball.sh +++ b/create-vendor-tarball.sh @@ -9,9 +9,6 @@ fi set -euo pipefail -PKG="gum" -REPO="https://github.com/charmbracelet/$PKG" - # transform tag into version # v2.0.0 -> 2.0.0 version=${tag#v} @@ -19,8 +16,8 @@ version=${tag#v} echo "Using tag: $tag" echo "Using version: $version" -git -c advice.detachedHead=false clone --branch $tag --depth 1 $REPO.git $PKG-$version -pushd $PKG-$version +git -c advice.detachedHead=false clone --branch $tag --depth 1 https://github.com/charmbracelet/gum.git gum-$version +pushd gum-$version GOPROXY='https://proxy.golang.org,direct' go mod vendor popd -tar -C $PKG-$version -czf $PKG-$version-vendor.tar.gz vendor +tar --exclude .git -czf gum-$version-vendored.tar.gz gum-$version diff --git a/gum.spec b/gum.spec index 3dcc095..8e5a87b 100644 --- a/gum.spec +++ b/gum.spec @@ -1,79 +1,111 @@ -%define goipath github.com/charmbracelet/gum +%global goipath github.com/charmbracelet/gum Name: gum -Version: 0.16.2 +Version: 0.14.5 Release: %autorelease Summary: Tool for glamorous shell scripts -URL: https://github.com/charmbracelet/gum - # main source code is MIT -# see comments above bundled provides for a breakdown of the rest +# see comments above provides tags for bundled license breakdown License: BSD-3-Clause AND MIT AND OFL-1.1 - -Source0: %{url}/archive/v%{version}/gum-%{version}.tar.gz -Source1: gum-%{version}-vendor.tar.gz -Source2: create-vendor-tarball.sh +URL: https://github.com/charmbracelet/gum BuildRequires: go-rpm-macros ExclusiveArch: %{golang_arches_future} -# https://github.com/charmbracelet/gum/commit/2e321f57e245147fe55ee58ef9c046db91b76e17 -BuildRequires: golang >= 1.23 -# BSD-3-Clause: -Provides: bundled(golang(github.com/atotto/clipboard)) = 0.1.4 -Provides: bundled(golang(github.com/gorilla/css)) = 1.0.1 -Provides: bundled(golang(github.com/microcosm-cc/bluemonday)) = 1.0.27 -Provides: bundled(golang(golang.org/x/exp)) = 7f521ea -Provides: bundled(golang(golang.org/x/net)) = 0.40.0 -Provides: bundled(golang(golang.org/x/sync)) = 0.15.0 -Provides: bundled(golang(golang.org/x/sys)) = 0.33.0 -Provides: bundled(golang(golang.org/x/term)) = 0.32.0 -Provides: bundled(golang(golang.org/x/text)) = 0.26.0 +# see create-vendor-tarball.sh for how to create this +Source0: gum-%{version}-vendored.tar.gz -# MIT: -Provides: bundled(golang(github.com/Masterminds/semver/v3)) = 3.3.1 -Provides: bundled(golang(github.com/alecthomas/kong)) = 1.11.0 -Provides: bundled(golang(github.com/alecthomas/mango-kong)) = 0.1.0 -Provides: bundled(golang(github.com/aymanbagabas/go-osc52/v2)) = 2.0.1 -Provides: bundled(golang(github.com/aymerick/douceur)) = 0.2.0 -Provides: bundled(golang(github.com/charmbracelet/bubbles)) = 0.21.0 -Provides: bundled(golang(github.com/charmbracelet/bubbletea)) = 1.3.5 -Provides: bundled(golang(github.com/charmbracelet/colorprofile)) = f60798e -Provides: bundled(golang(github.com/charmbracelet/glamour)) = 0.10.0 -Provides: bundled(golang(github.com/charmbracelet/lipgloss)) = 76690c6 -Provides: bundled(golang(github.com/charmbracelet/log)) = 0.4.2 -Provides: bundled(golang(github.com/charmbracelet/x/ansi)) = 0.9.3 -Provides: bundled(golang(github.com/charmbracelet/x/cellbuf)) = 0.0.13 -Provides: bundled(golang(github.com/charmbracelet/x/conpty)) = 0.1.0 -Provides: bundled(golang(github.com/charmbracelet/x/editor)) = 0.1.0 -Provides: bundled(golang(github.com/charmbracelet/x/errors)) = e8d8b6e -Provides: bundled(golang(github.com/charmbracelet/x/exp/slice)) = 2fdc977 -Provides: bundled(golang(github.com/charmbracelet/x/term)) = 0.2.1 -Provides: bundled(golang(github.com/charmbracelet/x/termios)) = 0.1.1 -Provides: bundled(golang(github.com/charmbracelet/x/xpty)) = 0.1.2 -Provides: bundled(golang(github.com/creack/pty)) = 1.1.24 -Provides: bundled(golang(github.com/dlclark/regexp2)) = 1.11.0 -Provides: bundled(golang(github.com/dustin/go-humanize)) = 1.0.1 -Provides: bundled(golang(github.com/erikgeiser/coninput)) = 1c3628e -Provides: bundled(golang(github.com/go-logfmt/logfmt)) = 0.6.0 -Provides: bundled(golang(github.com/lucasb-eyer/go-colorful)) = 1.2.0 -Provides: bundled(golang(github.com/mattn/go-isatty)) = 0.0.20 -Provides: bundled(golang(github.com/mattn/go-localereader)) = 0.0.1 -Provides: bundled(golang(github.com/mattn/go-runewidth)) = 0.0.16 -Provides: bundled(golang(github.com/muesli/ansi)) = 276c624 -Provides: bundled(golang(github.com/muesli/cancelreader)) = 0.2.2 -Provides: bundled(golang(github.com/muesli/mango)) = 0.2.0 -Provides: bundled(golang(github.com/muesli/reflow)) = 0.3.0 -Provides: bundled(golang(github.com/muesli/roff)) = 0.1.0 -Provides: bundled(golang(github.com/muesli/termenv)) = 0.16.0 -Provides: bundled(golang(github.com/rivo/uniseg)) = 0.4.7 -Provides: bundled(golang(github.com/sahilm/fuzzy)) = 0.1.1 -Provides: bundled(golang(github.com/xo/terminfo)) = abceb7e -Provides: bundled(golang(github.com/yuin/goldmark)) = 1.7.8 -Provides: bundled(golang(github.com/yuin/goldmark-emoji)) = 1.0.5 +# Script that creates vendor tarball +Source100: create-vendor-tarball.sh -# MIT AND OFL-1.1: +BuildRequires: golang + +# MIT AND OFL-1.1 Provides: bundled(golang(github.com/alecthomas/chroma/v2)) = 2.14.0 +# MIT +Provides: bundled(golang(github.com/alecthomas/kong)) = 0.9.0 +# MIT +Provides: bundled(golang(github.com/alecthomas/mango-kong)) = 0.1.0 +# BSD-3-Clause +Provides: bundled(golang(github.com/atotto/clipboard)) = 0.1.4 +# MIT +Provides: bundled(golang(github.com/aymanbagabas/go-osc52/v2)) = 2.0.1 +# MIT +Provides: bundled(golang(github.com/aymerick/douceur)) = 0.2.0 +# MIT +Provides: bundled(golang(github.com/catppuccin/go)) = 0.2.0 +# MIT +Provides: bundled(golang(github.com/charmbracelet/bubbles)) = 0.20.0 +# MIT +Provides: bundled(golang(github.com/charmbracelet/bubbletea)) = 1.1.0 +# MIT +Provides: bundled(golang(github.com/charmbracelet/glamour)) = 0.8.0 +# MIT +Provides: bundled(golang(github.com/charmbracelet/huh)) = 0.6.0 +# MIT +Provides: bundled(golang(github.com/charmbracelet/lipgloss)) = 0.13.0 +# MIT +Provides: bundled(golang(github.com/charmbracelet/log)) = 0.4.0 +# MIT +Provides: bundled(golang(github.com/charmbracelet/x/ansi)) = 0.2.3 +# MIT +Provides: bundled(golang(github.com/charmbracelet/x/exp/strings)) = 212f7b0 +# MIT +Provides: bundled(golang(github.com/charmbracelet/x/term)) = 0.2.0 +# MIT +Provides: bundled(golang(github.com/dlclark/regexp2)) = 1.11.0 +# MIT +Provides: bundled(golang(github.com/dustin/go-humanize)) = 1.0.1 +# MIT +Provides: bundled(golang(github.com/erikgeiser/coninput)) = 1c3628e +# MIT +Provides: bundled(golang(github.com/go-logfmt/logfmt)) = 0.6.0 +# BSD-3-Clause +Provides: bundled(golang(github.com/gorilla/css)) = 1.0.1 +# MIT +Provides: bundled(golang(github.com/lucasb-eyer/go-colorful)) = 1.2.0 +# MIT +Provides: bundled(golang(github.com/mattn/go-isatty)) = 0.0.20 +# MIT +Provides: bundled(golang(github.com/mattn/go-localereader)) = 0.0.1 +# MIT +Provides: bundled(golang(github.com/mattn/go-runewidth)) = 0.0.16 +# BSD-3-Clause +Provides: bundled(golang(github.com/microcosm-cc/bluemonday)) = 1.0.27 +# MIT +Provides: bundled(golang(github.com/mitchellh/hashstructure/v2)) = 2.0.2 +# MIT +Provides: bundled(golang(github.com/muesli/ansi)) = 276c624 +# MIT +Provides: bundled(golang(github.com/muesli/cancelreader)) = 0.2.2 +# MIT +Provides: bundled(golang(github.com/muesli/mango)) = 0.2.0 +# MIT +Provides: bundled(golang(github.com/muesli/reflow)) = 0.3.0 +# MIT +Provides: bundled(golang(github.com/muesli/roff)) = 0.1.0 +# MIT +Provides: bundled(golang(github.com/muesli/termenv)) = 98d742f +# MIT +Provides: bundled(golang(github.com/rivo/uniseg)) = 0.4.7 +# MIT +Provides: bundled(golang(github.com/sahilm/fuzzy)) = 0.1.1 +# MIT +Provides: bundled(golang(github.com/yuin/goldmark)) = 1.7.4 +# MIT +Provides: bundled(golang(github.com/yuin/goldmark-emoji)) = 1.0.3 +# BSD-3-Clause +Provides: bundled(golang(golang.org/x/exp)) = 7f521ea +# BSD-3-Clause +Provides: bundled(golang(golang.org/x/net)) = 0.27.0 +# BSD-3-Clause +Provides: bundled(golang(golang.org/x/sync)) = 0.8.0 +# BSD-3-Clause +Provides: bundled(golang(golang.org/x/sys)) = 0.25.0 +# BSD-3-Clause +Provides: bundled(golang(golang.org/x/term)) = 0.22.0 +# BSD-3-Clause +Provides: bundled(golang(golang.org/x/text)) = 0.18.0 %description @@ -82,15 +114,16 @@ in your scripts and aliases without writing any Go code! %prep -%autosetup -a 1 +%autosetup mkdir -p src/$(dirname %{goipath}) ln -s $PWD src/%{goipath} # set the program version -sed -e '/Version = / s/""/"v%{version}"/' -i main.go +sed -e '/Version = / s/""/"%{version}"/' -i main.go %build +export GO111MODULE=off export GOPATH=$PWD %gobuild -o bin/gum %{goipath} @@ -114,7 +147,7 @@ install -d -m 0755 %{buildroot}%{fish_completions_dir} %check # ensure that the version was embedded correctly -[[ "$(./bin/gum --version)" == "gum version v%{version}" ]] || exit 1 +[[ "$(./bin/gum --version)" == "gum version %{version}" ]] || exit 1 # run the upstream tests export GOPATH=$PWD diff --git a/sources b/sources index acd03c1..38011e0 100644 --- a/sources +++ b/sources @@ -1,2 +1 @@ -SHA512 (gum-0.16.2.tar.gz) = 6067d1a332acd98372e4669c633b64f3c4f1b8e76232c737353eed9dc7210c535f182990050b365f6caae008857ceb29ddd5b22fc26c31670cadf7aabae5f82b -SHA512 (gum-0.16.2-vendor.tar.gz) = 837b88aa6176394e6d26b24945c076ee079c6e5ea2d331c82d12e6db98a6a78299f9c9c6f9ce9d4fb3dd384bc58193c3ad0a26c462d4a0ae35f635669e0c70ce +SHA512 (gum-0.14.5-vendored.tar.gz) = 6b85bbd8718114f168303c2d682429a4d7b45e349827d66787ecd720a6eb3f427670f515c8203f4341ce03ce2c16ee4cc5e75310341a6fbfaa74b28f8854d36c