package u-root (#868)

This commit is contained in:
lleyton
2023-12-29 23:42:51 -08:00
committed by GitHub
parent 46cbc46a49
commit 98a83d8fae
3 changed files with 84 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
project pkg {
rpm {
spec = "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
+1
View File
@@ -0,0 +1 @@
rpm.version(gh("u-root/u-root"));