%global date 20221030 %global commit 7e6d74f1f6961668f0c2ece4fe500ae493dc5fdf %global shortcommit %(c=%{commit}; echo ${c:0:7}) Name: cloudflare-ddns Version: 1.0.2~%{date}git%{shortcommit} Release: %autorelease Summary: Dynamic DNS (DDNS) service based on Cloudflare License: GPL-3.0-only URL: https://github.com/timothymiller/cloudflare-ddns Source: %{url}/archive/%{commit}/%{name}-%{commit}.tar.gz # Update interpreter of shebang to python3 Patch0: %{url}/pull/114.patch # Add systemd service and timer Patch1: %{url}/pull/121.patch BuildRequires: systemd-rpm-macros Requires: python3-requests BuildArch: noarch %description Dynamic DNS (DDNS) service based on Cloudflare. %prep %autosetup -n %{name}-%{commit} -p1 # Fix permissions chmod -x README.md config-example.json %build %install install -Dpm0755 %{name}.py %{buildroot}%{_bindir}/%{name} install -Dpm0644 -t %{buildroot}%{_unitdir} systemd/%{name}.{service,timer} install -Ddpm0755 %{buildroot}%{_sysconfdir}/%{name} %post %systemd_post %{name}.service %preun %systemd_preun %{name}.service %postun %systemd_postun_with_restart %{name}.service %files %license LICENSE %doc README.md feature-graphic.jpg config-example.json %{_bindir}/%{name} %dir %{_sysconfdir}/%{name} %ghost %{_sysconfdir}/%{name}/config.json %{_unitdir}/%{name}.service %{_unitdir}/%{name}.timer %changelog %autochangelog