File qpwgraph.spec of Package qpwgraph

#
# spec file for package qpwgraph
#
# Copyright (c) 2021 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 qt_major_version 5

%if 0%{?suse_version} >= 1550
%define qt_major_version 6
%endif

Name:           qpwgraph
Version:        0.0.9
Release:        0
Summary:        PipeWire Graph Qt GUI Interface
License:        GPL-2.0-or-later
URL:            https://gitlab.freedesktop.org/rncbc/qpwgraph
Source:         https://gitlab.freedesktop.org/rncbc/qpwgraph/-/archive/v%{version}/qpwgraph-v%{version}.tar.bz2
Source1:        qpwgraph.desktop
BuildRequires:  cmake >= 3.15
BuildRequires:  gcc-c++
BuildRequires:  hicolor-icon-theme
BuildRequires:  pkgconfig
BuildRequires:  cmake(Qt%{qt_major_version}Core)
BuildRequires:  cmake(Qt%{qt_major_version}Gui)
BuildRequires:  cmake(Qt%{qt_major_version}Network)
BuildRequires:  cmake(Qt%{qt_major_version}Widgets)
BuildRequires:  pkgconfig(alsa)
BuildRequires:  pkgconfig(libpipewire-0.3)

%description
qpwgraph is a graph manager dedicated for PipeWire,
using the Qt C++ framework, based and pretty much like the
same of QjackCtl.

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

%build
%cmake \
        -DCONFIG_ALSA_MIDI=1 \
%if 0%{?qt_major_version} == 6
        -DCONFIG_QT6=1
%else
        -DCONFIG_QT6=0
%endif
%cmake_build

%install
%cmake_install
%if %{with png_icon}
install -D -m 0644 src/images/%{name}.png %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/%{name}.png
%endif
install -D -m 0644 src/images/%{name}.svg %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
install -D -m 0644 %{SOURCE1}             %{buildroot}%{_datadir}/applications/%{name}.desktop

%files
%license LICENSE.md
%doc README.md
%{_bindir}/%{name}
%if %{with png_icon}
%{_datadir}/icons/hicolor/scalable/apps/%{name}.png
%endif
%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
%{_datadir}/applications/%{name}.desktop

%changelog
openSUSE Build Service is sponsored by