From 5af2cff64160dbd14996a03def334fcc920ccc89 Mon Sep 17 00:00:00 2001 From: Raboneko <119771935+raboneko@users.noreply.github.com> Date: Sun, 9 Feb 2025 09:52:46 -0800 Subject: [PATCH] add: golang-github-dhth-prs (#3254) (#3264) * add: prs * use mock to build * Revert "use mock to build" This reverts commit c69f4001117ffa07a97277fbb90283470d49eea0. * build without fedora macros (cherry picked from commit 73d7a032eff36c036bed554870a0b157c3e4b412) Co-authored-by: sadlerm4 --- anda/langs/go/prs/anda.hcl | 5 ++ anda/langs/go/prs/golang-github-dhth-prs.spec | 56 +++++++++++++++++++ anda/langs/go/prs/update.rhai | 1 + 3 files changed, 62 insertions(+) create mode 100644 anda/langs/go/prs/anda.hcl create mode 100644 anda/langs/go/prs/golang-github-dhth-prs.spec create mode 100644 anda/langs/go/prs/update.rhai diff --git a/anda/langs/go/prs/anda.hcl b/anda/langs/go/prs/anda.hcl new file mode 100644 index 0000000000..f82342d013 --- /dev/null +++ b/anda/langs/go/prs/anda.hcl @@ -0,0 +1,5 @@ +project pkg { + rpm { + spec = "golang-github-dhth-prs.spec" + } +} diff --git a/anda/langs/go/prs/golang-github-dhth-prs.spec b/anda/langs/go/prs/golang-github-dhth-prs.spec new file mode 100644 index 0000000000..6c90ba3335 --- /dev/null +++ b/anda/langs/go/prs/golang-github-dhth-prs.spec @@ -0,0 +1,56 @@ +# Generated by go2rpm 1.15.0 + +# https://github.com/dhth/prs +%global goipath github.com/dhth/prs +Version: 1.0.0 + +%gometa -f + +%global common_description %{expand: +Stay updated on PRs from your terminal.} + +%global golicenses LICENSE +%global godocs README.md ui/assets/help.md + +Name: golang-github-dhth-prs +Release: %autorelease +Summary: Stay updated on PRs from your terminal + +License: MIT +URL: %{gourl} +Source: %{gosource} + +BuildRequires: anda-srpm-macros +BuildRequires: git-core + +Packager: sadlerm + +%description %{common_description} + +%gopkg + +%prep +%git_clone https://%{goipath} v%{version} +%go_prep_online + +%build +go build -buildmode pie -compiler gc -tags="rpm_crashtraceback ${GO_BUILDTAGS-${BUILDTAGS-}}" -a -x \ + -ldflags "-B 0x$(echo "%{name}-%{version}-%{release}-${SOURCE_DATE_EPOCH:-}" | sha1sum | cut -d ' ' -f1) \ + -compressdwarf=false -linkmode=external \ + -extldflags '-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now \ + -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 \ + -Wl,--build-id=sha1'" \ + -o %{_builddir}/bin/prs . + +%install +install -m 0755 -vd %{buildroot}%{_bindir} +install -m 0755 -vp %{_builddir}/bin/* %{buildroot}%{_bindir}/ + +%files +%license LICENSE +%doc README.md ui/assets/help.md +%{_bindir}/prs + +%changelog +* Sun Feb 9 2025 sadlerm +- Initial package diff --git a/anda/langs/go/prs/update.rhai b/anda/langs/go/prs/update.rhai new file mode 100644 index 0000000000..f2a9168c14 --- /dev/null +++ b/anda/langs/go/prs/update.rhai @@ -0,0 +1 @@ +rpm.version(gh("dhth/prs"));