File sonusmix.spec of Package sonusmix

#
# spec file for package sonusmix
#
# Copyright (c) 2025 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:           sonusmix
Version:        0.1.1+git.8.f463cb0
Release:        0
Summary:        Next-gen Pipewire audio routing tool
License:        MPL-2.0
URL:            https://codeberg.org/sonusmix/sonusmix
Source0:        sonusmix-0.1.1+git.8.f463cb0.tar.gz
Source1:        vendor.tar.zst
BuildRequires:  rust
BuildRequires:  rsvg-convert
BuildRequires:  cargo-packaging
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(gtk4)
BuildRequires:  pkgconfig(dbus-1)
BuildRequires:  cmake(Clang)
BuildRequires:  pkgconfig(libpipewire-0.3)
ExclusiveArch:  %{rust_arches}

%description
A tool to easily route and manage audio devices in Pipewire.

%prep
%autosetup -p1 -a1 -n %{name}-%{version}

%build
%cargo_build

# Generate icons
mkdir -p ./assets/icons/hicolor/scalable/apps
cp assets/sonusmix.svg assets/icons/hicolor/scalable/apps/org.sonusmix.Sonusmix.svg
for size in 512 256 128 64 48 32 24 16; do
  dir="assets/icons/hicolor/${size}x${size}/apps"
  mkdir -p "${dir}"
  rsvg-convert assets/sonusmix.svg -w ${size} -o "${dir}/org.sonusmix.Sonusmix.png"
done

%install
install -D -m 0755 target/release/%{name} %{buildroot}%{_bindir}/%{name}
install -D -m 0644 assets/org.sonusmix.Sonusmix.desktop %{buildroot}%{_datadir}/applications/org.sonusmix.Sonusmix.desktop
install -D -m 0755 -d %{buildroot}%{_datadir}/icons/hicolor/
(
  cd assets/icons/hicolor/
  find -type f -exec install -D -m 0644 "{}" "%{buildroot}%{_datadir}/icons/hicolor/{}" \;
)

%files
%license LICENSE
%doc README.md
%{_bindir}/%{name}
%{_datadir}/applications/org.sonusmix.Sonusmix.desktop
%{_datadir}/icons/hicolor/*/apps/org.sonusmix.Sonusmix.*

%changelog

openSUSE Build Service is sponsored by