%global project beetbrainz %global goipath codeberg.org/gbcox/%{project} %global forgeurl https://codeberg.org/gbcox/%{project}/ %global commit 9bf7c065a2f3694b4e4e61c2cfa6e8dfb048fc2c %define debug_package %{nil} %global golicenses LICENSE.md %global godocs README.md %global common_description %{expand: %{project} is a lightweight Go-based webhook listener designed to bridge the gap between your media server playback and your MusicBrainz scrobbling via ListenBrainz.} %gometa Name: %{goname} Version: 1.0.9 Release: %autorelease Summary: %{project} - Webhook integration for Listenbrainz scrobbling License: GPL-3.0-or-later URL: %{gourl} Source0: %{gosource} Source1: %{project}.service Source2: %{project} BuildRequires: golang > 1.24 BuildRequires: systemd Requires: beets %description %common_description %prep %goprep %build export GOFLAGS="-mod=readonly" export LDFLAGS="-s -w \ -X main.appVersion=%{version} \ -X main.commit=%{commit} \ -X main.shortCommit=%{shortcommit} \ -linkmode external -extldflags \"-pie -fPIE -Wl,-z,relro -Wl,--as-needed \ -Wl,-z,pack-relative-relocs -Wl,-z,now \ -specs=/usr/lib/rpm/redhat/redhat-hardened-ld \ -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 \ -Wl,--build-id=sha1 \ -specs=/usr/lib/rpm/redhat/redhat-package-notes\"" %gobuild -o %{project} . %install install -Dm755 %{project} %{buildroot}%{_bindir}/%{project} install -Dm644 %{SOURCE1} %{buildroot}%{_unitdir}/%{project}.service install -Dm644 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/%{project} %post %systemd_post %{project}.service %preun %systemd_preun %{project}.service %postun %systemd_postun_with_restart beetbrainz.service %files %license %{golicenses} %doc %{godocs} %config(noreplace) %{_sysconfdir}/sysconfig/%{project} %{_bindir}/%{project} %{_unitdir}/%{project}.service %changelog %autochangelog