diff options
author | Albin Kauffmann | 2020-04-08 11:27:36 +0200 |
---|---|---|
committer | Albin Kauffmann | 2020-04-08 11:28:24 +0200 |
commit | bbaa62166dc538864c4f0cd7955e04b7634f57e9 (patch) | |
tree | 2065610834d3d74b1ef0e9dc8d9e4319b54f3142 | |
download | aur-bbaa62166dc538864c4f0cd7955e04b7634f57e9.tar.gz |
First version of the package (Blacknut version 2.7.5)
The package installs:
* the Blacknut appimage under /opt/appimages
* a blacknut script under /usr/bin
* a firejail profile used by the blacknut script if firejail is
installed
-rw-r--r-- | .SRCINFO | 22 | ||||
-rw-r--r-- | PKGBUILD | 55 | ||||
-rw-r--r-- | blacknut | 83 | ||||
-rw-r--r-- | blacknut-firejail.profile | 41 |
4 files changed, 201 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..3f45f6d9ff29 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,22 @@ +pkgbase = blacknut-appimage + pkgdesc = Cloud gaming client (binary AppImage) + pkgver = 2.7.5 + pkgrel = 1 + url = https://www.blacknut.com + arch = x86_64 + license = unknown + makedepends = p7zip + depends = fuse + optdepends = pulseaudio-alsa: play sound using pulseaudio + optdepends = firejail: run Blacknut within a jail + conflicts = blacknut + options = !strip + source = https://releases.blacknut.com/player/Blacknut-2.7.5.AppImage + source = blacknut + source = blacknut-firejail.profile + sha256sums = 51f16d26c2fabbf16b260b1d19c007b0081c2ec7c30abec0d15304ff808b09f5 + sha256sums = d73363ace8aa06addc4882e22fe0f7166b86e250e092be18339fa5c0d89d5123 + sha256sums = 0ee0415a3aa51916286ae22a319cac74569d5a63011f2f110e63937fe6e0260d + +pkgname = blacknut-appimage + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..e13cd473828c --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,55 @@ +# Maintainer: Albin Kauffmann <albinou@kauff.org> + +pkgname=blacknut-appimage +pkgver=2.7.5 +pkgrel=1 +pkgdesc="Cloud gaming client (binary AppImage)" +arch=('x86_64') +url="https://www.blacknut.com" +license=('unknown') +depends=('fuse') +makedepends=('p7zip') +optdepends=('pulseaudio-alsa: play sound using pulseaudio' + 'firejail: run Blacknut within a jail') +conflicts=('blacknut') +options=('!strip') +install= +changelog= +_appimage="Blacknut-${pkgver}.AppImage" +source=("https://releases.blacknut.com/player/${_appimage}" + "blacknut" + "blacknut-firejail.profile") +sha256sums=('51f16d26c2fabbf16b260b1d19c007b0081c2ec7c30abec0d15304ff808b09f5' + 'd73363ace8aa06addc4882e22fe0f7166b86e250e092be18339fa5c0d89d5123' + '0ee0415a3aa51916286ae22a319cac74569d5a63011f2f110e63937fe6e0260d') + +prepare() { + cd "$srcdir" + 7z x "$_appimage" blacknut.desktop usr/share/icons/hicolor +} + +build() { + cd "$srcdir" + sed -i "s/^Exec=AppRun$/Exec=blacknut/" blacknut.desktop + sed -i "s/BLACKNUT_VERSION=\"x.y.z\"/BLACKNUT_VERSION=\"${pkgver}\"/" blacknut +} + +package() { + cd "$srcdir" + + install -d -m755 $pkgdir/usr/share/{applications,icons/hicolor} + install -d -m755 $pkgdir/opt/appimages + # TODO find a decent license + #install -d -m755 $pkgdir/usr/share/licenses/$pkgname + + hicolor="usr/share/icons/hicolor" + for size in $(ls -1 $hicolor); do + install -d -m755 $pkgdir/usr/share/icons/hicolor/$size/apps + install -D -m644 $hicolor/$size/apps/blacknut.png $pkgdir/usr/share/icons/hicolor/$size/apps/blacknut.png + done + + install -D -m644 blacknut.desktop $pkgdir/usr/share/applications/blacknut.desktop + install -D -m755 blacknut $pkgdir/usr/bin/blacknut + install -D -m755 $_appimage $pkgdir/opt/appimages/$_appimage + install -D -m644 blacknut-firejail.profile $pkgdir/opt/appimages/blacknut-firejail.profile +} diff --git a/blacknut b/blacknut new file mode 100644 index 000000000000..b77dae9faee1 --- /dev/null +++ b/blacknut @@ -0,0 +1,83 @@ +#!/usr/bin/env bash + +set -o errexit -o errtrace -o pipefail -o nounset +declare -r SCRIPT_PATH="$0" +declare -r SCRIPT_NAME="blacknut" +declare -r BLACKNUT_VERSION="x.y.z" +declare -r INSTALL_PATH="/opt/appimages" +declare -r FIREJAIL_PROFILE="${INSTALL_PATH}/blacknut-firejail.profile" +declare -r APPIMAGE_PATH="${INSTALL_PATH}/Blacknut-${BLACKNUT_VERSION}.AppImage" + +usage() { + echo -n "\ +usage: ${SCRIPT_PATH} [<options>] [AppImage arguments ...] + + Options: + --disable-firejail run ${SCRIPT_NAME} without firejail + --force-firejail force the use of firejail + -h, --help display this message + +" +} + +die() { + local -r msg="$1" + + echo "${SCRIPT_PATH}: [ERROR] $msg" >& 2 + exit 1 +} + +main() { + local -i opt_disable=0 + local -i opt_force=0 + local TEMP + + TEMP=$(getopt --options "h" \ + --longoptions "disable-firejail,force-firejail,help" -- "$@") + readonly TEMP + eval set -- "$TEMP" + + while true; do + case "$1" in + --disable-firejail) + opt_disable=1 + ;; + --force-firejail) + opt_force=1 + ;; + -h|--help) + usage + exit 0 + ;; + --) + shift + break + ;; + *) + die "Should not happen" + ;; + esac + shift + done + + if [ "$opt_disable" -eq 1 ] && [ "$opt_force" -eq 1 ]; then + die "--disable-firejail and --force-firejail options cannot be used together" + fi + + if [ $opt_disable -eq 0 ] && command -v firejail >& /dev/null; then + local -ri use_firejail=1 + else + local -ri use_firejail=0 + fi + if [ "$opt_force" -eq 1 ] && [ "$use_firejail" -eq 0 ]; then + die "firejail is not installed" + fi + + if [ "$use_firejail" -eq 0 ]; then + "$APPIMAGE_PATH" "$@" + else + firejail --profile="$FIREJAIL_PROFILE" --appimage "$APPIMAGE_PATH" --no-sandbox "$@" + fi +} + +main "$@" diff --git a/blacknut-firejail.profile b/blacknut-firejail.profile new file mode 100644 index 000000000000..5d60e05502e2 --- /dev/null +++ b/blacknut-firejail.profile @@ -0,0 +1,41 @@ +include disable-common.inc +include disable-devel.inc +include disable-exec.inc +include disable-interpreters.inc +include disable-programs.inc + +apparmor +caps.drop all + +nodbus +nodvd +nogroups +nonewprivs + +noroot +notv +nou2f +novideo + +protocol unix,inet,inet6 +seccomp + +shell none + +disable-mnt +private-dev +private-tmp +private-cache +private-etc alsa,alternatives,asound.conf,ca-certificates,fonts,group,localtime,passwd,pulse,resolv.conf + +# Can be used for keeping Blacknut logs (you need to comment private-tmp first) +#whitelist /tmp/.X11-unix +#mkdir /tmp/blacknut +#whitelist /tmp/blacknut + +# Allow Blacknut to save its configuration +mkdir ${HOME}/.config/Blacknut +whitelist ${HOME}/.config/Blacknut + +# Allow access to Pulseaudio configuration +whitelist ${HOME}/.config/pulse |