%global pkgname huami-token %global modname huami_token %global systemd_helper_name huami-token-user-systemd %global huami_token_version 0.8.0 %global systemd_helper_version 0.2.1 Name: %{pkgname} Version: %{huami_token_version}+%{systemd_helper_version} Release: %autorelease Summary: This script retrieves the Bluetooth access token for the watch or band from Huami servers. Additionally, it downloads the AGPS data packs, cep_alm_pak.zip and cep_7days.zip. License: MIT URL: https://codeberg.org/argrento/huami-token Source0: https://git.demus.dk/api/v1/repos/demus/%{systemd_helper_name}/archive/%{systemd_helper_version}.tar.gz Source1: %{pypi_source %{modname} %{huami_token_version}} Patch0: 01-switch-to-pycrytodomex.patch Patch1: 02-disable-tests-only-failing-on-COPR.patch BuildSystem: pyproject BuildOption(install): -l %{modname} BuildOption(generate_buildrequires): -x dev BuildArch: noarch BuildRequires: python3-devel pyproject-srpm-macros systemd-rpm-macros bats-assert bats-mock bats-file Requires: dialog coreutils Obsoletes: hf-cli < 999.999.999 hf-cli-user-systemd < 999.999.999 %global _description %{expand: This script retrieves the Bluetooth access token for a watch or band from Huami servers. Additionally, it downloads the AGPS data packs, cep_alm_pak.zip and cep_7days.zip.} %description %_description %pyproject_extras_subpkg -n %{pkgname} dev %prep %setup -T -D -b0 -n %{systemd_helper_name} %patch -p1 1 %setup -T -D -b1 -n %{modname}-%{huami_token_version} %patch -p1 0 %check %{pytest} cd %{_builddir}/%{systemd_helper_name} bats test %install %pyproject_install %{__install} -D -m 0644 -t %{buildroot}%{_userunitdir} %{_builddir}/%{systemd_helper_name}/systemd-units/* %{__install} -D -m 0755 -t %{buildroot}%{_systemdusergeneratordir} %{_builddir}/%{systemd_helper_name}/systemd-generator/* %{__install} -D -m 0755 -t %{buildroot}%{_bindir} %{_builddir}/%{systemd_helper_name}/configurators/* %pyproject_save_files -L %{modname} %files -n %{pkgname} -f %{pyproject_files} %doc README.md %doc ../%{systemd_helper_name}/README-user-systemd.md %{_bindir}/* %{_userunitdir}/* %{_systemdusergeneratordir}/* %changelog %autochangelog