diff options
author | Dāvis | 2020-08-21 06:44:42 +0300 |
---|---|---|
committer | Dāvis | 2020-08-21 06:44:42 +0300 |
commit | da8d331a801e2ed3afb6328326f764616387e37e (patch) | |
tree | 2b4e89016df0d6a04b2ddd6c25dfe3547b439eb1 | |
download | aur-da8d331a801e2ed3afb6328326f764616387e37e.tar.gz |
Release
-rw-r--r-- | .SRCINFO | 20 | ||||
-rw-r--r-- | .gitignore | 5 | ||||
-rw-r--r-- | PKGBUILD | 44 | ||||
-rw-r--r-- | README.md | 13 | ||||
-rw-r--r-- | UNLICENSE | 24 | ||||
-rwxr-xr-x | epicgames-freebies-claimer | 13 | ||||
-rw-r--r-- | epicgames-freebies-claimer.service | 15 |
7 files changed, 134 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..dda982068264 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,20 @@ +pkgbase = epicgames-freebies-claimer + pkgdesc = Automatically claim free game promotions from the Epic Game Store. + pkgver = V1.4.1 + pkgrel = 1 + url = https://github.com/Revadike/epicgames-freebies-claimer + arch = any + license = MIT + makedepends = npm + makedepends = sed + makedepends = curl + makedepends = jq + depends = nodejs + depends = sh + source = epicgames-freebies-claimer + source = epicgames-freebies-claimer.service + sha256sums = ef1f2943deb5776fa3fa44b850c202373b222b8232c02832f102c80f693d0630 + sha256sums = 26001be311424a616f2c4ca35de68d5427d918b4849857e36dba0eeb88ac6a22 + +pkgname = epicgames-freebies-claimer + diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..f9b191a67a9b --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +/pkg/ +/src/ +/*.tar* +/*.zip + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..b97203462106 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,44 @@ +# Maintainer: Dāvis Mosāns <davispuh at gmail dot com> + +pkgname=epicgames-freebies-claimer +pkgver=V1.4.1 +pkgrel=1 +pkgdesc="Automatically claim free game promotions from the Epic Game Store." +arch=("any") +url="https://github.com/Revadike/epicgames-freebies-claimer" +license=("MIT") +depends=("nodejs" "sh") +makedepends=("npm" "sed" "curl" "jq") +source=("epicgames-freebies-claimer" "epicgames-freebies-claimer.service") +sha256sums=("ef1f2943deb5776fa3fa44b850c202373b222b8232c02832f102c80f693d0630" + "26001be311424a616f2c4ca35de68d5427d918b4849857e36dba0eeb88ac6a22") + +pkgver() { + curl -s https://api.github.com/repos/Revadike/epicgames-freebies-claimer/releases/latest | jq -r '.tag_name' +} + +prepare() { + tarballUrl=$(curl -s https://api.github.com/repos/Revadike/epicgames-freebies-claimer/releases/latest | jq -r '.tarball_url') + curl -L "$tarballUrl" > "$srcdir/tarball.tar.gz" +} + +package() { + npm install -g --user root --cache "$srcdir/npm-cache" --prefix "$pkgdir/usr" "$srcdir/tarball.tar.gz" + + # Non-deterministic race in npm gives 777 permissions to random directories. + # See https://github.com/npm/npm/issues/9359 for details. + find "$pkgdir/usr" -type d -exec chmod 755 {} + + + find "$pkgdir" -name package.json -print0 | xargs -r0 sed -i "s|$pkgdir||" + find "$pkgdir" -name package.json -print0 | xargs -r0 sed -i "s|$srcdir|/usr/lib/node_modules/epicgames-freebies-claimer|" + + sed -i "s|require(\`\${__dirname}/config.json\`)|require(\`\${process.env.HOME}/.config/epicgames/config.json\`)|" "$pkgdir/usr/lib/node_modules/epicgames-freebies-claimer/claimer.js" + + install -Dm755 "$srcdir/epicgames-freebies-claimer" -t "$pkgdir/usr/bin/" + + entry=$(cat "$pkgdir/usr/lib/node_modules/epicgames-freebies-claimer/package.json" | jq ".main") + sed -i "s|entry=.*|entry=$entry|" "$pkgdir/usr/bin/epicgames-freebies-claimer" + + install -Dm644 "$srcdir/epicgames-freebies-claimer.service" -t "$pkgdir/usr/lib/systemd/user/" +} + diff --git a/README.md b/README.md new file mode 100644 index 000000000000..8e0dcc2db28a --- /dev/null +++ b/README.md @@ -0,0 +1,13 @@ +# EpicGames Freebies Claimer + +See https://github.com/Revadike/epicgames-freebies-claimer + +Config is in `~/.config/epicgames/config.json` +Cookies saved in `~/.cache/.egstore/` + +Manually start with `epicgames-freebies-claimer` +To automatically start +``` +$ systemctl --user enable epicgames-freebies-claimer +``` + diff --git a/UNLICENSE b/UNLICENSE new file mode 100644 index 000000000000..68a49daad8ff --- /dev/null +++ b/UNLICENSE @@ -0,0 +1,24 @@ +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to <http://unlicense.org/> diff --git a/epicgames-freebies-claimer b/epicgames-freebies-claimer new file mode 100755 index 000000000000..f8679d25a918 --- /dev/null +++ b/epicgames-freebies-claimer @@ -0,0 +1,13 @@ +#!/usr/bin/env sh + +mkdir -p ~/".cache/.egstore" +cd ~/".cache" + +mkdir -p ~/".config/epicgames" + +[ ! -e ~/".config/epicgames/config.json" ] && cp "/usr/lib/node_modules/epicgames-freebies-claimer/config.json" ~/".config/epicgames/" + +entry= + +node "/usr/lib/node_modules/epicgames-freebies-claimer/$entry" "$@" + diff --git a/epicgames-freebies-claimer.service b/epicgames-freebies-claimer.service new file mode 100644 index 000000000000..8ece1aa8f8f3 --- /dev/null +++ b/epicgames-freebies-claimer.service @@ -0,0 +1,15 @@ +[Unit] +Description=Automatically claim free game promotions from the Epic Game Store +After=network.target + +StartLimitIntervalSec=200 +StartLimitBurst=3 + +[Service] +ExecStart=/usr/bin/epicgames-freebies-claimer +Restart=on-failure +RestartSec=60 + +[Install] +WantedBy=default.target + |