Skip to content

Commit e3c786c

Browse files
committed
fix(rpm): introduce openshell_version macro; remove hardcoded versions
Add %global openshell_version as the single source of truth for the package version. Version:, Source0:, Source1:, openshell_cargo_version, and openshell_python_version all expand from this one macro. Update .packit.yaml fix-spec-file to patch %global openshell_version instead of the Version:, Source0:, and Source1: lines individually.
1 parent 1cc95f2 commit e3c786c

2 files changed

Lines changed: 10 additions & 11 deletions

File tree

‎.packit.yaml‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,10 @@ actions:
3535
- 'bash -c "echo openshell-${PACKIT_PROJECT_VERSION}.tar.gz"'
3636

3737
fix-spec-file:
38-
# Update Source0 to the generated tarball name
39-
- 'bash -c "sed -i \"s|^Source0:.*|Source0: openshell-${PACKIT_PROJECT_VERSION}.tar.gz|\" openshell.spec"'
40-
# Update Source1 to the generated vendor tarball name
41-
- 'bash -c "sed -i \"s|^Source1:.*|Source1: openshell-${PACKIT_PROJECT_VERSION}-vendor.tar.xz|\" openshell.spec"'
42-
# Update Version
43-
- 'bash -c "sed -i -r \"s/^Version:(\\s*)\\S+/Version:\\1${PACKIT_RPMSPEC_VERSION}/\" openshell.spec"'
38+
# Update the canonical version macro. Version:, Source0:, Source1:, and all
39+
# other version references expand from %{openshell_version} so only this
40+
# one line needs updating.
41+
- 'bash -c "sed -i -r \"s/^%global openshell_version .*/%global openshell_version ${PACKIT_RPMSPEC_VERSION}/\" openshell.spec"'
4442
# Update Release
4543
- 'bash -c "RELEASE=${OPENSHELL_RPM_RELEASE:-${PACKIT_RPMSPEC_RELEASE}} && sed -i -r \"s/^Release:(\\s*)\\S+/Release:\\1${RELEASE}%{?dist}/\" openshell.spec"'
4644
# Keep embedded binary metadata aligned with the release workflow. Python

‎openshell.spec‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
%global crate openshell
5-
%global openshell_cargo_version %{version}
5+
%global openshell_version 0.0.37
6+
%global openshell_cargo_version %{openshell_version}
67
# Python dist-info metadata intentionally follows the RPM Version. Dev build
78
# identity is represented by Release for RPM packages.
8-
%global openshell_python_version %{version}
9+
%global openshell_python_version %{openshell_version}
910

1011
# Cargo/Rust builds with vendored deps do not produce debugsource listings
1112
# in the format redhat-rpm-config expects (especially on EPEL).
@@ -18,14 +19,14 @@
1819
%global image_tag dev
1920

2021
Name: openshell
21-
Version: 0.0.43
22+
Version: %{openshell_version}
2223
Release: 1.20260518180028805757.podman.toml.gateway.listener.11.g8c0cb7c8%{?dist}
2324
Summary: Safe, sandboxed runtimes for autonomous AI agents
2425

2526
License: Apache-2.0
2627
URL: https://github.com/NVIDIA/OpenShell
27-
Source0: openshell-0.0.43.tar.gz
28-
Source1: openshell-0.0.43-vendor.tar.xz
28+
Source0: openshell-%{openshell_version}.tar.gz
29+
Source1: openshell-%{openshell_version}-vendor.tar.xz
2930

3031
ExclusiveArch: x86_64 aarch64
3132

0 commit comments

Comments
 (0)