Name: python3-puremagic Version: 2.0.0 Release: 1%{?dist} Summary: Pure python implementation of identifying files based off their magic numbers License: MIT URL: https://github.com/cdgriffith/puremagic BuildArch: noarch Source0: https://github.com/cdgriffith/puremagic/archive/refs/tags/%{version}.tar.gz BuildRequires: python3-devel %description %{summary}. %prep %autosetup -n puremagic-%{version} # setuptools-scm is listed as a build requirement but unused; version is a # static string in puremagic/main.py. Remove it to avoid an unpackaged dep. sed -i 's/requires = \[ "setuptools", "setuptools-scm\[toml\]>=6.2"\]/requires = [ "setuptools"]/' pyproject.toml # Older setuptools (< 77) doesn't support PEP 639 short-form license strings if [ "$(python3 -c 'import sys; print(1 if sys.version_info < (3,14) else 0)')" = "1" ]; then sed -i 's/^license = "MIT"/license = {text = "MIT"}/' pyproject.toml fi %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %pyproject_save_files -l puremagic %files -f %{pyproject_files} %doc CHANGELOG.md README.rst %{_bindir}/puremagic %changelog %autochangelog