%global debug_package %{nil} %global bin_name netrouse Name: netroused Version: v0.9.3.alpha.2 Release: %autorelease Summary: Wake on Lan Utility %global package_id io.github.heathcliff26.%{name} License: Apache-2.0 URL: https://github.com/heathcliff26/%{name} Source: netroused-v0.9.3.alpha.2.tar.gz BuildRequires: golang >= 1.27.0 BuildRequires: appstream %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.3.alpha.2 -p1 %build export RELEASE_VERSION="%{version}-%{release}" hack/build.sh appstreamcli news-to-metainfo CHANGELOG.md %{package_id}.metainfo.xml %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 systemctl daemon-reload systemctl enable --now %{name}.service %preun if [ $1 == 0 ]; then #uninstall systemctl unmask %{name}.service systemctl stop %{name}.service systemctl disable %{name}.service echo "Clean up %{name} service" fi %postun if [ $1 == 0 ]; then #uninstall systemctl daemon-reload systemctl reset-failed fi %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