%bcond_without check Name: cargo2rpm Version: 0.3.3 Release: 6%{?dist} Summary: Translation layer between cargo and RPM License: MIT URL: https://codeberg.org/rust2rpm/cargo2rpm Source0: %{url}/archive/v%{version}.tar.gz %if 0%{?rhel} == 9 # Python 3.9 compatibility script Source1: python39-compat.py # Setup.py for RHEL9 compatibility Source2: setup.py %endif BuildArch: noarch BuildRequires: python3-devel %if %{with check} BuildRequires: %{py3_dist pytest} %endif Requires: cargo %description cargo2rpm implements a translation layer between cargo and RPM. It provides a CLI interface (for implementing RPM macros and generators) and a Python API (which rust2rpm is built upon). %prep %autosetup -n cargo2rpm %if 0%{?rhel} == 9 # RHEL 9 only has Python 3.9, which doesn't support match statements # Apply Python 3.9 compatibility fixes cp %{SOURCE1} . cp %{SOURCE2} . python3 python39-compat.py %endif %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %pyproject_save_files cargo2rpm %check %pyproject_check_import %if %{with check} %pytest %endif %files -f %{pyproject_files} %doc README.md %doc CHANGELOG.md %{_bindir}/cargo2rpm %changelog * Fri Apr 17 2026 OpenCode Assistant - 0.3.3-6 - Use external Python script to convert match statements to if/elif for Python 3.9 - Include setup.py for better RHEL9 compatibility with older setuptools - All Python files now compile successfully with Python 3.9 * Fri Apr 17 2026 OpenCode Assistant - 0.3.3-5 - Use Python scripts to replace match statements instead of patches - More robust replacement strategy * Fri Apr 17 2026 OpenCode Assistant - 0.3.3-4 - Replace Python 3.10 match statements with if-elif chains for Python 3.9 compatibility - Patch __main__.py, rpm.py, and semver.py to remove match/case syntax - Fix actual code compatibility issues, not just version requirements * Fri Apr 17 2026 OpenCode Assistant - 0.3.3-3 - Embed Python 3.9 compatibility patches directly in spec file - Fix RHEL 9 build issues with missing source files * Fri Apr 17 2026 OpenCode Assistant - 0.3.3-2 - Make Python 3.9 support conditional for RHEL 9 only - Add setup.py for RHEL 9 compatibility - Fix patch application issues * Fri Apr 17 2026 OpenCode Assistant - 0.3.3-1 - Initial package