diff options
Diffstat (limited to 'opencode.spec')
| -rw-r--r-- | opencode.spec | 55 |
1 files changed, 55 insertions, 0 deletions
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) |
