%if 0%{?rhel} == 8
%undefine __cmake_in_source_build
%endif

Name:           fooyin
Version:        0.5.3
Release:        1%{dist}
Summary:        A customisable music player
License:        GPL-3.0
URL:            https://github.com/ludouzi/%{name}
Source:         https://github.com/ludouzi/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz

BuildRequires:  gcc-toolset-13-gcc-c++
BuildRequires:  hicolor-icon-theme

%if 0%{?rhel} == 9
BuildRequires:  cmake(KDSingleApplication)
BuildRequires:  cmake(Qt5Core)
BuildRequires:  cmake(Qt5DBus)
BuildRequires:  cmake(Qt5LinguistTools)
BuildRequires:  cmake(Qt5Svg)
BuildRequires:  cmake(Qt5Widgets)
%else
BuildRequires:  cmake(KDSingleApplication-qt6)
BuildRequires:  cmake(Qt6Core)
BuildRequires:  cmake(Qt6DBus)
BuildRequires:  cmake(Qt6Linguist)
BuildRequires:  cmake(Qt6LinguistTools)
BuildRequires:  cmake(Qt6OpenGLWidgets)
BuildRequires:  cmake(Qt6Svg)
BuildRequires:  cmake(Qt6Widgets)
%endif

BuildRequires:  pkgconfig(alsa)
BuildRequires:  pkgconfig(icu-uc)
BuildRequires:  pkgconfig(libavcodec)
BuildRequires:  pkgconfig(libavdevice)
BuildRequires:  pkgconfig(libavformat)
BuildRequires:  pkgconfig(libavutil)
BuildRequires:  pkgconfig(taglib)
BuildRequires:  pkgconfig(xkbcommon)

%description
fooyin is a Qt6 music player built around customisation. It offers a
growing list of widgets to manage and play a local music collection.
It is extendable through the use of plugins, and many widgets make
use of FooScript to offer an even deeper level of control.

%prep
%autosetup -p1

%build
%enable_devtoolset13
%cmake
%cmake_build

%install
%cmake_install
# No header files were installed, so... no point in keeping the
# component libraries' devel files.
rm -fv %{buildroot}/%{_libdir}/fooyin/*.so

%files
%license COPYING
%doc README.md
%{_bindir}/%{name}
%{_datadir}/applications/*
%{_datadir}/doc/%{name}
%{_datadir}/metainfo/*
%{_datadir}/icons/hicolor/*/apps/org.%{name}.%{name}.*
%{_datadir}/%{name}
%{_libdir}/%{name}/

%changelog
* Mon Jul  8 2024 Raven <raven@sysadmins.ws> - 0.5.3-1
- Initial build
