File mpv-mpris2.spec of Package mpv-mpris2

#
# spec file for package mpv-mpris2
#
# Copyright (c) 2024 SUSE LLC
#
# 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:           mpv-mpris2
Version:        0.0.3
Release:        0
Summary:        MPRIS DBus for mpv written in Rust
License:        MIT-0
URL:            https://github.com/eNV25/mpv-mpris2
Source0:        %{name}-%{version}.tar.zst
Source1:        vendor.tar.zst
BuildRequires:  cargo
# This contains rpm macros to assist with building
BuildRequires:  cargo-packaging
BuildRequires:  clang
BuildRequires:  pkgconfig(mpv)
# Disable this line if you wish to support all platforms.
# In most situations, you will likely only target tier1 arches for user facing components.
ExclusiveArch:  %{rust_tier1_arches}
Conflicts:      mpv-mpris

%description
Rust implementation of the MPRIS v2 DBus interface for the mpv media player.

%prep
%autosetup -p1 -a1

%build
#export RUST_BACKTRACE=full
export CARGO_PROFILE_RELEASE_BUILD_OVERRIDE_DEBUG=true
%{cargo_build}

%install
# manual process, this can place binaries in other directories like sbindin
install -D -d -m 0755 %{buildroot}%{_libdir}/mpv
install -m 0755 %{_builddir}/%{name}-%{version}/target/release/libmpv_mpris2.so \
 %{buildroot}%{_libdir}/mpv/mpris.so

%files
%license LICENSE
%doc README.md
# perhaps mpv-mpris as buildrequires instead?
%dir %{_libdir}/mpv
%{_libdir}/mpv/mpris.so

%changelog
openSUSE Build Service is sponsored by