This repository has been archived on 2026-04-25. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
demus e41b76f198
Build and provide rpm of demus profiles / rpmbuild (release) Has been cancelled
Follow Fedora packaging guidelines
2025-03-30 23:59:55 +02:00

83 lines
2.1 KiB
RPMSpec

%{?!python3_pkgversion:%global python3_pkgversion 3}
%global srcname hf-cli
%global subpackage user-systemd
%global debug_package %{nil}
Name: hf-cli
Version: 1.2.2
Release: %autorelease
Summary: Huafetcher CLI
License: GPL-3.0-or-later
URL: https://git.demus.dk/demus/hf-cli
Source0: https://git.demus.dk/demus/%{name}/archive/%{version}.tar.gz
Source1: hf-cli.service
Source2: hf-cli.timer
Source3: README-%{subpackage}.md
BuildRequires: python3-devel
BuildRequires: pyproject-srpm-macros
%description
If you use GadgetBridge with an AmazFit gadget, you have probably used
Huafetcher to get keys and update aGPS.
This project extracts the non-Kivy parts of Huafetcher into a cli app,
that can be used to get keys or various forms of aGPS files from the
command-line or for example on a daily schedule.
%package %subpackage
Summary: Huafetcher CLI systemd user unit
BuildRequires: systemd-rpm-macros
%{?%systemd_requires}
Requires: %{name} = %{version}
%description user-systemd
Contains a systemd user unit and timer to automate downloading of fresh
agps files to a selected location ready to be flashed onto your gagdet.
%post %subpackage
%systemd_user_post %{name}.service %{name}.timer
%preun %subpackage
%systemd_user_preun %{name}.service %{name}.timer
%postun %subpackage
%systemd_user_postun %{name}.service %{name}.timer
%prep
%autosetup -p1 -n %{srcname}
%{__cp} %{SOURCE3} .
%generate_buildrequires
%pyproject_buildrequires -p -g test
%build
%pyproject_wheel
%check
%pyproject_check_import
%pytest
%install
# rm -rf $RPM_BUILD_ROOT
%pyproject_install
%pyproject_save_files -L hf_cli
install -m 0755 -vd %{buildroot}%{_userunitdir}
install -D -m 0644 -vp %{SOURCE1} %{buildroot}%{_userunitdir}/%{name}.service
install -D -m 0644 -vp %{SOURCE2} %{buildroot}%{_userunitdir}/%{name}.timer
%files -f %{pyproject_files}
%license LICENSE
%doc README.md
%{_bindir}/hf-cli
%files %subpackage
%license LICENSE
%dnl %doc README-%{subpackage}.md
%{_userunitdir}/*
%changelog
%autochangelog