File eXo.spec of Package eXo

#
# spec file for package eXo
#
# 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/
#


%define  _name  exo
Name:           eXo
Version:        @SERVICE@
Release:        0
Summary:        Qt frontend to MOC
License:        GPL-3.0-only
Group:          Productivity/Multimedia/Sound/Players
URL:            https://github.com/loimu/exo
Source:         %{name}-%{version}.tar.xz
BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRequires:  hicolor-icon-theme
BuildRequires:  ninja
BuildRequires:  pkgconfig
BuildRequires:  update-desktop-files
%if 0%{?suse_version} >= 1699
BuildRequires:  cmake(Qt6Core)
BuildRequires:  cmake(Qt6DBus)
BuildRequires:  cmake(Qt6LinguistTools)
BuildRequires:  cmake(Qt6Network)
BuildRequires:  cmake(Qt6Test)
BuildRequires:  cmake(Qt6Widgets)
BuildRequires:  cmake(Qt6Xml)
BuildRequires:  cmake(lastfm6)
Requires:       qt6-tools-qdbus
%else
BuildRequires:  cmake(Qt5Core)
BuildRequires:  cmake(Qt5DBus)
BuildRequires:  cmake(Qt5LinguistTools)
BuildRequires:  cmake(Qt5Network)
BuildRequires:  cmake(Qt5Test)
BuildRequires:  cmake(Qt5Widgets)
BuildRequires:  cmake(Qt5Xml)
BuildRequires:  liblastfm-qt5-devel
BuildRequires:  libqt5-qdbus
%requires_eq    libqt5-qdbus
%endif
Requires:       moc
Recommends:     %{name}-lang

%description
Qt frontend to MOC (Music on Console) player. Combination of eXo and MOC
gives you a modern yet very minimalistic audio player.
Features:
 * Lyrics from web
 * Background mode
 * DBus and MPRISv2 interfaces. Enables media controls in your desktop
   environment
 * Scrobbling to last.fm (optional)
 * Bookmarks for radio streams
 * OSD notifications
 * Optional CMus support
 * Optional Spotify client support (limited functionality, scrobbling only)

%lang_package

%prep
%autosetup -p1
%if 0%{?suse_version} >= 1699
sed -i "1s|\(#\!\).*|\1/bin/sh|;s|qdbus|%{_qt6_bindir}/qdbus|" tools/exo-*
%else
sed -i "1s|\(#\!\).*|\1/bin/sh|;s|qdbus|%{_libqt5_bindir}/qdbus|" tools/exo-*
%endif

%build
%define __builder ninja
%cmake \
%if 0%{?suse_version} >= 1699
    -DWITH_QT6=ON \
%endif
    -DBUILD_TESTS=ON
%ninja_build

%install
%ninja_install -C build
%suse_update_desktop_file -r -G "Qt frontend to MOC" %{_name} Qt AudioVideo Player

%find_lang %{name} --with-qt --all-name

%check
#%%ctest
./build/src/tests

%files
%doc Changelog README.md
%{_bindir}/%{_name}*
%{_datadir}/applications/*%{_name}.desktop
%{_datadir}/icons/hicolor/*/apps/%{_name}.??g
%{_datadir}/pixmaps/%{_name}??.xpm
%{_mandir}/man?/%{_name}.?%{?ext_man}
%license Copying

%files lang -f %{name}.lang
%dir %{_datadir}/%{_name}
%dir %{_datadir}/%{_name}/translations

%changelog
openSUSE Build Service is sponsored by