File wireplumber.spec of Package wireplumber

#
# spec file for package wireplumber
#
# Copyright (c) 2020 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/
#


%define apiver 0.5
%define apiver_str 0_5
%define sover 0
%define libwireplumber libwireplumber-%{apiver_str}-%{sover}
#{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name:           wireplumber
Version:        0.5.5~git20240628.43e939c0
Release:        0
Summary:        Session / policy manager implementation for PipeWire
License:        MIT
Group:          Development/Libraries/C and C++
URL:            https://gitlab.freedesktop.org/pipewire/wireplumber
Source0:        %{name}-%{version}.tar.xz
Source100:      wireplumber.service.d-user-limits.conf
BuildRequires:  cmake
BuildRequires:  cpptoml-devel
BuildRequires:  doxygen
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  git
BuildRequires:  graphviz
BuildRequires:  meson >= 0.54.0
BuildRequires:  pipewire >= 0.3.20
BuildRequires:  pipewire-devel >= 0.3.20
BuildRequires:  pipewire-spa-plugins-0_2
BuildRequires:  pkgconfig
BuildRequires:  xmltoman
BuildRequires:  pkgconfig(lua5.3)
BuildRequires:  pkgconfig(alsa)
BuildRequires:  pkgconfig(bluez)
BuildRequires:  pkgconfig(dbus-1)
BuildRequires:  pkgconfig(gio-2.0)
BuildRequires:  pkgconfig(gio-unix-2.0)
BuildRequires:  pkgconfig(glib-2.0) >= 2.32.0
BuildRequires:  pkgconfig(gmodule-2.0)
BuildRequires:  pkgconfig(gobject-2.0) >= 2.58
BuildRequires:  pkgconfig(gobject-introspection-1.0)
BuildRequires:  pkgconfig(gstreamer-1.0)
BuildRequires:  pkgconfig(gstreamer-allocators-1.0)
BuildRequires:  pkgconfig(gstreamer-audio-1.0)
BuildRequires:  pkgconfig(gstreamer-plugins-base-1.0)
BuildRequires:  pkgconfig(gstreamer-video-1.0)
BuildRequires:  pkgconfig(jack) >= 1.9.10
BuildRequires:  pkgconfig(libavcodec)
BuildRequires:  pkgconfig(libavfilter)
BuildRequires:  pkgconfig(libavformat)
BuildRequires:  pkgconfig(libpipewire-0.3)
BuildRequires:  pkgconfig(libpulse)
BuildRequires:  pkgconfig(libsystemd)
BuildRequires:  pkgconfig(libudev)
BuildRequires:  pkgconfig(libva)
BuildRequires:  pkgconfig(lua5.3)
BuildRequires:  pkgconfig(sbc)
BuildRequires:  pkgconfig(sdl2)
BuildRequires:  pkgconfig(sndfile)
BuildRequires:  pkgconfig(systemd)
BuildRequires:  pkgconfig(vulkan)
BuildRequires:  pkgconfig(x11)
#BuildRequires:  %{python_module lxml}
#BuildRequires:  %{python_module breathe}
#BuildRequires:  %{python_module graphviz}
#BuildRequires:  %{python_module Sphinx}
#BuildRequires:  %{python_module sphinx_rtd_theme}
BuildRequires:  python3-lxml
BuildRequires:  python3-breathe
BuildRequires:  python3-graphviz
BuildRequires:  python3-Sphinx
BuildRequires:  python3-sphinx_rtd_theme
BuildRequires:  python-rpm-macros
#BuildRequires:  pkgconfig(libelogind)
Provides:       pipewire-session-manager
Obsoletes:      pipewire-media-session
Requires:       pipewire

%description
WirePlumber is a modular session / policy manager for PipeWire and
a GObject-based high-level library that wraps PipeWire's API,
providing convenience for writing the daemon's modules as well as
external tools for managing PipeWire.

%package devel
Summary:        Session / policy manager implementation for PipeWire
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}

