blob: 13b1dc9f58ac09c6f4694cfa8b1206e58a150965 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
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)
|