File mpd-mpris.spec of Package mpd-mpris

#
# spec file for package mpd-mpris
#
# Copyright (c) 2025 mantarimay
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


Name:           mpd-mpris
Version:        0.4.2
Release:        0
Summary:        An implementation of the MPRIS protocol for MPD
License:        MIT
URL:            https://github.com/natsukagami/mpd-mpris
Source0:        %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
Source1:        vendor.tar.zst
Source2:        mpd-mpris.service
BuildRequires:  golang-packaging
BuildRequires:  zstd

%description
An implementation of the MPRIS protocol for MPD based golang.

%prep
%autosetup -p1 -a1

%build
cd cmd/mpd-mpris
go build \
   -mod=vendor \
   -buildmode=pie

%install
install -Dm0755 cmd/mpd-mpris/%{name} -t %{buildroot}%{_bindir}
install -Dm0644 %{SOURCE2} -t %{buildroot}%{_userunitdir}

%files
%license LICENSE
%doc README.md
%{_bindir}/%{name}
%{_userunitdir}/%{name}.service

%changelog
openSUSE Build Service is sponsored by