File JDSP4Linux.spec of Package JDSP4Linux

#
# spec file for package JDSP4Linux
#
# Copyright (c) 2022-2024 Malcolm J Lewis <malcolmlewis@opensuse.org>
#
# 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 http://bugs.opensuse.org/
#

%define         with_pw 1

Name:           JDSP4Linux
Version:        2.7.0+git.55.12d3128
Release:        0
License:        GPL-3.0
Summary:        Audio effect processor
Group:          Productivity/Multimedia/Sound/Utilities
Url:            https://github.com/Audio4Linux/JDSP4Linux
Source0:        %{name}-%{version}.tar.xz
Source1:        jamesdsp-pa.desktop
Source2:        jamesdsp-pw.desktop
BuildRequires:  hicolor-icon-theme
BuildRequires:  update-desktop-files
BuildRequires:  qt6-base-devel
BuildRequires:  qt6-base-private-devel
BuildRequires:  pkgconfig(Qt6Svg)
BuildRequires:  pkgconfig(glibmm-2.4)
BuildRequires:  pkgconfig(glib-2.0)
BuildRequires:  pkgconfig(libarchive)
%if %{with_pw}
BuildRequires:  pkgconfig(libpipewire-0.3)
%endif
BuildRequires:  pkgconfig(gstreamer-1.0)
BuildRequires:  pkgconfig(gstreamer-plugins-base-1.0)
BuildRequires:  pkgconfig(libpulse)

%description
Open-source sound effects designed for PipeWire. PulseAudio is only supported
for backward compatibility.

%package common
Summary:        Audio effect processor - Common files
Group:          Productivity/Multimedia/Sound/Utilities
BuildArch:      noarch

%description common
Open-source sound effects designed for PipeWire. PulseAudio is only supported
for backward compatibility.

Contains desktop files need by %{name}

%package pipewire
Summary:        Audio effect processor - Pipewire version
Group:          Productivity/Multimedia/Sound/Utilities
Requires:       %{name}-common
Conflicts:      %{name}-pulseaudio

%description pipewire
Open-source sound effects designed for PipeWire.

%package pulseaudio
Summary:        Audio effect processor - Pulseaudio version
Group:          Productivity/Multimedia/Sound/Utilities
Requires:       %{name}-common
Conflicts:      %{name}-pipewire

%description pulseaudio
Open-source sound effects designed for PipeWire. PulseAudio is only supported
for backward compatibility.

%prep
%autosetup
cp %{S:1} %{S:2} .

%build
%if %{with_pw}
mkdir -p build
cd build
qmake6 ../JDSP4Linux.pro
make %{?_smp_mflags}
cp src/jamesdsp ../jamesdsp-pw
cd ..
rm -rf build
%endif
## Skip pulseaudio support for Tumbleweed
%if 0%{?suse_version} < 1600
mkdir -p build
cd build
qmake6 ../JDSP4Linux.pro "CONFIG += USE_PULSEAUDIO"
make %{?_smp_mflags}
cp src/jamesdsp ../jamesdsp-pa
%endif

%install
install -d -m 0755 %{buildroot}%{_bindir} \
                   %{buildroot}%{_datadir}/applications \
                   %{buildroot}%{_datadir}/icons/hicolor/scalable/apps
install -m 0644 resources/icons/icon.svg %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/jamesdsp.svg
%if %{with_pw}
install -m 0755 jamesdsp-pw %{buildroot}%{_bindir}/jamesdsp-pw
%suse_update_desktop_file -i jamesdsp-pw
%endif
%if 0%{?suse_version} < 1600
install -m 0755 jamesdsp-pa %{buildroot}%{_bindir}/jamesdsp-pa
%suse_update_desktop_file -i jamesdsp-pa
%endif

%if %{with_pw}
%files pipewire
%{_bindir}/jamesdsp-pw
%{_datadir}/applications/jamesdsp-pw.desktop
%endif

%if 0%{?suse_version} < 1600
%files pulseaudio
%{_bindir}/jamesdsp-pa
%{_datadir}/applications/jamesdsp-pa.desktop
%endif

%files common
%license LICENSE
%{_datadir}/icons/hicolor/scalable/apps/jamesdsp.svg

%changelog

openSUSE Build Service is sponsored by