Projects
Extra
discord
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 13
View file
discord.spec
Changed
@@ -1,7 +1,8 @@ # # spec file for package discord # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2023-2026 SUSE LLC. +# Copyright (c) 2021 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,38 +19,61 @@ # Require bash for extglob in install section. %global _buildshell /bin/bash -%global __requires_exclude ^(libffmpeg|libnode).* -%global __provides_exclude ^(libffmpeg|libnode).* -# This is to enable build with patent encoumbered codecs. Not allowed in OBS -%bcond_with x264 + Name: discord -Version: 0.0.10 +Version: 1.0.152 Release: 0 Summary: Voice and Text Chat for Gamers License: SUSE-NonFree -Group: chat voice-chat +Group: Productivity/Networking/Instant Messenger URL: https://discordapp.com/ Source0: https://dl.discordapp.net/apps/linux/%{version}/%{name}-%{version}.tar.gz -#Source0: https://discordapp.com/api/download?platform=linux&format=tar.gz -Source2: discord-symbolic.svg -Source99: PERMISSION +Source1: discord-symbolic.svg +Source2: https://raw.githubusercontent.com/flathub/com.discordapp.Discord/master/com.discordapp.Discord.appdata.xml + +# Wrapper script to disable updates in user's Discord settings.json file +# Then the script calls the actual Discord's executable in lib. +Source3: disable-updates.sh + +# Permission file to distribute this package legally. +# This file is included as a kind of LICENSE. +Source4: PERMISSION + +# Discord is only available for x86_64 architecture at the moment. ExclusiveArch: x86_64 + +# Build dependencies needed to extract the .tar.gz and validate appstream metadata. BuildRequires: desktop-file-utils BuildRequires: hicolor-icon-theme -BuildRequires: update-desktop-files BuildRequires: unzip -Conflicts: discord -Requires: libgtk-2_0-0 libnotify-tools libasound2 gconf2 mozilla-nss dbus-1-glib libXtst6 libX11-6 libstdc++6 libc++1 libatomic1 - -#Patent free ffmpeg config -#Snippets from https://github.com/orionhealth/electron-packager-plugin-non-proprietary-codecs-ffmpeg/blob/master/src/downloadFFMPEG.js -%define electronVersion 4.0.1 -%define ffmpegarch x64 -%define ffmpegplatform linux -%define ffmpegFileName ffmpeg-v%{electronVersion}-%{ffmpegplatform}-%{ffmpegarch}.zip -#eg. https://github.com/electron/electron/releases/download/v1.6.11/ffmpeg-v1.6.11-linux-x64.zip -Source1: https://github.com/electron/electron/releases/download/v%{electronVersion}/%{ffmpegFileName} - +BuildRequires: AppStream + +# For the wrapper script: +Requires: grep +Requires: sed +Requires: coreutils + +# Runtime dependencies required by the Discord package. +Requires: atk +Requires: cairo +Requires: pango +Requires: gtk3 +Requires: at-spi2-core +Requires: zenity +Requires: hicolor-icon-theme >= 0.15 + +# basic infrastructure +Requires: glibc +Requires: mozilla-nspr >= 4.13 +Requires: mozilla-nss >= 3.27 + +# Recommended packages +Recommends: libva-utils +Recommends: pipewire + +Provides: discord = %{version} +Conflicts: discord-bootstrap < %{version} +Obsoletes: discord < %{version} %description Discord is a voice and text chat for gamers. The Text chat supports @@ -58,64 +82,68 @@ Server-to-client communications are encrypted. %prep -%setup -n Discord -%setup -T -a 1 -c -n ffmpeg +%setup -q -n Discord %build -%if %{with x264} -# nothing to do -: -%else -rm %{_builddir}/Discord/libffmpeg.so -cp %{_builddir}/ffmpeg/libffmpeg.so %{_builddir}/Discord/ -%endif +# Nothing to do %install +# Install the icon in the correct location. cd %{_builddir}/Discord -install -Dm644 discord.png %{buildroot}%{_datadir}/icons/hicolor/256x256/apps/%{name}.png +install -Dm644 discord.png %{buildroot}%{_datadir}/icons/hicolor/256x256/apps/discord.png + +# Make sure the desktop file is installed with the correct Exec path to the wrapper script in bin. desktop-file-install \ --dir=%{buildroot}%{_datadir}/applications \ --set-key=Exec \ - --set-value=%{_bindir}/%{name} \ - %{name}.desktop + --set-value=%{_bindir}/discord \ + discord.desktop -install -Dm755 chrome-sandbox %{buildroot}%{_libdir}/%{name}/chrome-sandbox -install -Dm755 libffmpeg.so %{buildroot}%{_libdir}/%{name}/libffmpeg.so -install -Dm755 libEGL.so %{buildroot}%{_libdir}/%{name}/libEGL.so -install -Dm755 libGLESv2.so %{buildroot}%{_libdir}/%{name}/libGLESv2.so -install -Dm755 %SOURCE1 %{buildroot}%{_datadir}/icons/hicolor/symbolic/apps/%{name}-symbolic.svg +# Install the symbolic icon, appdata and permission files in the correct locations. +install -Dm644 %{SOURCE1} %{buildroot}%{_datadir}/icons/hicolor/symbolic/apps/discord-symbolic.svg +install -Dm644 %{SOURCE2} %{buildroot}%{_datadir}/appdata/com.discordapp.Discord.appdata.xml +install -Dm644 %{SOURCE4} %{buildroot}%{_datadir}/licenses/discord/PERMISSION -# install share -mkdir -p %{buildroot}%{_libdir}/%{name} +# Install the extracted files from the Discord tarball in lib64/discord. +mkdir -p %{buildroot}%{_libdir}/discord shopt -s extglob -cp -r !(discord*|*.so) %{buildroot}%{_libdir}/%{name} +cp -r * %{buildroot}%{_libdir}/discord shopt -u extglob -# fix missing icon in some envoronments -ln -sf %{_datadir}/icons/hicolor/256x256/apps/%{name}.png /%{buildroot}%{_libdir}/%{name} +# Fix missing icon in some environments +ln -sf %{_datadir}/icons/hicolor/256x256/apps/discord.png %{buildroot}%{_libdir}/discord # Executable checks for resources in its directory so it cannot be in bin. +# Instead, we install a wrapper script in bin that calls the executable in lib. +# And the wrapper script disables updates to prevent the program from breaking. mkdir -p %{buildroot}%{_bindir} -ln -s %{_libdir}/%{name}/Discord %{buildroot}%{_bindir}/%{name} - -%post -%if 0%{?suse_version} < 1500 -%desktop_database_post -%endif -chmod 0755 %{_libdir}/%{name}/Discord - -%if 0%{?suse_version} < 1500 -%postun -%desktop_database_postun -%endif +install -v -m 755 %{SOURCE3} %{buildroot}%{_bindir}/discord +%check +# Validate the desktop file and appstream metadata. +desktop-file-validate %{buildroot}%{_datadir}/applications/discord.desktop +appstreamcli validate --no-net %{buildroot}%{_datadir}/appdata/com.discordapp.Discord.appdata.xml %files +# Set file attributes %defattr(-,root,root) -%{_bindir}/%{name} -%{_datadir}/applications/%{name}.desktop -%{_datadir}/icons/hicolor/256x256/apps/%{name}.png -%{_datadir}/icons/hicolor/symbolic/apps/%{name}-symbolic.svg -%{_libdir}/%{name} + +# Software distribution permission as a LICENSE file for the package. +%dir %{_datadir}/licenses/discord +%license %{_datadir}/licenses/discord/PERMISSION + +# Main Discord bootstrap files +%{_libdir}/discord + +# Wrapper script to disable updates +%{_bindir}/discord + +# Desktop files and icons +%{_datadir}/applications/discord.desktop +%{_datadir}/icons/hicolor/256x256/apps/discord.png +%{_datadir}/icons/hicolor/symbolic/apps/discord-symbolic.svg + +# Appstream metadata files +%{_datadir}/appdata/com.discordapp.Discord.appdata.xml %changelog
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.