## START: Set by rpmautospec ## (rpmautospec version 0.7.2) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 1; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec %global pypi_name puremagic Name: python-%{pypi_name} Version: 1.28 Release: %{autorelease} Summary: Pure python implementation of magic file detection %global forgeurl https://github.com/cdgriffith/puremagic %global tag %{version} %forgemeta License: MIT URL: %forgeurl Source: %forgesource BuildArch: noarch BuildRequires: python3-devel BuildRequires: python3dist(pytest) %global _description %{expand: puremagic is a pure python module that will identify a file based off it’s magic numbers. It is designed to be minimalistic and inherently cross platform compatible. It is also designed to be a stand in for python-magic, it incorporates the functions from_file(filename[, mime]) and from_string(string[, mime]) however the magic_file() and magic_string() are more powerful and will also display confidence and duplicate matches. It does NOT try to match files off non-magic string. In other words it will not search for a string within a certain window of bytes like others might. Advantages over using a wrapper for ‘file’ or ‘libmagic’: - Faster - Lightweight - Cross platform compatible - No dependencies Disadvantages: - Does not have as many file types - No multilingual comments - Duplications due to small or reused magic numbers (Help fix the first two disadvantages by contributing!)} %description %_description %package -n python3-%{pypi_name} Summary: %{summary} %description -n python3-%{pypi_name} %_description %prep %forgeautosetup -p1 # Remove unnecessary shebangs sed -r \ -e '/^#!/d' \ -i puremagic/__init__.py puremagic/__main__.py puremagic/main.py %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %pyproject_save_files -l %{pypi_name} %check %pytest -v %pyproject_check_import %files -n python3-%{pypi_name} -f %{pyproject_files} %doc AUTHORS.rst CHANGELOG.md README.rst %changelog ## START: Generated by rpmautospec * Thu Oct 31 2024 Sandro - 1.28-1 - Update to 1.28 * Tue Jul 23 2024 Sandro - 1.26-1 - Initial package ## END: Generated by rpmautospec