# opencode upstream ships a self-contained Linux x86_64 executable built with # Bun. The EUR upload endpoint rejects SRPMs larger than its nginx body limit, # so the ~80 MB release tarball is fetched and checksum-verified during %prep # with networking enabled for this build. The resulting RPM installs the # official upstream binary; it needs only glibc at runtime. # Bun embeds runtime/version metadata in ELF sections; stripping it makes # `opencode --version` report the Bun runtime version instead of 1.19.5. %global debug_package %{nil} %global __strip /bin/true %global upstream_url https://github.com/anomalyco/opencode/releases/download/v%{version}/opencode-linux-x64.tar.gz %global upstream_sha256 588310a336fa3b9df36b3f0225b26f679d453efaad0cf3d66c3651ef3ec1647a Name: opencode Version: 1.19.5 Release: 1%{?dist} Summary: The open source coding agent License: MIT URL: https://github.com/anomalyco/opencode # Source0 is a zero-byte placeholder in the SRPM; %prep downloads the real # tarball from upstream and verifies it against upstream_sha256 above. Source0: opencode-linux-x64.tar.gz Source1: https://raw.githubusercontent.com/anomalyco/opencode/v%{version}/LICENSE ExclusiveArch: x86_64 BuildRequires: curl BuildRequires: gzip BuildRequires: tar BuildRequires: coreutils BuildRequires: grep Requires: glibc %description opencode is an AI-powered development tool that runs coding agents in the terminal. This package ships the official self-contained Linux x86_64 executable published by upstream. It requires only glibc at runtime; Node.js and Bun are not needed. %prep curl --fail --location --retry 3 --output opencode-linux-x64.tar.gz %{upstream_url} echo '%{upstream_sha256} opencode-linux-x64.tar.gz' | sha256sum -c - mkdir -p %{name}-%{version} tar -xzf opencode-linux-x64.tar.gz -C %{name}-%{version} cp -p %{SOURCE1} %{name}-%{version}/LICENSE %build # Pre-compiled upstream binary; nothing to compile. %install install -Dpm 0755 %{name}-%{version}/opencode %{buildroot}%{_bindir}/opencode install -Dpm 0644 %{name}-%{version}/LICENSE %{buildroot}%{_licensedir}/%{name}/LICENSE %check %{buildroot}%{_bindir}/opencode --version | grep -qx '%{version}' %files %license %{_licensedir}/%{name}/LICENSE %{_bindir}/opencode %changelog * Thu Oct 29 2026 user_76c6f026 - 1.19.5-1 - Package opencode 1.19.5 for openEuler 24.03 LTS SP4 x86_64