File discord.spec of Package discord
# #
# spec file for package discord
#
# 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/
#
# Discord Comes as Pre-built BINARY for Linux; No DEBUGGING Information should be Generated
%global debug_package %{nil}
%global __strip %{_bindir}/true
%global __requires_exclude libffmpeg.so
%global _build_id_links none
# Exclude Bundled Private Libraries
%global __provides_exclude_from %{_libdir}/discord/.*\\.s
#
%define original_name Discord
# For SUSE Only; FEDORA and MAGEIA Have this by Default
%if 0%{?suse_version} || 0%{?sle_version} && 0%{?is_opensuse}
%define _metainfodir %{_datadir}/metainfo/
%endif
#
Name: discord
Version: 0.0.111
Release: 0
Summary: IM Platform for text, voice, and video chat in customizable community servers
# License Information: https://bugzilla.rpmfusion.org/show_bug.cgi?id=4441#c14
#License: Proprietary
License: NonFree
URL: https://discordapp.com/
Source0: https://dl.discordapp.net/apps/linux/%{version}/%{name}-%{version}.tar.gz
Source1: https://raw.githubusercontent.com/flathub/com.discordapp.%{original_name}/master/com.discordapp.%{original_name}.appdata.xml#/%{name}.metainfo.xml
Source2: wrapper.sh
Source3: disable-breaking-updates.py
Source4: postinst.sh
ExclusiveArch: x86_64
BuildRequires: (appstream-glib-devel or libappstream-glib-devel or lib64appstream-glib-devel)
BuildRequires: desktop-file-utils
BuildRequires: (procps or procps-ng)
Requires: glibc
Requires: (libXtst >= 1.2 or libXtst6 >= 1.2)
Requires: (mozilla-nspr >= 4.13 or nspr >= 4.13)
Requires: (mozilla-nss >= 3.27 or nss >= 3.27)
Requires: hicolor-icon-theme
%description
Discord is a communication platform designed for creating communities,
primarily used by gamers, developers, educators, and various interest groups.
It offers text, voice, and video chat functionalities, organized into servers—customizable,
invite-only spaces where users can interact in channels dedicated to specific topics or activities.
Servers can be public or private, supporting both small groups and large-scale communities.
Key features include real-time messaging, voice and video calls, screen sharing, and robust moderation tools.
Discord supports integrations with bots for automation, entertainment, or productivity,
and it connects with platforms like Spotify, YouTube, and gaming services. It is accessible on desktop,
mobile, and web browsers, with a user-friendly interface.
%prep
%autosetup -n %{original_name}
%build
#
# Nothing to BUILD - Discord Comes as Pre-built BINARY for Linux
#
%install
desktop-file-install \
--set-icon=%{name} \
--set-key=Exec --set-value=%{_bindir}/%{name} \
--remove-key=Path \
--delete-original \
--dir=%{buildroot}/%{_datadir}/applications \
%{name}.desktop
mkdir -p %{buildroot}/%{_libdir}/%{name}/
cp -fr "." -t %{buildroot}/%{_libdir}/%{name}/
install -Dm644 "%{name}.png" -t "%{buildroot}/%{_datadir}/icons/hicolor/256x256/apps/"
install -Dm644 %{SOURCE1} -t %{buildroot}/%{_metainfodir}/
install -Dm755 %{SOURCE2} -t %{buildroot}/%{_libdir}/%{name}/
install -Dm755 %{SOURCE3} -t %{buildroot}/%{_libdir}/%{name}/
mkdir -p %{buildroot}/%{_bindir}/
ln -fs "%{_libdir}/%{name}/wrapper.sh" %{buildroot}/%{_bindir}/%{name}
%check
desktop-file-validate "%{buildroot}/%{_datadir}/applications/%{name}.desktop"
appstream-util validate-relax --nonet "%{buildroot}/%{_metainfodir}/%{name}.metainfo.xml"
%post
"%{_bindir}/sh" "%{_libdir}/%{name}/postinst.sh"
%files
%{_bindir}/%{name}
"%{_datadir}/applications/%{name}.desktop"
%dir "%{_datadir}/icons/hicolor/"
%dir "%{_datadir}/icons/hicolor/256x256/"
%dir "%{_datadir}/icons/hicolor/256x256/apps/"
"%{_datadir}/icons/hicolor/256x256/apps/%{name}.png"
%{_libdir}/%{name}
"%{_metainfodir}/%{name}.metainfo.xml"
%changelog