git: 29ce0be017f2 - main - sysutils/awslim: New port

From: Norikatsu Shigemura <nork_at_FreeBSD.org>
Date: Sun, 15 Jun 2025 06:21:43 UTC
The branch main has been updated by nork:

URL: https://cgit.FreeBSD.org/ports/commit/?id=29ce0be017f2ab434d218b051c21deffbf744a08

commit 29ce0be017f2ab434d218b051c21deffbf744a08
Author:     Norikatsu Shigemura <nork@FreeBSD.org>
AuthorDate: 2025-06-15 06:21:03 +0000
Commit:     Norikatsu Shigemura <nork@FreeBSD.org>
CommitDate: 2025-06-15 06:21:03 +0000

    sysutils/awslim: New port
    
    awslim is a CLI utility for AWS services.  This is written in Go and
    generated from the AWS SDK Go v2 service client.  Features include:
    
     - Improved performance compared to AWS CLI,
     - All methods of the AWS service client,
     - JSON and Jsonnet as input format,
     - JSON as output format (no support of TEXT),
     - Binding of a file to the input/output data structure of methods,
     - JMESPath to query the output,
     - AWS CLI configuration file (~/.aws/config) and the native
       configuration files (~/.config/awslim/config.(json|jsonnet|yaml|yml)).
    
    Approved by:    hrs (mentor)
---
 sysutils/Makefile                                  |  1 +
 sysutils/awslim/Makefile                           | 51 ++++++++++++++++++++++
 sysutils/awslim/distinfo                           | 21 +++++++++
 sysutils/awslim/files/compact-gen.yaml             | 22 ++++++++++
 sysutils/awslim/files/patch-all-services.yaml      | 18 ++++++++
 sysutils/awslim/files/patch-cmd_awslim-gen_main.go | 12 +++++
 sysutils/awslim/pkg-descr                          | 17 ++++++++
 7 files changed, 142 insertions(+)

diff --git a/sysutils/Makefile b/sysutils/Makefile
index e6cca41aa518..e81fb72f04d0 100644
--- a/sysutils/Makefile
+++ b/sysutils/Makefile
@@ -75,6 +75,7 @@
     SUBDIR += autojump
     SUBDIR += automounter
     SUBDIR += autorestic
+    SUBDIR += awslim
     SUBDIR += azure-agent
     SUBDIR += b2sum
     SUBDIR += b3sum
