Archived
Release 1.0.0: hf-cli rpm and systemd timer
Build and provide rpm of demus profiles / rpmbuild (release) Failing after 59s
Build and provide rpm of demus profiles / rpmbuild (release) Failing after 59s
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
name: Build and provide rpm of demus profiles
|
||||
run-name: Rpmbuild hf-cli by @${{ github.actor }}
|
||||
on: [ release ]
|
||||
jobs:
|
||||
rpmbuild:
|
||||
runs-on: f40-minimal-rpmbuild
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: https://git.demus.dk/actions/git-clone@main
|
||||
- name: Build the rpms
|
||||
uses: https://git.demus.dk/actions/rpmbuild@main
|
||||
- name: Deploy to packages
|
||||
uses: https://git.demus.dk/actions/rpm-deploy@main
|
||||
with:
|
||||
pat: ${{ secrets.RPM_REPO_WRITE }}
|
||||
@@ -0,0 +1,15 @@
|
||||
name: Build and provide rpm of demus profiles
|
||||
run-name: Rpmbuild hf-cli by @${{ github.actor }}
|
||||
on: [ release ]
|
||||
jobs:
|
||||
rpmbuild:
|
||||
runs-on: f41-minimal-rpmbuild
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: https://git.demus.dk/actions/git-clone@main
|
||||
- name: Build the rpms
|
||||
uses: https://git.demus.dk/actions/rpmbuild@main
|
||||
- name: Deploy to packages
|
||||
uses: https://git.demus.dk/actions/rpm-deploy@main
|
||||
with:
|
||||
pat: ${{ secrets.RPM_REPO_WRITE }}
|
||||
@@ -0,0 +1,15 @@
|
||||
name: Build and provide rpm of demus profiles
|
||||
run-name: Rpmbuild hf-cli by @${{ github.actor }}
|
||||
on: [ release ]
|
||||
jobs:
|
||||
rpmbuild:
|
||||
runs-on: rawhide-minimal-rpmbuild
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: https://git.demus.dk/actions/git-clone@main
|
||||
- name: Build the rpms
|
||||
uses: https://git.demus.dk/actions/rpmbuild@main
|
||||
- name: Deploy to packages
|
||||
uses: https://git.demus.dk/actions/rpm-deploy@main
|
||||
with:
|
||||
pat: ${{ secrets.RPM_REPO_WRITE }}
|
||||
@@ -0,0 +1,21 @@
|
||||
# Set up hf-cli for automatic daily downloads
|
||||
|
||||
To enable daily runs, you first need to generate a config.json file defining what
|
||||
to download and where to put it:
|
||||
|
||||
```bash
|
||||
hf-cli --setup
|
||||
```
|
||||
|
||||
then you need to enable the timer for the user and enable lingering, so the timer
|
||||
is executed even when the user is not logged in:
|
||||
|
||||
```bash
|
||||
systemctl --user enable hf-cli.timer hf-cli.service
|
||||
loginctl enable-linger
|
||||
```
|
||||
|
||||
You can test the service by running it manually:
|
||||
```bash
|
||||
systemctl --user start hf-cli.service
|
||||
```
|
||||
@@ -0,0 +1,7 @@
|
||||
[Unit]
|
||||
Description=Run hf-cli from saved config
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/bin/hf-cli -C
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
%{?!python3_pkgversion:%global python3_pkgversion 3}
|
||||
|
||||
%global srcname hf-cli
|
||||
%global subpackage user-systemd
|
||||
%global debug_package %{nil}
|
||||
|
||||
Name: hf-cli
|
||||
Version: 1.1.0
|
||||
Release: 1%{?dist}
|
||||
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}
|
||||
|
||||
%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
|
||||
|
||||
%build
|
||||
%pyproject_wheel
|
||||
|
||||
%check
|
||||
%pyproject_check_import
|
||||
%pytest
|
||||
|
||||
%install
|
||||
# rm -rf $RPM_BUILD_ROOT
|
||||
%pyproject_install
|
||||
%pyproject_save_files -L hf_cli +auto
|
||||
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
|
||||
|
||||
%files %subpackage
|
||||
%license LICENSE
|
||||
%dnl %doc README-%{subpackage}.md
|
||||
%{_userunitdir}/*
|
||||
|
||||
%changelog
|
||||
* Fri Nov 15 2024 Daniel Demus <dde@nine.dk>
|
||||
- Initial release
|
||||
@@ -0,0 +1,8 @@
|
||||
[Unit]
|
||||
Description=Download fresh gps roms for amazfit or huami gadgets
|
||||
|
||||
[Timer]
|
||||
OnCalendar=*-*-* 01:10:00
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
Reference in New Issue
Block a user