This document describes the migration of the RPM spec file from legacy setup.py to modern pyproject.toml build system.
- Added:
python3dist(build)- Modern Python build tool - Added:
python3dist(setuptools) >= 61.0- Modern setuptools version - Added:
python3-pip python3-wheel- Required for wheel installation
- Old:
%py3_build(legacy setuptools) - New:
%{python3} -m build --wheel --no-isolation(PEP 517 build)
- Old:
%py3_install(legacy setuptools) - New:
%{python3} -m pip install --no-deps --no-index --find-links dist/(wheel-based)
- Old:
recodex_cleaner-%{version}-py?.?.egg-info/(egg format) - New:
recodex_cleaner-%{version}.dist-info/(wheel format)
- Old: Handled automatically by
setup.pydata_files - New: Manual installation using
installcommands in%installsection
# Install build dependencies
dnf install rpm-build python3-build python3-pip python3-wheel
# For RHEL/CentOS
yum install rpm-build python3-build python3-pip python3-wheel# Create build directories
mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
# Copy spec file
cp recodex-cleaner.spec ~/rpmbuild/SPECS/
# Download/prepare source
# (adjust URL and version as needed)
cd ~/rpmbuild/SOURCES
wget https://github.com/ReCodEx/cleaner/archive/SOURCE_COMMIT.tar.gz
# Build RPM
rpmbuild -ba ~/rpmbuild/SPECS/recodex-cleaner.specAfter building, verify the RPM contains:
- Modern wheel-based Python package installation
- Correct
.dist-infometadata directory - System service files in
/lib/systemd/system/ - Configuration file in
/etc/recodex/cleaner/ - Executable script in
/usr/bin/recodex-cleaner
- Standards Compliance: Uses modern Python packaging standards
- Better Isolation: Build process is more isolated and reproducible
- Wheel Format: More efficient installation and better metadata
- Future-Proof: Compatible with modern Python tooling
- Consistent: Same build system used for pip and RPM packages
- The RPM package behavior remains the same for end users
- systemd service installation and configuration unchanged
- All file locations and permissions preserved
- No changes required for existing deployments