%bcond_with check %global srcname tulir-telethon %global pypi_name tulir-telethon %global module_name telethon %global commit_hash 2d470879b653576aa2e0faea97d3b7c9a3f419f1 %global othername Telethon-%{commit_hash} # pypi_name-version? Name: python-%{srcname} Version: 1.30.0~a2 Release: %autorelease Summary: Interact with Telegram’s API License: MIT URL: https://github.com/tulir/Telethon Source0: %{url}/archive/%{commit_hash}/%{srcname}-%{version}.tar.gz BuildArch: noarch BuildRequires: python3-devel %global _description %{expand: Asyncio Python 3 MTProto library to interact with Telegram’s API as a user or through a bot account.} %description %_description %package -n python3-%{srcname} Summary: %{summary} %description -n python3-%{srcname} %_description %prep %autosetup -p1 -n %{othername} # Remove unused optional dependencies sed -i '/cryptg/d' optional-requirements.txt sed -i '/hachoir/d' optional-requirements.txt %generate_buildrequires %pyproject_buildrequires -t %build %pyproject_wheel %install %pyproject_install %pyproject_save_files %{module_name} %if %{with check} %check %tox %endif %files -n python3-%{srcname} -f %{pyproject_files} %doc README.rst %license LICENSE %changelog %autochangelog