## 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 project_name clickgen %global pkgname python3-%{project_name} %global _version 2.2.5 Name: python-%{project_name} Version: %{_version}%{?bumpver:^%{bumpver}.git%{shortcommit0}} Release: %autorelease -b3 Summary: The hassle-free cursor building toolbox. License: MIT URL: https://github.com/ful1e5/clickgen Source0: %{url}/releases/download/v%{version}/%{project_name}-%{version}.tar.gz BuildArch: noarch BuildRequires: python-rpm-macros BuildRequires: fdupes BuildRequires: python3-devel BuildRequires: python3-build BuildRequires: python3dist(setuptools) >= 40.9.0 BuildRequires: python3-installer BuildRequires: python3dist(wheel) >= 0.37.1 %if 0%{?fedora} BuildRequires: python3dist(pip) %endif Requires: python3 %description %{summary} %package -n %{pkgname} Summary: %{summary} %description -n %{pkgname} Clickgen is cross-platform python library for building XCursor and Windows Cursors. %generate_buildrequires %pyproject_buildrequires %prep %autosetup -n %{project_name}-%{version} %build # 原命令 python -m build --wheel --no-isolation %pyproject_wheel %install # 原命令 python -m installer --destdir=%%{buildroot} dist/*.whl %pyproject_install %pyproject_save_files %{project_name} %fdupes %{buildroot}%{$python3_sitearch}/%{project_name}/ %check %py3_check_import %{project_name} %files -n %{pkgname} -f %{pyproject_files} %{_bindir}/clickgen %{_bindir}/ctgen %license LICENSE %doc README.md %changelog %autochangelog