File sayonara.spec of Package sayonara

#
# spec file for package sayonara
#
# Copyright (c) 2022 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/
#


Name:           sayonara
Version:        1.7.0+git0.18e63ab3
Release:        0
Summary:        A lightweight Qt Audio player
License:        GPL-3.0-or-later
Group:          Productivity/Multimedia/Sound/Players
URL:            https://sayonara-player.com
Source:         %{name}-player-%{version}.tar.gz
BuildRequires:  cmake
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  hicolor-icon-theme
BuildRequires:  pkgconfig
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(Qt5Core) >= 5.3.0
BuildRequires:  pkgconfig(Qt5DBus)
BuildRequires:  pkgconfig(Qt5Network)
BuildRequires:  pkgconfig(Qt5Sql)
BuildRequires:  pkgconfig(Qt5Svg)
BuildRequires:  pkgconfig(Qt5UiTools)
BuildRequires:  pkgconfig(Qt5Widgets)
BuildRequires:  pkgconfig(Qt5Xml)
BuildRequires:  pkgconfig(gstreamer-1.0)
BuildRequires:  pkgconfig(gstreamer-plugins-base-1.0)
BuildRequires:  pkgconfig(libmtp)
BuildRequires:  pkgconfig(taglib)
Recommends:     %{name}-lang
Recommends:     gstreamer-plugins-bad
Recommends:     gstreamer-plugins-good
Recommends:     gstreamer-plugins-libav
Recommends:     gstreamer-plugins-ugly

%description
Small and lightweight music player.

Main features:
 * Many supported music and playlist formats
 * Media library with search function
 * Directory view
 * External device support
 * Genre organization
 * Playlist view organized by tabs
 * Dynamic playback

%lang_package

%prep
%setup -q -n %{name}-player-%{version}
# rpmlint
find . -type f -exec sed -i -e 's|\/usr\/bin\/env python3|\/usr\/bin\/python3|g' {} \;

%build
%cmake \
    -DCMAKE_EXE_LINKER_FLAGS="-pie" \
    -DCMAKE_SHARED_LINKER_FLAGS="-Wl,--as-needed -Wl,-z,now" \
    -DCMAKE_INSTALL_PREFIX=%{_prefix}
%if 0%{?suse_version} < 1500
%make_jobs
%else
%cmake_build
%endif

%install
%cmake_install
%fdupes %{buildroot}%{_datadir}

%if 0%{?suse_version} < 1500
%post
%icon_theme_cache_post
%desktop_database_post

%postun
%icon_theme_cache_postun
%desktop_database_postun
%endif

%files
%license LICENSE
%doc MANUAL
%{_bindir}/sayonara
%{_bindir}/sayonara-*
%{_datadir}/metainfo/sayonara.appdata.xml
%{_datadir}/applications/com.sayonara-player.Sayonara.desktop
%{_datadir}/icons/hicolor/*/apps/sayonara.???
%{_mandir}/man?/sayonara.?%{ext_man}
%{_mandir}/man?/sayonara-*.?%{ext_man}
%{_datadir}/sayonara/
%exclude %{_datadir}/%{name}/translations

%files lang
%{_datadir}/%{name}/translations/

%changelog
openSUSE Build Service is sponsored by