File go1.25.3-bin.spec of Package go1.25.3-bin

Name:           go1.25.3-bin
Version:        1.25.3
Release:        9%{?dist}
Summary:        Prebuilt Go programming language toolchain 1.25.3
Group:          Development/Languages

%global debug_package %{nil}
%global gorootname go%{version}
%global gorootdir %{_libdir}/%{gorootname}
%global gorootlink %{_libdir}/go
# Disable brp strip helpers; upstream binaries include non-ELF samples.
%global __brp_strip %{nil}
%global __brp_strip_comment_note %{nil}
%global __brp_strip_static %{nil}

License:        BSD-3-Clause
URL:            https://go.dev

ExclusiveArch:  x86_64 aarch64 i386 i586 i686 armv6hl armv6l armv7hl armv7l loongarch64 mips mips64 mips64el mipsel ppc64 ppc64le riscv64 s390x

%ifarch x86_64
%global go_tarball go%{version}.linux-amd64.tar.gz
%endif
%ifarch aarch64
%global go_tarball go%{version}.linux-arm64.tar.gz
%endif
%ifarch i386 i486 i586 i686
%global go_tarball go%{version}.linux-386.tar.gz
%endif
%ifarch armv6hl armv6l
%global go_tarball go%{version}.linux-armv6l.tar.gz
%endif
%ifarch armv7hl armv7l
%global go_tarball go%{version}.linux-armv6l.tar.gz
%endif
%ifarch loongarch64
%global go_tarball go%{version}.linux-loong64.tar.gz
%endif
%ifarch mips
%global go_tarball go%{version}.linux-mips.tar.gz
%endif
%ifarch mips64
%global go_tarball go%{version}.linux-mips64.tar.gz
%endif
%ifarch mips64el
%global go_tarball go%{version}.linux-mips64le.tar.gz
%endif
%ifarch mipsel
%global go_tarball go%{version}.linux-mipsle.tar.gz
%endif
%ifarch ppc64
%global go_tarball go%{version}.linux-ppc64.tar.gz
%endif
%ifarch ppc64le
%global go_tarball go%{version}.linux-ppc64le.tar.gz
%endif
%ifarch riscv64
%global go_tarball go%{version}.linux-riscv64.tar.gz
%endif
%ifarch s390x
%global go_tarball go%{version}.linux-s390x.tar.gz
%endif

%{!?go_tarball:%{error:Unsupported architecture %{_target_cpu}}}

Source0:        %{go_tarball}

Provides:       go = %{version}
Provides:       golang = %{version}
Provides:       golang%{?_isa} = %{version}
Conflicts:      go < %{version}

BuildRequires:  tar

%description
Go is an open source programming language that makes it easy to build simple,
reliable, and efficient software. This package installs the official upstream
prebuilt toolchain for Go %{version} directly from go.dev.

%prep
rm -rf go
tar -xzf %{SOURCE0}

%build
# Nothing to build, the toolchain is already compiled upstream.

%install
rm -rf %{buildroot}
mkdir -p %{buildroot}%{gorootdir}
cp -a go/* %{buildroot}%{gorootdir}

# Drop upstream Go tests to keep the payload lean and avoid rpmlint issues.
rm -rf %{buildroot}%{gorootdir}/test

mkdir -p %{buildroot}%{_libdir}
ln -snf %{gorootname} %{buildroot}%{gorootlink}

mkdir -p %{buildroot}%{_bindir}
ln -snf %{gorootdir}/bin/go %{buildroot}%{_bindir}/go
ln -snf %{gorootdir}/bin/gofmt %{buildroot}%{_bindir}/gofmt

%files
%doc %{gorootdir}/LICENSE
%doc %{gorootdir}/README.md
%{gorootdir}
%{gorootlink}
%{_bindir}/go
%{_bindir}/gofmt

%changelog
* Mon Oct 20 2025 Andres Morey <andres@kubetail.com> - 1.25.3-9
- Disabled brp-strip helpers.
* Mon Oct 20 2025 Andres Morey <andres@kubetail.com> - 1.25.3-8
- Added back src directory.
* Mon Oct 20 2025 Andres Morey <andres@kubetail.com> - 1.25.3-7
- Added Group field to spec for RHEL 5.
* Mon Oct 20 2025 Andres Morey <andres@kubetail.com> - 1.25.3-6
- Changed %license directive to %doc to support older systems.
* Mon Oct 20 2025 Andres Morey <andres@kubetail.com> - 1.25.3-5
- Added i386 and i486 to archs.
* Mon Oct 20 2025 Andres Morey <andres@kubetail.com> - 1.25.3-1
- Initial package
openSUSE Build Service is sponsored by