File mpc-qt.spec of Package mpc-qt

#
# spec file for package mpc-qt
#
# 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  _name  io.github.mpc_qt.Mpc-Qt
Name:           mpc-qt
Version:        @SERVICE@
Release:        0
Summary:        Media Player Classic Qute Theater
License:        GPL-2.0-only
Group:          Productivity/Multimedia/Video/Players
URL:            https://github.com/mpc-qt/mpc-qt
Source:         %{name}-%{version}.tar.xz
BuildRequires:  cmake
BuildRequires:  cmake(Qt5LinguistTools)
BuildRequires:  gcc-c++
BuildRequires:  hicolor-icon-theme
BuildRequires:  libQt5Gui-private-headers-devel
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(Qt5Core)
BuildRequires:  pkgconfig(Qt5DBus)
BuildRequires:  pkgconfig(Qt5Gui)
BuildRequires:  pkgconfig(Qt5Network)
BuildRequires:  pkgconfig(Qt5Widgets)
BuildRequires:  pkgconfig(Qt5X11Extras)
BuildRequires:  pkgconfig(mpv)
BuildRequires:  pkgconfig(xtst)
%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150200
BuildRequires:  rsvg-convert
%else
BuildRequires:  rsvg-view
%endif
BuildRequires:  update-desktop-files

%description
Media Player Classic Home Cinema (mpc-hc) is considered by many to be the
quintessential media player for the Windows desktop.  Media Player Classic
Qute Theater (mpc-qt) aims to reproduce most of the interface and
functionality of mpc-hc while using [libmpv] to play video instead of
DirectShow.

%lang_package

%prep
%autosetup

%build
%qmake5 \
    PREFIX=%{_prefix}
%make_jobs

%install
%qmake5_install
rm -rfv %{buildroot}%{_datadir}/doc

for i in 16 24 32 48 64 72; do
    install -dm 0755 %{buildroot}%{_datadir}/icons/hicolor/$i\x$i/apps
    rsvg-convert -h $i -w $i images/icon/%{name}.svg -o %{buildroot}%{_datadir}/icons/hicolor/$i\x$i/apps/%{name}.png
done

%find_lang %{name} --with-qt

%files
%license LICENSE
%doc README.md DOCS/ipc.md
%{_bindir}/%{name}
%{_datadir}/applications/%{_name}.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}.??g
%{_datadir}/metainfo/%{_name}.appdata.xml

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

%changelog
openSUSE Build Service is sponsored by