From d2c06fb513dda3bd4a1811b84a3ef5b66cf0519d Mon Sep 17 00:00:00 2001 From: Raboneko <119771935+raboneko@users.noreply.github.com> Date: Mon, 22 Sep 2025 18:12:14 -0700 Subject: [PATCH] add: natscli (#6467) (#6474) * add: natscli package * add go spec macros and nightly tag --------- (cherry picked from commit 559ad5debe03d1542a311010ded2d28db5ad8547) Signed-off-by: Ruka <10516443+ru-ka@users.noreply.github.com> Co-authored-by: Ruka <10516443+ru-ka@users.noreply.github.com> Co-authored-by: Owen Zimmerman <123591347+Owen-sz@users.noreply.github.com> --- anda/tools/natscli/anda.hcl | 8 ++++++ anda/tools/natscli/natscli.spec | 46 +++++++++++++++++++++++++++++++++ anda/tools/natscli/update.rhai | 5 ++++ 3 files changed, 59 insertions(+) create mode 100644 anda/tools/natscli/anda.hcl create mode 100644 anda/tools/natscli/natscli.spec create mode 100644 anda/tools/natscli/update.rhai diff --git a/anda/tools/natscli/anda.hcl b/anda/tools/natscli/anda.hcl new file mode 100644 index 0000000000..1ddcd48556 --- /dev/null +++ b/anda/tools/natscli/anda.hcl @@ -0,0 +1,8 @@ +project pkg { + rpm { + spec = "natscli.spec" + } + labels { + nightly = 1 + } +} diff --git a/anda/tools/natscli/natscli.spec b/anda/tools/natscli/natscli.spec new file mode 100644 index 0000000000..04c7992efc --- /dev/null +++ b/anda/tools/natscli/natscli.spec @@ -0,0 +1,46 @@ +# https://github.com/nats-io/natscli +%global goipath github.com/nats-io/natscli +%global commit 607ceaac6bb542dacadb52573fb20bedc5b6228b +%global commit_date 20250919 +%global shortcommit %{sub %{commit} 1 7} + +%gometa -f + +Name: natscli +Version: 0~%{commit_date}git.%shortcommit +Release: 1%{?dist} +Summary: The NATS Command Line Interface + +License: Apache-2.0 +URL: %{gourl} +Source0: %{gosource} + +Packager: Ruka + +BuildRequires: go +BuildRequires: git +BuildRequires: anda-srpm-macros + +%description +A command line utility to interact with and manage NATS. + +%prep +%goprep -A + +%build +%define currentgoldflags -X main.version=%{version} -X main.commit=%{commit} -X main.date=%{commit_date} +%define gomodulesmode GO111MODULE=on +%gobuild -o %{gobuilddir}/bin/nats %{goipath}/nats + +%install +install -m 0755 -vd %{buildroot}%{_bindir} +install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/ + +%files +%license LICENSE +%doc README.md AUTH.md LOCAL_DEVELOPMENT.md cli/cheats/* +%{_bindir}/nats + +%changelog +* Fri Sep 19 2025 Ruka - 0~20250919git.607ceaa-1 +- Initial packaging for Terra PKG diff --git a/anda/tools/natscli/update.rhai b/anda/tools/natscli/update.rhai new file mode 100644 index 0000000000..c00ddfcbd3 --- /dev/null +++ b/anda/tools/natscli/update.rhai @@ -0,0 +1,5 @@ +rpm.global("commit", gh_commit("nats-io/natscli")); +if rpm.changed() { + rpm.release(); + rpm.global("commit_date", date()); +} \ No newline at end of file