From 98a83d8fae641897d4b761de53cfcb611493d90d Mon Sep 17 00:00:00 2001 From: lleyton Date: Fri, 29 Dec 2023 23:42:51 -0800 Subject: [PATCH] package u-root (#868) --- anda/langs/go/u-root/anda.hcl | 5 ++ .../langs/go/u-root/golang-github-u-root.spec | 78 +++++++++++++++++++ anda/langs/go/u-root/update.rhai | 1 + 3 files changed, 84 insertions(+) create mode 100644 anda/langs/go/u-root/anda.hcl create mode 100644 anda/langs/go/u-root/golang-github-u-root.spec create mode 100644 anda/langs/go/u-root/update.rhai diff --git a/anda/langs/go/u-root/anda.hcl b/anda/langs/go/u-root/anda.hcl new file mode 100644 index 0000000000..1f398cf712 --- /dev/null +++ b/anda/langs/go/u-root/anda.hcl @@ -0,0 +1,5 @@ +project pkg { + rpm { + spec = "golang-github-u-root.spec" + } +} diff --git a/anda/langs/go/u-root/golang-github-u-root.spec b/anda/langs/go/u-root/golang-github-u-root.spec new file mode 100644 index 0000000000..e246b5b71c --- /dev/null +++ b/anda/langs/go/u-root/golang-github-u-root.spec @@ -0,0 +1,78 @@ +# Generated by go2rpm 1.9.0 +%bcond_without check +%define debug_package %nil + +# https://github.com/u-root/u-root +%global goipath github.com/u-root/u-root +Version: 0.11.0 + +%gometa -f + + +%global common_description %{expand: +A fully Go userland with Linux bootloaders! u-root can create a one-binary root +file system (initramfs) containing a busybox-like set of tools written in Go.} + +%global golicenses LICENSE +%global godocs docs examples AUTHORS SECURITY.md tricksandtips.md\\\ + CONTRIBUTING.md README.md roadmap.md\\\ + cmds/core/tail/test_samples/read_backwards.txt\\\ + cmds/core/tail/test_samples/read_from_beginning.txt\\\ + cmds/exp/esxiboot/README.md\\\ + configs/README.md\\\ + configs/amd64_config.txt configs/arm_config.txt\\\ + configs/generic_config.txt integration/README.md\\\ + pkg/boot/systembooter/README.md pkg/smbios/README.md\\\ + pkg/tarutil/test2.txt pkg/tarutil/test0/a.txt\\\ + pkg/tarutil/test0/dir/b.txt pkg/tarutil/test1/a1.txt\\\ + tools/golang_patched_dce/README.md + +Name: %{goname} +Release: %autorelease +Summary: A fully Go userland with Linux bootloaders! u-root can create a one-binary root file system (initramfs) containing a busybox-like set of tools written in Go + +License: BSD-3-Clause +URL: %{gourl} +Source: %{gosource} + +BuildRequires: anda-srpm-macros + +%description %{common_description} + +%gopkg + +%prep +%goprep +%autopatch -p1 + +go mod download + +%build +go build -ldflags "-B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -s -w -extldflags '--static-pie'" -buildmode=pie -tags 'osusergo,netgo,static_build' -v -x -o %{gobuilddir}/bin/u-root %{goipath} + +%install +%gopkginstall +install -m 0755 -vd %{buildroot}%{_bindir} +install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/ + +# if {with check} +# check +# gocheck +# endif + +%files +%license LICENSE +%doc docs examples AUTHORS SECURITY.md tricksandtips.md CONTRIBUTING.md +%doc README.md roadmap.md cmds/core/tail/test_samples/read_backwards.txt +%doc cmds/core/tail/test_samples/read_from_beginning.txt +%doc configs/README.md +%doc configs/amd64_config.txt configs/arm_config.txt configs/generic_config.txt +%doc integration/README.md pkg/boot/systembooter/README.md pkg/smbios/README.md +%doc pkg/tarutil/test2.txt pkg/tarutil/test0/a.txt pkg/tarutil/test0/dir/b.txt +%doc pkg/tarutil/test1/a1.txt tools/golang_patched_dce/README.md +%{_bindir}/* + +%gopkgfiles + +%changelog +%autochangelog diff --git a/anda/langs/go/u-root/update.rhai b/anda/langs/go/u-root/update.rhai new file mode 100644 index 0000000000..d510f97887 --- /dev/null +++ b/anda/langs/go/u-root/update.rhai @@ -0,0 +1 @@ +rpm.version(gh("u-root/u-root"));