diff --git a/sysutils/awslim/Makefile b/sysutils/awslim/Makefile
new file mode 100644
index 000000000000..3130990787f3
--- /dev/null
+++ b/sysutils/awslim/Makefile
@@ -0,0 +1,51 @@
+PORTNAME=	awslim
+DISTVERSIONPREFIX=	v
+DISTVERSION=	0.4.0
+CATEGORIES=	sysutils
+
+MAINTAINER=	nork@FreeBSD.org
+COMMENT=	AWSCLi slim version for ${COMMENT_${FLAVOR}}
+WWW=		https://github.com/fujiwara/awslim
+
+LICENSE=	MIT
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+FLAVORS=	default compact
+FLAVOR?=	${FLAVORS:[1]}
+
+compact_PKGNAMESUFFIX=	-compact
+
+USES=		go:modules
+USE_GITHUB=	yes
+GH_ACCOUNT=	fujiwara
+GH_TUPLE=	alecthomas:kong:v1.10.0:alecthomas_kong/vendor/github.com/alecthomas/kong \
+		aws:aws-sdk-go-v2:v1.36.3:aws_aws_sdk_go/vendor/github.com/aws/aws-sdk-go-v2 \
+		aws:smithy-go:v1.22.2:aws_smithy_go/vendor/github.com/aws/smithy-go \
+		go-yaml:yaml:v2.2.8:go_yaml_yaml/vendor/gopkg.in/yaml.v2 \
+		goccy:go-yaml:v1.17.1:go_yaml/vendor/github.com/goccy/go-yaml \
+		google:go-jsonnet:v0.20.0:google_go_jsonnet/vendor/github.com/google/go-jsonnet \
+		kubernetes-sigs:yaml:v1.1.0:kubernetes_sigs_yaml/vendor/sigs.k8s.io/yaml \
+		jmespath:go-jmespath:v0.4.0:jmespath_go_jmespath/vendor/github.com/jmespath/go-jmespath \
+		mattn:go-shellwords:v1.0.12:mattn_go_shellwords/vendor/github.com/mattn/go-shellwords
+
+GO_ENV+=	GO_CMD="${GO_CMD}"
+GO_TARGET=	./cmd/awslim/main.go:awslim
+GO_BUILDFLAGS=	-tags netgo -ldflags "-s -w -extldflags "-static" -X github.com/fujiwara/awslim.Version=${DISTVERSION}"
+
+PLIST_FILES=	bin/awslim
+
+COMMENT_default=	all services
+COMMENT_compact=	selected services
+
+.if ${FLAVOR:U} == compact
+post-extract:
+	${LN} -sf ${FILESDIR}/compact-gen.yaml ${WRKSRC}/gen.yaml
+.else
+post-extract:
+	${LN} -sf all-services.yaml ${WRKSRC}/gen.yaml
+.endif
+
+pre-build:
+	cd ${GO_WRKSRC} && ${SETENVI} ${WRK_ENV} ${MAKE_ENV} ${GO_ENV} GOMAXPROCS=${MAKE_JOBS_NUMBER} GOPROXY=off ${GO_CMD} generate ${GO_BUILDFLAGS} ./cmd/awslim-gen .
+
+.include <bsd.port.mk>
diff --git a/sysutils/awslim/distinfo b/sysutils/awslim/distinfo
new file mode 100644
index 000000000000..f2d9a6567ec0
--- /dev/null
+++ b/sysutils/awslim/distinfo
@@ -0,0 +1,21 @@
+TIMESTAMP = 1749690287
+SHA256 (fujiwara-awslim-v0.4.0_GH0.tar.gz) = e08bc0b480d4297a1ceb6d669ed6fe12e84ef3af9ed54cf1ffdb475384935a61
+SIZE (fujiwara-awslim-v0.4.0_GH0.tar.gz) = 26656
+SHA256 (alecthomas-kong-v1.10.0_GH0.tar.gz) = a1a8abba946101394cbf15c2f449052b65cca2526169bd7eb3d79f57e2a94e8d
+SIZE (alecthomas-kong-v1.10.0_GH0.tar.gz) = 322112
+SHA256 (aws-aws-sdk-go-v2-v1.36.3_GH0.tar.gz) = 9f15888c55acccd592664427c0ac18318130a7990852fbd288ab7f7ec4f2e8a7
+SIZE (aws-aws-sdk-go-v2-v1.36.3_GH0.tar.gz) = 51861411
+SHA256 (aws-smithy-go-v1.22.2_GH0.tar.gz) = aa4185416c44ecd1cbd30a07398c664a293e22874c38ac8738d95a3b717232f0
+SIZE (aws-smithy-go-v1.22.2_GH0.tar.gz) = 471066
+SHA256 (go-yaml-yaml-v2.2.8_GH0.tar.gz) = 9632d0760e9a07c414f2b2b6cd453d6225e42ecea77906883b23f1f1d0546045
+SIZE (go-yaml-yaml-v2.2.8_GH0.tar.gz) = 72732
+SHA256 (goccy-go-yaml-v1.17.1_GH0.tar.gz) = 112fdb40aa102a258bed581ae4b230b330d80b186b0b6953ec58c69a61bd3dbd
+SIZE (goccy-go-yaml-v1.17.1_GH0.tar.gz) = 663082
+SHA256 (google-go-jsonnet-v0.20.0_GH0.tar.gz) = bf9923a848dba65fa99f6e926221ab4222c2f259ba837d279b43917962bc7d70
+SIZE (google-go-jsonnet-v0.20.0_GH0.tar.gz) = 705146
+SHA256 (kubernetes-sigs-yaml-v1.1.0_GH0.tar.gz) = 0ee3cfa6e0c3178df07213443ebac0d6ecc1178147f43f848ea7114acf621953
+SIZE (kubernetes-sigs-yaml-v1.1.0_GH0.tar.gz) = 14890
+SHA256 (jmespath-go-jmespath-v0.4.0_GH0.tar.gz) = aa86d00b6836345eee196c13df2df084a18e0b1159935de9289f2ef6a7fe375d
+SIZE (jmespath-go-jmespath-v0.4.0_GH0.tar.gz) = 128861
+SHA256 (mattn-go-shellwords-v1.0.12_GH0.tar.gz) = 9884291747f54aa51a946b0880854ec6ac6e1f4c06899ba9be5ae5a6364428db
+SIZE (mattn-go-shellwords-v1.0.12_GH0.tar.gz) = 6325
diff --git a/sysutils/awslim/files/compact-gen.yaml b/sysutils/awslim/files/compact-gen.yaml
new file mode 100644
index 000000000000..abdcb79d6dc4
--- /dev/null
+++ b/sysutils/awslim/files/compact-gen.yaml
@@ -0,0 +1,22 @@
+services:
+  cloudformation:
+  cloudfront:
+  cloudfrontkeyvaluestore:
+  cloudwatch:
+  cloudwatchevents:
+  cloudwatchlogs:
+  ebs:
+  ec2:
+  eventbridge:
+  iam:
+  kms:
+  lambda:
+  rds:
+  route53:
+  s3:
+  secretsmanager:
+  servicequotas:
+  ssm:
+  sso:
+  ssoadmin:
+  sts:
diff --git a/sysutils/awslim/files/patch-all-services.yaml b/sysutils/awslim/files/patch-all-services.yaml
new file mode 100644
index 000000000000..afaf3cb5896e
--- /dev/null
+++ b/sysutils/awslim/files/patch-all-services.yaml
@@ -0,0 +1,18 @@
+--- all-services.yaml.orig	2025-04-11 13:35:01 UTC
++++ all-services.yaml
+@@ -156,7 +156,6 @@ services:
+   freetier:
+   fsx:
+   gamelift:
+-  gameliftstreams:
+   geomaps:
+   geoplaces:
+   georoutes:
+@@ -187,7 +186,6 @@ services:
+   iotfleethub:
+   iotfleetwise:
+   iotjobsdataplane:
+-  iotmanagedintegrations:
+   iotsecuretunneling:
+   iotsitewise:
+   iotthingsgraph:
diff --git a/sysutils/awslim/files/patch-cmd_awslim-gen_main.go b/sysutils/awslim/files/patch-cmd_awslim-gen_main.go
new file mode 100644
index 000000000000..568ffc4fb425
--- /dev/null
+++ b/sysutils/awslim/files/patch-cmd_awslim-gen_main.go
@@ -0,0 +1,12 @@
+--- cmd/awslim-gen/main.go.orig	2025-04-11 13:35:01 UTC
++++ cmd/awslim-gen/main.go
+@@ -10,8 +10,7 @@ import (
+ 	"text/template"
+ )
+ 
+-//go:generate go run ../awslim-gen-gen/main.go
+-//go:generate go get ./...
++//go:generate ${GO_CMD} run ../awslim-gen-gen/main.go
+ 
+ const serviceTemplateStr = `// Code generated by cmd/awslim-gen/main.go; DO NOT EDIT.
+ package sdkclient
diff --git a/sysutils/awslim/pkg-descr b/sysutils/awslim/pkg-descr
new file mode 100644
index 000000000000..91776eca1f6b
--- /dev/null
+++ b/sysutils/awslim/pkg-descr
@@ -0,0 +1,17 @@
+awslim is a CLI utility for AWS services.  This is written in Go and
+generated from the AWS SDK Go v2 service client.  Features include:
+
+ - Improved performance compared to AWS CLI,
+ - All methods of the AWS service client,
+ - JSON and Jsonnet as input format,
+ - JSON as output format (no support of TEXT),
+ - Binding of a file to the input/output data structure of methods,
+ - JMESPath to query the output,
+ - AWS CLI configuration file (~/.aws/config) and the native
+   configuration files (~/.config/awslim/config.(json|jsonnet|yaml|yml)).
+
+Note the following limitations, compared to AWS CLI:
+ - Not fully-compatible with the AWS CLI,
+ - No support of AWS CLI plugins, such as session-manager-plugin,
+ - Different service names, "logs" vs "cloudwatchlogs,"
+   "ce" vs "costexplorer," for example.