%global srcname mautrix-telegram %global pymodulename mautrix_telegram %global releasename telegram Name: python-%{srcname} Version: 0.14.2 Release: %autorelease Summary: A Matrix-Telegram hybrid puppeting/relaybot bridge License: AGPL-3.0-or-later URL: https://github.com/mautrix/telegram Source0: %{url}/archive/v%{version}/%{srcname}-%{version}.tar.gz Source1: mautrix-telegram.service Patch0: remove-data-files.patch BuildArch: noarch BuildRequires: python3dist(setuptools) BuildRequires: systemd-rpm-macros %global _description %{expand: A Matrix-Telegram hybrid puppeting/relaybot bridge.} %description %_description %package -n python3-%{srcname} Summary: %{summary} BuildRequires: python3-devel # Test dependencies #BuildRequires: python3dist(coverage) #BuildRequires: python3dist(mock) BuildRequires: python3dist(pytest) BuildRequires: python3dist(pytest-mock) BuildRequires: python3dist(pytest-runner) #BuildRequires: python3dist(flask) #BuildRequires: python3dist(flask-sqlalchemy) # Runtime dependencies #BuildRequires: python3dist(cryptography) #BuildRequires: python3dist(requests) #SQLAlchemy>=1.2,<2 #alembic>=1,<2 #ruamel.yaml>=0.15.35,<0.17 #python-magic>=0.4,<0.5 #commonmark>=0.8,<0.10 #aiohttp>=3,<4 #mautrix>=0.7.13,<0.8 #telethon>=1.16,<1.17 #telethon-session-sqlalchemy>=0.2.14,<0.3 %description -n python3-%{srcname} %_description %prep %autosetup -n %{releasename}-%{version} # Fix version information sed -i 's/version=version,/version="%{version}",/' setup.py # Don’t install tests sed -i 's/packages=setuptools.find_packages(),/packages=setuptools.find_packages(exclude=["tests", "tests.*"]),/' setup.py %build %py3_build %install %py3_install install -p -D -T -m 0644 mautrix_telegram/example-config.yaml %{buildroot}%{_sysconfdir}/%{srcname}/config.yaml install -p -D -T -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/mautrix-telegram.service %check #% pytest %files -n python3-%{srcname} %license LICENSE %doc README.md %config(noreplace) %{_sysconfdir}/%{srcname}/config.yaml %{_unitdir}/mautrix-telegram.service %{python3_sitelib}/%{pymodulename} %{python3_sitelib}/%{pymodulename}-%{version}-py%{python3_version}.egg-info %changelog %autochangelog