Name: codex Version: 0.163.0 Release: 1%{?dist} Summary: OpenAI Codex CLI, a coding agent for the terminal License: Apache-2.0 URL: https://github.com/openai/codex # upstream tags are rust-v and the cargo workspace lives in codex-rs/ Source0: %{url}/archive/refs/tags/rust-v%{version}.tar.gz Source1: vendor.tar.zst BuildRequires: cargo-rpm-macros BuildRequires: openssl-devel BuildRequires: pkgconf-pkg-config # Bin-only crate: do not install sources into the cargo registry %global cargo_install_lib false %description Codex is OpenAI's command-line coding agent: an interactive terminal chat powered by OpenAI models, with sandboxed command execution, MCP support and session management. %prep %autosetup -n %{name}-rust-v%{version} -p1 -a 1 # codex-rs/vendor is Bazel-only (bubblewrap sources), not used by cargo rm -rf codex-rs/vendor # merge the codex-rs/ workspace into the top level: cp -a merges the dirs # that exist at both levels (docs, scripts, tools, .cargo), unlike mv cp -a codex-rs/. . rm -rf codex-rs %cargo_prep -v vendor %build # the cargo_build macro cannot pass --package through rpm option parsing %{__cargo} build %{__cargo_common_opts} --profile rpm --package codex-cli --bin codex %install install -m 0755 -vd %{buildroot}%{_bindir} install -m 0755 -vp target/rpm/codex %{buildroot}%{_bindir}/codex %{buildroot}%{_bindir}/codex completion bash > codex.bash %{buildroot}%{_bindir}/codex completion zsh > _codex %{buildroot}%{_bindir}/codex completion fish > codex.fish install -Dpm644 codex.bash %{buildroot}%{bash_completions_dir}/codex install -Dpm644 _codex %{buildroot}%{zsh_completions_dir}/_codex install -Dpm644 codex.fish %{buildroot}%{fish_completions_dir}/codex.fish %check %{buildroot}%{_bindir}/codex --version %files %license LICENSE %doc README.md %{_bindir}/codex %{bash_completions_dir}/codex %dir %{_datadir}/zsh %dir %{_datadir}/zsh/site-functions %{zsh_completions_dir}/_codex %dir %{_datadir}/fish %dir %{_datadir}/fish/vendor_completions.d %{fish_completions_dir}/codex.fish %changelog * Tue Oct 20 2026 Caio Bruno - 0.163.0-1 - Initial package