summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--LICENSE21
-rw-r--r--opencode.spec55
-rw-r--r--sources1
4 files changed, 78 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..9140688 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/opencode-linux-x64-1.19.5.tgz
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..6439474
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2025 opencode
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/opencode.spec b/opencode.spec
new file mode 100644
index 0000000..13b1dc9
--- /dev/null
+++ b/opencode.spec
@@ -0,0 +1,55 @@
+# topdir: package (npm 平台包 opencode-linux-x64 解压顶层目录)
+# 打包策略:opencode 上游使用 Bun 的 compile 能力将 TypeScript monorepo 编译为
+# 单一可执行 ELF 二进制。openEuler 官方源不提供 Bun 工具链,无法在构建阶段
+# 从源码编译;上游官方通过 GitHub release 与 npm 平台包发布预编译二进制。
+# 本包直接采用上游官方发布的 Linux x86_64 (glibc) 预编译二进制作为 Source0,
+# 无需 Node.js / Bun 运行时,仅依赖 glibc。
+# monorepo 内部 workspace 包(opencode-ai/plugin、script、sdk)在编译时
+# 已被打进二进制,运行时不作为独立 RPM 依赖。
+
+Name: opencode
+Version: 1.19.5
+Release: 1%{?dist}
+Summary: AI-powered development tool
+
+License: MIT
+URL: https://github.com/anomalyco/opencode
+# Source0 为 npm 平台包 opencode-linux-x64,内含上游官方预编译的 Linux x86_64
+# glibc 二进制(Bun compile 产物)。解压顶层目录为 package/。
+Source0: https://registry.npmjs.org/opencode-linux-x64/-/opencode-linux-x64-%{version}.tgz
+# Source1 为 MIT 许可证文本,取自上游 git 仓库对应版本 tag 根目录。
+Source1: https://raw.githubusercontent.com/anomalyco/opencode/v%{version}/LICENSE
+
+# 预编译二进制为 x86_64 专属 ELF(glibc 动态链接),仅在该架构提供。
+ExclusiveArch: x86_64
+
+%description
+opencode is an AI-powered development tool that runs coding agents in the
+terminal. This package ships the officially pre-compiled Linux x86_64 binary
+produced upstream with Bun's compile. Because the binary is self-contained
+(only requiring glibc), no Node.js or Bun toolchain is needed at build or
+runtime.
+
+%prep
+# npm tarball 解压顶层目录固定为 package/
+%setup -n package -q
+cp -p %{SOURCE1} .
+
+%build
+# Pre-compiled binary; nothing to build.
+
+%install
+install -Dpm 0755 bin/opencode %{buildroot}%{_bindir}/opencode
+
+%check
+# Verify the shipped binary reports the expected version.
+%{buildroot}%{_bindir}/opencode --version | grep -q "^%{version}$"
+
+%files
+%license LICENSE
+%{_bindir}/opencode
+
+%changelog
+* Thu Oct 29 2026 AI Importer <ai-importer@openeuler.org> - 1.19.5-1
+- Initial package for opencode 1.19.5
+- Ship upstream pre-compiled Linux x86_64 binary (Bun compile)
diff --git a/sources b/sources
new file mode 100644
index 0000000..f172b9d
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+bc8f54b9fdf03b5c2e71e3b095fd7398 opencode-linux-x64-1.19.5.tgz