File megacubo.spec of Package megacubo

#
# spec file for package sunshine
#
# Copyright (c) 2024 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: megacubo
Version: 17.5.5
Release: 0
Url: https://github.com/efoxbr/megacubo
Summary: A intuitive, multi-language and cross-platform IPTV player
Group: System/GUI/KDE
Source1: %{name}
Source2: %{name}.desktop
Source3: %{name}.png
Source4: %{name}-%{version}.tar.gz
BuildRequires: xz
BuildRequires: desktop-file-utils
BuildRequires: update-desktop-files
BuildRequires: hicolor-icon-theme
BuildRequires: -post-build-checks
BuildArch: noarch
License: GPL-3.0
Requires: xz
BuildRoot: %{_tmppath}/%{name}-%{version}-build

%description
Megacubo is an intuitive, multi-language and cross-platform IPTV player with
support for history, bookmarks and much more. You can add as many IPTV lists
you want (M3U format) and with Miniplayer mode, you can work or navigate on
your PC while watching any broadcast.

%prep

%check

%build

%install
mkdir -p %{buildroot}%{_bindir}
install -D -m 755 %{SOURCE1} %{buildroot}%{_bindir}/%{name}

mkdir -p %{buildroot}%{_datadir}/applications
install -D -m 644 %{SOURCE2} %{buildroot}%{_datadir}/applications/%{name}.desktop

mkdir -p %{buildroot}%{_datadir}/pixmaps
install -D -m 644 %{SOURCE3} %{buildroot}%{_datadir}/pixmaps/%{name}.png

mkdir -p %{buildroot}/usr/share/%{name}
install -D -m 644 %{SOURCE4} %{buildroot}/usr/share/%{name}/%{name}-%{version}.tar.gz

%post
if test -e "/usr/share/%{name}/%{name}-%{version}.tar.gz"; then
  tar xzf /usr/share/%{name}/%{name}-%{version}.tar.gz -C /usr/share/%{name}/
fi

update-desktop-database
gtk-update-icon-cache

%preun
if [ "$1" = 0 ]; then
  if test -e "/usr/share/%{name}/%{name}-%{version}.tar.gz"; then
    rm -rf "/usr/share/%{name}"
  fi

  update-desktop-database
  gtk-update-icon-cache
fi

%files
%defattr(-,root,root)
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.png
/usr/share/%{name}/%{name}-%{version}.tar.gz

%changelog
openSUSE Build Service is sponsored by