# Binary package of the upstream Linux release tarball (same approach as # AUR opencode-bin). COPR has network access, so Source URLs are fetched at # build time. Prebuilt Bun binary — do not strip or generate debuginfo. %global debug_package %{nil} %global __strip /bin/true Name: opencode Version: 2.0.27 Release: 1%{?dist} Summary: The open source AI coding agent built for the terminal License: MIT URL: https://github.com/anomalyco/opencode # Always list both arch tarballs so the SRPM works for multi-arch COPR builds. # Each tarball contains a single top-level binary named "opencode". Source0: https://opencode.ai/files/bin/%{version}/opencode-linux-x64.tar.gz#/%{name}-%{version}-linux-x64.tar.gz Source1: https://opencode.ai/files/bin/%{version}/opencode-linux-arm64.tar.gz#/%{name}-%{version}-linux-arm64.tar.gz # Local file in this package directory (must be committed next to the spec). Source2: LICENSE ExclusiveArch: x86_64 aarch64 # Runtime tools the CLI shells out to (matches Arch official package). Requires: ripgrep Requires: curl Requires: tar Recommends: libwayland-client.so.0()(64bit) BuildRequires: bash %description OpenCode is an open source AI coding agent for the terminal. It provides a TUI for interacting with AI models to help with coding tasks, debugging, and more. This package installs the official prebuilt Linux binary from upstream GitHub releases (same approach as AUR opencode-bin). %prep # Tarball has no enclosing directory; -c creates %%{name}-%%{version}/ for us. # -T skips the default Source0 unpack; -a N unpacks SourceN after chdir. %ifarch x86_64 %setup -q -c -n %{name}-%{version} -T -a 0 %endif %ifarch aarch64 %setup -q -c -n %{name}-%{version} -T -a 1 %endif cp -a %{SOURCE2} . %build # Prebuilt binary — nothing to compile. %install install -Dpm0755 opencode %{buildroot}%{_bindir}/opencode # Shell completions (generated by the binary, same as Arch packaging). install -ddm0755 %{buildroot}%{_datadir}/bash-completion/completions install -ddm0755 %{buildroot}%{_datadir}/zsh/site-functions %{buildroot}%{_bindir}/opencode --completions bash \ > %{buildroot}%{_datadir}/bash-completion/completions/opencode %{buildroot}%{_bindir}/opencode --completions zsh \ > %{buildroot}%{_datadir}/zsh/site-functions/_opencode chmod 0644 \ %{buildroot}%{_datadir}/bash-completion/completions/opencode \ %{buildroot}%{_datadir}/zsh/site-functions/_opencode %check %{buildroot}%{_bindir}/opencode --version | grep -Fqe "%{version}" %files %license LICENSE %{_bindir}/opencode %{_datadir}/bash-completion/completions/opencode %{_datadir}/zsh/site-functions/_opencode %changelog * Mon Oct 12 2026 vitrasti - 2.0.27-1 - Update to 2.0.27 * Sun Oct 11 2026 vitrasti - 2.0.26-1 - Update to 2.0.26 - Fetch release tarballs from opencode.ai - Generate completions with --completions * Sun Oct 11 2026 vitrasti - 1.19.0-1 - Update to 1.19.0 * Wed Oct 07 2026 vitrasti - 1.18.35-1 - Update to 1.18.35 * Sun Oct 04 2026 vitrasti - 1.18.34-1 - Update to 1.18.34 * Wed Sep 30 2026 vitrasti - 1.18.33-1 - Update to 1.18.33 * Wed Sep 23 2026 vitrasti - 1.18.32-1 - Update to 1.18.32 * Sun Sep 07 2026 vitrasti - 1.18.29-1 - Update to 1.18.29 * Sun Aug 16 2026 vitrasti - 1.18.18-1 - Initial package for personal COPR - Based on AUR opencode-bin / Arch Linux opencode packaging - Install official prebuilt Linux release binary - Ship bash/zsh completions generated by the binary