diff --git a/anda/apps/legcord/legcord-bin/anda.hcl b/anda/apps/legcord/legcord-bin/anda.hcl new file mode 100644 index 0000000000..5c31d7cdce --- /dev/null +++ b/anda/apps/legcord/legcord-bin/anda.hcl @@ -0,0 +1,5 @@ +project pkg { + rpm { + spec = "legcord-bin.spec" + } +} diff --git a/anda/apps/legcord/legcord-bin/legcord-bin.spec b/anda/apps/legcord/legcord-bin/legcord-bin.spec new file mode 100644 index 0000000000..62e844b9d9 --- /dev/null +++ b/anda/apps/legcord/legcord-bin/legcord-bin.spec @@ -0,0 +1,96 @@ +%define debug_package %nil +%global _build_id_links none + +%ifarch x86_64 +%global src LegCord-%version-linux-x64 +%elifarch aarch64 +%global src LegCord-%version-linux-arm64 +%elifarch armv7l +%global src LegCord-%version-linux-armv7l +%endif + +# Exclude private libraries +%global __requires_exclude libffmpeg.so +%global __provides_exclude_from %{_datadir}/(armcord|legcord)/.*\\.so + +Name: legcord-bin +Version: 1.0.4 +Release: 1%?dist +License: OSL-3.0 +Summary: Custom lightweight Discord client designed to enhance your experience +URL: https://github.com/LegCord/LegCord +Group: Applications/Internet +Source0: %url/releases/download/v%version/%src.zip +Source1: legcord.png +Source2: https://raw.githubusercontent.com/LegCord/LegCord/v%version/README.md +Requires: xdg-utils +BuildRequires: unzip +ExclusiveArch: x86_64 aarch64 armv7l +Conflicts: legcord +Conflicts: legcord-nightly +BuildRequires: add-determinism +Obsoletes: armcord < 3.3.2-1 + +%description +LegCord is a custom client designed to enhance your Discord experience +while keeping everything lightweight. + +%prep +mkdir legcord +cd legcord +unzip %SOURCE0 + +cat < .legcord.desktop +[Desktop Entry] +Name=LegCord +Comment=%summary +GenericName=Internet Messenger +Type=Application +Exec=%_bindir/legcord +Icon=legcord +Categories=Network;InstantMessaging; +StartupWMClass=legcord +Keywords=discord;armcord;legcord;vencord;shelter;electron; +EOF + +%build + +%install +cd legcord +mkdir -p %buildroot%_bindir %buildroot%_datadir/applications %buildroot%_datadir/pixmaps %buildroot%_datadir/legcord %buildroot%_docdir/%name +cp -a * %buildroot%_datadir/legcord/ +ln -s %_datadir/legcord/legcord %buildroot%_bindir/legcord +ln -s %_datadir/legcord %buildroot%_datadir/armcord +chmod +x -R %buildroot%_datadir/legcord/* +chmod 755 %buildroot%_datadir/legcord/legcord +install -Dm644 .legcord.desktop %buildroot%_datadir/applications/LegCord.desktop +install -Dm644 %SOURCE1 %buildroot%_datadir/pixmaps/legcord.png +install -Dm644 %SOURCE2 %buildroot%_docdir/%name/ + +# HACK: rpm bug for unability to replace existing files on system. +%pre +if [ -d %_datadir/armcord ] && [ ! -L %_datadir/armcord ]; then + echo "Found old %_datadir/armcord directory, removing…" + rm -rf %_datadir/armcord +fi + +%files +%doc README.md +%_datadir/legcord +%_datadir/armcord +%_bindir/legcord +%_datadir/applications/LegCord.desktop +%_datadir/pixmaps/legcord.png + +%changelog +* Mon Oct 21 2024 madonuko - 1.0.2-2 +- Rename to LegCord. + +* Sat Jun 17 2023 madonuko - 3.2.0-2 +- Remove libnotify dependency. +- Fix desktop entry. +- Set as noarch package because there are not binary files. +- Use /usr/share/ instead of /opt/ + +* Sat May 6 2023 madonuko - 3.1.7-1 +- Initial package diff --git a/anda/apps/legcord/legcord-bin/legcord.png b/anda/apps/legcord/legcord-bin/legcord.png new file mode 100644 index 0000000000..bb87d3bafe Binary files /dev/null and b/anda/apps/legcord/legcord-bin/legcord.png differ diff --git a/anda/apps/legcord/update.rhai b/anda/apps/legcord/legcord-bin/update.rhai similarity index 100% rename from anda/apps/legcord/update.rhai rename to anda/apps/legcord/legcord-bin/update.rhai diff --git a/anda/apps/legcord/nightly/anda.hcl b/anda/apps/legcord/nightly/anda.hcl new file mode 100644 index 0000000000..819f094492 --- /dev/null +++ b/anda/apps/legcord/nightly/anda.hcl @@ -0,0 +1,9 @@ +project pkg { + arches = ["x86_64"] + rpm { + spec = "legcord-nightly.spec" + } + labels { + nightly = 1 + } +} \ No newline at end of file diff --git a/anda/apps/legcord/launch.sh b/anda/apps/legcord/nightly/launch.sh similarity index 100% rename from anda/apps/legcord/launch.sh rename to anda/apps/legcord/nightly/launch.sh diff --git a/anda/apps/legcord/nightly/legcord-nightly.spec b/anda/apps/legcord/nightly/legcord-nightly.spec new file mode 100644 index 0000000000..abce873304 --- /dev/null +++ b/anda/apps/legcord/nightly/legcord-nightly.spec @@ -0,0 +1,91 @@ +%global commit 54a482bcf4384ffdeaf57568f52c7f2b5178695d +%global commit_date 20241022 +%global shortcommit %(c=%{commit}; echo ${c:0:7}) +%define debug_package %nil + +Name: legcord-nightly +Version: %commit_date.%shortcommit +Release: 1%?dist +License: OSL-3.0 +Summary: Custom lightweight Discord client designed to enhance your experience +URL: https://github.com/LegCord/LegCord +Group: Applications/Internet +Source0: %url/archive/%commit/legcord-%commit.tar.gz +Source1: launch.sh +Packager: Owen +Requires: electron xdg-utils +Provides: armcord-nightly +Obsoletes: armcord < 3.3.2-1 +Conflicts: legcord-bin +Conflicts: legcord +BuildArch: noarch +BuildRequires: anda-srpm-macros pnpm + +%description +legcord is a custom client designed to enhance your Discord experience +while keeping everything lightweight. + +%prep +%autosetup -n Legcord-%commit + +cat < legcord.desktop +[Desktop Entry] +Name=LegCord +Comment=%summary +GenericName=Internet Messenger +Type=Application +Exec=/usr/bin/legcord +Icon=legcord +Categories=Network;InstantMessaging; +StartupWMClass=legcord +Keywords=discord;armcord;legcord;vencord;shelter;electron; +EOF + + +%build +pnpm install --no-frozen-lockfile +pnpm run packageQuick + + +%install +install -Dm644 dist/*-unpacked/resources/app.asar %buildroot/usr/share/legcord/app.asar + +install -Dm755 %SOURCE1 %buildroot/usr/bin/legcord +install -Dm644 legcord.desktop %buildroot/usr/share/applications/LegCord.desktop +install -Dm644 build/icon.png %buildroot/usr/share/pixmaps/legcord.png + +ln -s %_datadir/legcord %buildroot%_datadir/armcord + +# HACK: rpm bug for unability to replace existing files on system. +%pre +if [ -d %_datadir/armcord ] && [ ! -L %_datadir/armcord ]; then + echo "Found old %_datadir/armcord directory, removing…" + rm -rf %_datadir/armcord +fi + +%files +%doc README.md +%license license.txt +/usr/bin/legcord +/usr/share/applications/LegCord.desktop +/usr/share/pixmaps/legcord.png +/usr/share/legcord/app.asar +/usr/share/armcord + +%changelog +* Fri Nov 22 2024 owen - 1.0.2-2 +- Add nightly package. + +* Mon Oct 21 2024 madonuko - 1.0.2-2 +- Rename to LegCord. + +* Mon Aug 26 2024 madonuko - 3.3.0-1 +- Update to license.txt + +* Sat Jun 17 2023 windowsboy111 - 3.2.0-2 +- Remove libnotify dependency. +- Fix desktop entry. +- Set as noarch package because there are not binary files. + +* Sat May 6 2023 windowsboy111 - 3.1.7-1 +- Initial package \ No newline at end of file diff --git a/anda/apps/legcord/nightly/update.rhai b/anda/apps/legcord/nightly/update.rhai new file mode 100644 index 0000000000..45072b3c15 --- /dev/null +++ b/anda/apps/legcord/nightly/update.rhai @@ -0,0 +1,5 @@ +rpm.global("commit", gh_commit("Legcord/Legcord")); +if rpm.changed() { + rpm.release(); + rpm.global("commit_date", date()); +} \ No newline at end of file diff --git a/anda/apps/legcord/anda.hcl b/anda/apps/legcord/stable/anda.hcl similarity index 100% rename from anda/apps/legcord/anda.hcl rename to anda/apps/legcord/stable/anda.hcl diff --git a/anda/apps/legcord/stable/launch.sh b/anda/apps/legcord/stable/launch.sh new file mode 100644 index 0000000000..3ce4e0c829 --- /dev/null +++ b/anda/apps/legcord/stable/launch.sh @@ -0,0 +1,13 @@ +#!/bin/sh +electron=/usr/bin/electron + +CONFIG=${XDG_CONFIG_HOME:-~/.config} +FLAGS="$CONFIG/armcord-flags.conf" + +# Allow users to override command-line options +if [ -f "$FLAGS" ]; then + USER_FLAGS="$(cat "$FLAGS")" +fi + +# shellcheck disable=SC2086 # USER_FLAGS has to be unquoted +"$electron" /usr/share/armcord/app.asar $USER_FLAGS "$@" diff --git a/anda/apps/legcord/legcord.spec b/anda/apps/legcord/stable/legcord.spec similarity index 98% rename from anda/apps/legcord/legcord.spec rename to anda/apps/legcord/stable/legcord.spec index 4aac539954..96ff80a8c1 100644 --- a/anda/apps/legcord/legcord.spec +++ b/anda/apps/legcord/stable/legcord.spec @@ -13,6 +13,7 @@ Requires: electron xdg-utils Provides: armcord Obsoletes: armcord < 3.3.2-1 Conflicts: legcord-bin +Conflicts: legcord-nightly BuildArch: noarch BuildRequires: anda-srpm-macros pnpm diff --git a/anda/apps/legcord/stable/update.rhai b/anda/apps/legcord/stable/update.rhai new file mode 100644 index 0000000000..15bcc4981d --- /dev/null +++ b/anda/apps/legcord/stable/update.rhai @@ -0,0 +1 @@ +rpm.version(gh("LegCord/LegCord"));