%description devel
WirePlumber is a modular session / policy manager for PipeWire and
a GObject-based high-level library that wraps PipeWire's API,
providing convenience for writing the daemon's modules as well as
external tools for managing PipeWire.

This package provides all the necessary files for development with WirePlumber

%package -n %{libwireplumber}
Summary:        Session / policy manager implementation for PipeWire
Group:          System/Libraries

%description -n %{libwireplumber}
WirePlumber is a modular session / policy manager for PipeWire and
a GObject-based high-level library that wraps PipeWire's API,
providing convenience for writing the daemon's modules as well as
external tools for managing PipeWire.

This package provides the wireplumber shared library.

%package -n typelib-1_0-Wp-%{apiver_str}
Summary:        Introspection bindings for libwireplumber
Group:          System/Libraries

%description -n typelib-1_0-Wp-%{apiver_str}
WirePlumber is a modular session / policy manager for PipeWire and
a GObject-based high-level library that wraps PipeWire's API,
providing convenience for writing the daemon's modules as well as
external tools for managing PipeWire.

This package provides the GObject Introspection bindings for
the wireplumber shared library.

%package doc
Summary:        WirePlumber PipeWire session manager documentation
Group:          Development/Libraries/C and C++

%description doc
This package contains documentation for the WirePlumber PipeWire session manager.

%package zsh-completion
Summary:        WirePlumber zsh completion
Group:          System/Shells
Requires:       %{name} = %{version}
Requires:       zsh
Supplements:    (wireplumber and zsh)

%description zsh-completion
ZSH command line completion support for WirePlumber.

%lang_package

%prep
%autosetup -p1

%build
%meson \
	-Ddoc=enabled \
	-Delogind=disabled \
	-Dsystem-lua=true \
	-Dsystemd=enabled \
	-Dsystemd-system-service=true \
	-Dsystemd-user-service=true \
	-Ddbus-tests=false \
	-Dtests=false \
	%{nil} || cat */meson-logs/meson-log.txt
%meson_build

%install
%meson_install
# expand default process capabilities for realtime
install -vD -m 0644 %{SOURCE100} %{buildroot}%{_userunitdir}/wireplumber.service.d/99-limits.conf
%fdupes -s %{buildroot}/%{_datadir}/doc
%find_lang %{name} %{name}.lang

%ifnarch %ix86
%check
export XDG_RUNTIME_DIR=/tmp
#meson_test
%endif

%pre
%systemd_user_pre wireplumber.service

%post
%systemd_user_post wireplumber.service

%preun
%systemd_user_preun wireplumber.service

%postun
%systemd_user_postun wireplumber.service

%post   -n %{libwireplumber} -p /sbin/ldconfig
%postun -n %{libwireplumber} -p /sbin/ldconfig

%files
%caps(cap_sys_nice=eip) %{_bindir}/wireplumber
%{_bindir}/wp*
%ghost %dir %{_sysconfdir}/wireplumber
%{_libdir}/wireplumber-*
%{_unitdir}/wireplumber*.service
%{_userunitdir}/wireplumber*.service
%dir %{_userunitdir}/wireplumber.service.d
%config %{_userunitdir}/wireplumber.service.d/99-limits.conf
%{_datadir}/wireplumber
# actual configs are there
%{_datadir}/doc/*

%files devel
%{_includedir}/wireplumber-*
%{_libdir}/libwireplumber-*.so
%{_libdir}/pkgconfig/wireplumber-*.pc
%{_datadir}/gir-1.0/Wp-*.gir

%files -n typelib-1_0-Wp-%{apiver_str}
%{_libdir}/girepository-1.0/Wp-*.typelib

%files -n %{libwireplumber}
%{_libdir}/libwireplumber-*.so.*

%files doc
#{_datadir}/doc/*

%files zsh-completion
%{_datadir}/zsh

%files lang -f %{name}.lang

%changelog
openSUSE Build Service is sponsored by