%global debug_package %{nil} # The Go import path for the upstream repo %global goipath github.com/Equicord/Equilotl Version: 2.1.4 %global commit f968017800a6db095f4aacf3e95062b05c073c11 %global shortcommit %(c=%{commit}; echo ${c:0:7}) # Sets up %%{gourl}, %%{gosource}, %%{gobuilddir}, etc. # -L = use a local (non-forked) source URL layout # -f = forged: override the module path declared in go.mod (the upstream # go.mod still says github.com/Vencord/Installer since this is a fork) %gometa -L -f Name: equicord-installer Release: 1%{?dist} Summary: A cross-platform GUI/CLI app for installing Equicord License: GPL-3.0-only URL: %{gourl} # Expands to the GitHub archive tarball for the pinned version/commit Source0: %{gosource} BuildRequires: go-rpm-macros BuildRequires: go-srpm-macros BuildRequires: golang BuildRequires: gcc-c++ BuildRequires: pkg-config BuildRequires: libGL-devel BuildRequires: libXxf86vm-devel BuildRequires: libXcursor-devel BuildRequires: libXi-devel BuildRequires: libXinerama-devel BuildRequires: libXrandr-devel BuildRequires: wayland-devel BuildRequires: libxkbcommon-devel BuildRequires: wayland-protocols-devel BuildRequires: extra-cmake-modules %description A cross-platform GUI/CLI app for installing Equicord, an enhanced fork of Vencord for the Discord desktop client. # --------------------------------------------------------------------------- # Subpackages # --------------------------------------------------------------------------- %package cli Summary: CLI-only binary for %{name} %description cli The headless command-line version of the Equicord installer, used by the automatic Discord integration subpackages. %package discord-stable Summary: Automatic Equicord injection for Discord stable Requires: %{name}-cli = %{version}-%{release} Requires(posttrans): %{name}-cli = %{version}-%{release} %description discord-stable Installs an RPM file-trigger that automatically patches Equicord into Discord stable (/usr/share/discord) whenever that package is installed or updated via DNF. %package discord-canary Summary: Automatic Equicord injection for Discord canary Requires: %{name}-cli = %{version}-%{release} Requires(posttrans): %{name}-cli = %{version}-%{release} %description discord-canary Installs an RPM file-trigger that automatically patches Equicord into Discord canary (/usr/share/discord-canary) whenever that package is installed or updated via DNF. %package discord-ptb Summary: Automatic Equicord injection for Discord PTB Requires: %{name}-cli = %{version}-%{release} Requires(posttrans): %{name}-cli = %{version}-%{release} %description discord-ptb Installs an RPM file-trigger that automatically patches Equicord into Discord PTB (/usr/share/discord-ptb) whenever that package is installed or updated via DNF. # --------------------------------------------------------------------------- # Build # --------------------------------------------------------------------------- %prep # GitHub archives a commit-based source as Equilotl-/ # NOT Equilotl-/, so we must use %{commit} here, not %{version} %autosetup -n Equilotl-%{commit} # Download Go module dependencies # Requires "Enable internet access during builds" in COPR project settings go mod download %build export CGO_CPPFLAGS="${CPPFLAGS}" export CGO_CFLAGS="${CFLAGS}" export CGO_CXXFLAGS="${CXXFLAGS}" export CGO_LDFLAGS="${LDFLAGS}" # GUI binary (requires display / Wayland libs) %gobuild -o %{gobuilddir}/bin/equicord-installer %{goipath} # Headless CLI binary — same source, compiled with the "cli" build tag %gobuild -o %{gobuilddir}/bin/equicord-installer-cli -tags cli %{goipath} %install install -m 0755 -vd %{buildroot}%{_bindir} install -m 0755 -vp %{gobuilddir}/bin/equicord-installer \ %{gobuilddir}/bin/equicord-installer-cli \ %{buildroot}%{_bindir}/ # --------------------------------------------------------------------------- # File lists # --------------------------------------------------------------------------- %files %license LICENSE %doc README.md %{_bindir}/equicord-installer %files cli %license LICENSE %doc README.md %{_bindir}/equicord-installer-cli # The discord-* subpackages own no files of their own — all they do is # carry the file-trigger scriptlets below. %files discord-stable %license LICENSE %files discord-canary %license LICENSE %files discord-ptb %license LICENSE # --------------------------------------------------------------------------- # File-trigger scriptlets # # %transfiletriggerin fires whenever RPM touches any file under the watched # directory — i.e. on every install OR update of the discord package. # The CLI's -install flag is idempotent: safe to run repeatedly. # --------------------------------------------------------------------------- %transfiletriggerin -n %{name}-discord-stable -- /usr/share/discord %{_bindir}/equicord-installer-cli -install -location /usr/share/discord %transfiletriggerin -n %{name}-discord-canary -- /usr/share/discord-canary %{_bindir}/equicord-installer-cli -install -location /usr/share/discord-canary %transfiletriggerin -n %{name}-discord-ptb -- /usr/share/discord-ptb %{_bindir}/equicord-installer-cli -install -location /usr/share/discord-ptb %changelog %autochangelog