%global debug_package %{nil} Name: fleetlock Version: v1.12.1 Release: 1.20261114032304290015.pr314.1.g899ee67a%{?dist} Summary: Zincati FleetLock protocol server %global package_id io.github.heathcliff26.%{name} License: Apache-2.0 URL: https://github.com/heathcliff26/%{name} Source: fleetlock-v1.12.1.tar.gz BuildRequires: golang >= 1.27.0 %global _description %{expand: Server implementing the Zincati FleetLock protocol.} %description %{_description} %prep %autosetup -n fleetlock-v1.12.1 -p1 %build export RELEASE_VERSION="%{version}-%{release}" make build-%{name} %install install -D -m 0755 bin/%{name} %{buildroot}%{_bindir}/%{name} install -D -m 0644 tools/%{name}.service %{buildroot}%{_prefix}/lib/systemd/system/%{name}.service install -D -m 0644 examples/config.yaml %{buildroot}%{_sysconfdir}/%{name}/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=fleetlock 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=fleetlock 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}/%{name} %{_prefix}/lib/systemd/system/%{name}.service %dir %{_sysconfdir}/%{name} %{_sysconfdir}/%{name}/config.yaml %{_datadir}/metainfo/%{package_id}.metainfo.xml %changelog %autochangelog