summaryrefslogtreecommitdiff
path: root/opencode.spec
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2026-10-29 09:12:28 +0000
committerCoprDistGit <infra@openeuler.org>2026-10-29 09:12:28 +0000
commit8ec19187512038f215639943c14770d37d1cdb4f (patch)
tree9f9152b6b0cb14cd7f0f0ea8e926aa337f4043f8 /opencode.spec
parent8f1929fd686d9751034524de087db2af571251b3 (diff)
automatic import of opencode
Diffstat (limited to 'opencode.spec')
-rw-r--r--opencode.spec25
1 files changed, 14 insertions, 11 deletions
diff --git a/opencode.spec b/opencode.spec
index f8a1601..d589caa 100644
--- a/opencode.spec
+++ b/opencode.spec
@@ -1,16 +1,19 @@
# 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.
+# so the ~79 MB npm platform package is fetched and checksum-verified during
+# %prep with networking enabled for this build. The binary inside the npm
+# package is byte-identical to the GitHub release asset for v1.19.5. The
+# resulting RPM installs the official upstream binary; it needs only glibc.
# 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
+# Huawei Cloud npm mirror is reachable from the EUR builders; the upstream
+# GitHub release host is not.
+%global upstream_url https://mirrors.huaweicloud.com/repository/npm/opencode-linux-x64/-/opencode-linux-x64-%{version}.tgz
+%global upstream_sha256 2d7cfc303decc6cbbcdb22ff1be258b03ce2b5eae57583545afc8f12c01dd5e0
Name: opencode
Version: 1.19.5
@@ -20,8 +23,8 @@ 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
+# package from the mirror and verifies it against upstream_sha256 above.
+Source0: opencode-linux-x64.tgz
Source1: https://raw.githubusercontent.com/anomalyco/opencode/v%{version}/LICENSE
ExclusiveArch: x86_64
@@ -39,17 +42,17 @@ 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 -
+curl --fail --location --retry 3 --output opencode-linux-x64.tgz %{upstream_url}
+echo '%{upstream_sha256} opencode-linux-x64.tgz' | sha256sum -c -
mkdir -p %{name}-%{version}
-tar -xzf opencode-linux-x64.tar.gz -C %{name}-%{version}
+tar -xzf opencode-linux-x64.tgz -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 0755 %{name}-%{version}/package/bin/opencode %{buildroot}%{_bindir}/opencode
install -Dpm 0644 %{name}-%{version}/LICENSE %{buildroot}%{_licensedir}/%{name}/LICENSE
%check