%global debug_package %{nil} %global bin_name netrouse Name: netroused Version: v0.9.4 Release: 1.20261112230824024690.pr209.13.g5923a5e%{?dist} Summary: Wake on Lan Utility %global package_id io.github.heathcliff26.%{name} License: Apache-2.0 URL: https://github.com/heathcliff26/netrouse Source: netroused-v0.9.4.tar.gz BuildRequires: golang >= 1.27.0 %global _description %{expand: This is a simple utility for sending Wake-On-Lan magic packet to clients in the local network. It can be used directly via the cli, or remotely via a web interface.} %description %{_description} %prep %autosetup -n netroused-v0.9.4 -p1 %build export RELEASE_VERSION="%{version}-%{release}" hack/build.sh %install install -D -m 0755 bin/%{bin_name} %{buildroot}%{_bindir}/%{bin_name} install -D -m 0644 tools/%{name}.service %{buildroot}%{_prefix}/lib/systemd/system/%{name}.service install -D -m 0644 examples/config.yaml %{buildroot}%{_sysconfdir}/netrouse/config.yaml install -D -m 0644 %{package_id}.metainfo.xml %{buildroot}/%{_datadir}/metainfo/%{package_id}.metainfo.xml %post #!/bin/sh if ! command -V systemctl >/dev/null 2>&1; then exit 0 fi name=netroused systemctl daemon-reload || true systemctl enable "${name}.service" || true systemctl restart "${name}.service" || true %preun #!/bin/sh if [ "$1" != "0" ] && [ "$1" != "remove" ] && [ "$1" != "purge" ]; then exit 0 fi if ! command -V systemctl >/dev/null 2>&1; then exit 0 fi name=netroused echo "Clean up ${name} service" systemctl unmask "${name}.service" || true systemctl disable --now "${name}.service" %postun #!/bin/sh if [ "$1" != "0" ] && [ "$1" != "remove" ] && [ "$1" != "purge" ]; then exit 0 fi if ! command -V systemctl >/dev/null 2>&1; then exit 0 fi systemctl daemon-reload %files %license LICENSE %doc README.md %{_bindir}/%{bin_name} %{_prefix}/lib/systemd/system/%{name}.service %dir %{_sysconfdir}/netrouse %{_sysconfdir}/netrouse/config.yaml %{_datadir}/metainfo/%{package_id}.metainfo.xml %changelog %autochangelog