# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit bash-completion-r1 go-module

EGO_SUM=(
	"github.com/apple/pkl-go v0.6.1-0.20240320183646-5827572b8112"
	"github.com/apple/pkl-go v0.6.1-0.20240320183646-5827572b8112/go.mod"
	"github.com/appscode/jsonpatch v1.0.1"
	"github.com/appscode/jsonpatch v1.0.1/go.mod"
	"github.com/aws/aws-sdk-go-v2 v1.27.0"
	"github.com/aws/aws-sdk-go-v2 v1.27.0/go.mod"
	"github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2"
	"github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2/go.mod"
	"github.com/aws/aws-sdk-go-v2/config v1.27.16"
	"github.com/aws/aws-sdk-go-v2/config v1.27.16/go.mod"
	"github.com/aws/aws-sdk-go-v2/credentials v1.17.16"
	"github.com/aws/aws-sdk-go-v2/credentials v1.17.16/go.mod"
	"github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.3"
	"github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.3/go.mod"
	"github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.7"
	"github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.7/go.mod"
	"github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.7"
	"github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.7/go.mod"
	"github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0"
	"github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0/go.mod"
	"github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.7"
	"github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.7/go.mod"
	"github.com/aws/aws-sdk-go-v2/service/acm v1.25.5"
	"github.com/aws/aws-sdk-go-v2/service/acm v1.25.5/go.mod"
	"github.com/aws/aws-sdk-go-v2/service/bedrockruntime v1.8.3"
	"github.com/aws/aws-sdk-go-v2/service/bedrockruntime v1.8.3/go.mod"
	"github.com/aws/aws-sdk-go-v2/service/cloudcontrol v1.18.5"
	"github.com/aws/aws-sdk-go-v2/service/cloudcontrol v1.18.5/go.mod"
	"github.com/aws/aws-sdk-go-v2/service/cloudformation v1.50.1"
	"github.com/aws/aws-sdk-go-v2/service/cloudformation v1.50.1/go.mod"
	"github.com/aws/aws-sdk-go-v2/service/ec2 v1.161.3"
	"github.com/aws/aws-sdk-go-v2/service/ec2 v1.161.3/go.mod"
	"github.com/aws/aws-sdk-go-v2/service/iam v1.32.4"
	"github.com/aws/aws-sdk-go-v2/service/iam v1.32.4/go.mod"
	"github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2"
	"github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2/go.mod"
	"github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.9"
	"github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.9/go.mod"
	"github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.9"
	"github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.9/go.mod"
	"github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.7"
	"github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.7/go.mod"
	"github.com/aws/aws-sdk-go-v2/service/kms v1.32.1"
	"github.com/aws/aws-sdk-go-v2/service/kms v1.32.1/go.mod"
	"github.com/aws/aws-sdk-go-v2/service/lightsail v1.37.3"
	"github.com/aws/aws-sdk-go-v2/service/lightsail v1.37.3/go.mod"
	"github.com/aws/aws-sdk-go-v2/service/rds v1.78.1"
	"github.com/aws/aws-sdk-go-v2/service/rds v1.78.1/go.mod"
	"github.com/aws/aws-sdk-go-v2/service/s3 v1.54.3"
	"github.com/aws/aws-sdk-go-v2/service/s3 v1.54.3/go.mod"
	"github.com/aws/aws-sdk-go-v2/service/servicequotas v1.21.4"
	"github.com/aws/aws-sdk-go-v2/service/servicequotas v1.21.4/go.mod"
	"github.com/aws/aws-sdk-go-v2/service/ssm v1.50.1"
	"github.com/aws/aws-sdk-go-v2/service/ssm v1.50.1/go.mod"
	"github.com/aws/aws-sdk-go-v2/service/sso v1.20.9"
	"github.com/aws/aws-sdk-go-v2/service/sso v1.20.9/go.mod"
	"github.com/aws/aws-sdk-go-v2/service/ssooidc v1.24.3"
	"github.com/aws/aws-sdk-go-v2/service/ssooidc v1.24.3/go.mod"
	"github.com/aws/aws-sdk-go-v2/service/sts v1.28.10"
	"github.com/aws/aws-sdk-go-v2/service/sts v1.28.10/go.mod"
	"github.com/aws/smithy-go v1.20.2"
	"github.com/aws/smithy-go v1.20.2/go.mod"
	"github.com/chzyer/logex v1.1.10/go.mod"
	"github.com/chzyer/logex v1.2.1"
	"github.com/chzyer/logex v1.2.1/go.mod"
	"github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod"
	"github.com/chzyer/readline v1.5.1"
	"github.com/chzyer/readline v1.5.1/go.mod"
	"github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod"
	"github.com/chzyer/test v1.0.0"
	"github.com/chzyer/test v1.0.0/go.mod"
	"github.com/cpuguy83/go-md2man/v2 v2.0.3"
	"github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod"
	"github.com/davecgh/go-spew v1.1.0/go.mod"
	"github.com/davecgh/go-spew v1.1.1"
	"github.com/davecgh/go-spew v1.1.1/go.mod"
	"github.com/evanphx/json-patch v4.0.0+incompatible"
	"github.com/evanphx/json-patch v4.0.0+incompatible/go.mod"
	"github.com/fatih/color v1.16.0"
	"github.com/fatih/color v1.16.0/go.mod"
	"github.com/google/go-cmp v0.6.0"
	"github.com/google/go-cmp v0.6.0/go.mod"
	"github.com/google/uuid v1.6.0"
	"github.com/google/uuid v1.6.0/go.mod"
	"github.com/gookit/color v1.5.4"
	"github.com/gookit/color v1.5.4/go.mod"
	"github.com/inconshreveable/mousetrap v1.1.0"
	"github.com/inconshreveable/mousetrap v1.1.0/go.mod"
	"github.com/jmespath/go-jmespath v0.4.0"
	"github.com/jmespath/go-jmespath v0.4.0/go.mod"
	"github.com/jmespath/go-jmespath/internal/testify v1.5.1"
	"github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod"
	"github.com/manifoldco/promptui v0.9.0"
	"github.com/manifoldco/promptui v0.9.0/go.mod"
	"github.com/mattn/go-colorable v0.1.13"
	"github.com/mattn/go-colorable v0.1.13/go.mod"
	"github.com/mattn/go-isatty v0.0.16/go.mod"
	"github.com/mattn/go-isatty v0.0.20"
	"github.com/mattn/go-isatty v0.0.20/go.mod"
	"github.com/mattn/go-runewidth v0.0.15"
	"github.com/mattn/go-runewidth v0.0.15/go.mod"
	"github.com/nathan-fiscaletti/consolesize-go v0.0.0-20220204101620-317176b6684d"
	"github.com/nathan-fiscaletti/consolesize-go v0.0.0-20220204101620-317176b6684d/go.mod"
	"github.com/pmezard/go-difflib v1.0.0"
	"github.com/pmezard/go-difflib v1.0.0/go.mod"
	"github.com/rivo/uniseg v0.2.0"
	"github.com/rivo/uniseg v0.2.0/go.mod"
	"github.com/russross/blackfriday/v2 v2.1.0"
	"github.com/russross/blackfriday/v2 v2.1.0/go.mod"
	"github.com/spf13/cobra v1.8.0"
	"github.com/spf13/cobra v1.8.0/go.mod"
	"github.com/spf13/pflag v1.0.5"
	"github.com/spf13/pflag v1.0.5/go.mod"
	"github.com/stretchr/objx v0.1.0/go.mod"
	"github.com/stretchr/testify v1.2.2/go.mod"
	"github.com/stretchr/testify v1.9.0"
	"github.com/stretchr/testify v1.9.0/go.mod"
	"github.com/vmihailenco/msgpack/v5 v5.4.1"
	"github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod"
	"github.com/vmihailenco/tagparser/v2 v2.0.0"
	"github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod"
	"github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e"
	"github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod"
	"golang.org/x/exp v0.0.0-20240222234643-814bf88cf225"
	"golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod"
	"golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod"
	"golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod"
	"golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod"
	"golang.org/x/sys v0.6.0/go.mod"
	"golang.org/x/sys v0.20.0"
	"golang.org/x/sys v0.20.0/go.mod"
	"golang.org/x/term v0.20.0"
	"golang.org/x/term v0.20.0/go.mod"
	"gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405"
	"gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod"
	"gopkg.in/yaml.v2 v2.2.8/go.mod"
	"gopkg.in/yaml.v2 v2.4.0"
	"gopkg.in/yaml.v2 v2.4.0/go.mod"
	"gopkg.in/yaml.v3 v3.0.1"
	"gopkg.in/yaml.v3 v3.0.1/go.mod"
	)
go-module_set_globals

DESCRIPTION="A development workflow tool for working with AWS CloudFormation"
HOMEPAGE="https://github.com/aws-cloudformation/rain"
SRC_URI="https://github.com/aws-cloudformation/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz
	${EGO_SUM_SRC_URI}"

LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64 ~x86"

src_compile() {
	ego build ./cmd/rain
}

src_test() {
	ego test -work ./...
}

src_install() {
	einstalldocs
	dobin rain

	newbashcomp docs/bash_completion.sh rain
	insinto /usr/share/zsh/site-functions
	newins docs/zsh_completion.sh _rain
}