File linuxqq.spec of Package linuxqq

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


%global _bindir         %{_bindir}
%global _appimage       %{name}_%{_version}_x86_64_01.AppImage
%define _name           qq
%define _version        3.2.12_240902
Name:           linuxqq
Version:        3.2.12
Release:        1%{?dist}
Summary:        New Linux QQ based on Electron
License:        NonFree
URL:            https://im.qq.com/linuxqq/index.shtml
Source0:        https://dldir1.qq.com/qqfile/qq/QQNT/Linux/QQ_%{_version}_x86_64_01.AppImage
Source1:        %{_name}.desktop
Source2:        %{_name}.png
BuildRequires:  desktop-file-utils
Provides:       qq
Provides:       QQ
ExclusiveArch:  x86_64

%description
Tencent QQ, also known as QQ, is an instant messaging software service and web portal developed by the Chinese technology company Tencent.

%prep
chmod +x "%{SOURCE0}"
cd %{_sourcedir}

%build

%install
# AppImage
install -Dm755 "%{SOURCE0}" "%{buildroot}%{_libdir}/%{name}/%{_name}.AppImage"

# Desktop
install -Dm644 "%{SOURCE1}" "%{buildroot}%{_datadir}/applications/%{_name}.desktop"

# icon
install -dm755 "%{buildroot}%{_datadir}/icons/hicolor/scalable/apps/"
cp "%{SOURCE2}" "%{buildroot}%{_datadir}/icons/hicolor/scalable/apps/qq.png"

# Symlink executable
install -dm755 "%{buildroot}%{_bindir}"
ln -s "%{_libdir}/%{name}/%{_name}.AppImage" "%{buildroot}%{_bindir}/%{_name}"

%files
# bin
%{_bindir}/%{_name}
%dir %{_libdir}/%{name}
%{_libdir}/%{name}/%{_name}.AppImage

# desktop
%{_datadir}/applications/%{_name}.desktop

# icon
%dir %{_datadir}/icons/hicolor
%dir %{_datadir}/icons/hicolor/scalable
%dir %{_datadir}/icons/hicolor/scalable/apps
%{_datadir}/icons/hicolor/scalable/apps/qq.png

%changelog
openSUSE Build Service is sponsored by