diff options
author | EndlessEden | 2021-09-15 18:36:22 +1000 |
---|---|---|
committer | EndlessEden | 2021-09-15 18:36:22 +1000 |
commit | 4cbf52cdca22afb91a5b876c5ddd5dcd70714377 (patch) | |
tree | 0b599aeb7ad4bf730d8d8f904e90422e57b1d038 | |
download | aur-4cbf52cdca22afb91a5b876c5ddd5dcd70714377.tar.gz |
WIP: Should start using system req's instead of upstream. Had to use some funky work to get python virtual enviorments/setup init working.
-rw-r--r-- | .SRCINFO | 38 | ||||
-rw-r--r-- | PKGBUILD | 36 | ||||
-rw-r--r-- | craftycontroller.install | 29 | ||||
-rw-r--r-- | craftycontroller.service | 16 | ||||
-rwxr-xr-x | start.sh | 7 |
5 files changed, 126 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..7edad6e6135e --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,38 @@ +pkgbase = craftycontroller-git + pkgdesc = Crafty is a Minecraft Server Wrapper / Controller / Launcher. + pkgver = 3.3.0.r9.gc63984a + pkgrel = 1 + url = https://craftycontrol.com/ + arch = x86_64 + license = GPL + makedepends = git + depends = python + depends = python-pip + depends = java-runtime=8 + depends = python-argon2_cffi + depends = python-bleach + depends = python-colorama + depends = python-peewee + depends = python-pexpect + depends = python-psutil + depends = python-pyftpdlib + depends = python-pyopenssl + depends = python-pyaml + depends = python-requests + depends = python-schedule + depends = python-termcolor + depends = python-tornado + depends = python-pipenv + provides = craftycontroller-git + provides = craftycontroller + conflicts = craftycontroller + source = craftycontroller::git+https://gitlab.com/crafty-controller/crafty-web.git + source = craftycontroller.install + source = craftycontroller.service + source = start.sh + md5sums = SKIP + md5sums = b3f6d60e6c7e480c94128105b56530c2 + md5sums = 2e7d24f5d2982fc6f7ac224378cf2f02 + md5sums = 0b6cd32e5c31ed3bb576f5ad652c0db6 + +pkgname = craftycontroller-git diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..3bd7678bbf9e --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,36 @@ +# Maintainer: EndlessEden <eden [at] rose.place> +pkgname=craftycontroller-git +_pkgname=craftycontroller +pkgver=3.3.0.r9.gc63984a +pkgrel=1 +pkgdesc="Crafty is a Minecraft Server Wrapper / Controller / Launcher." +arch=('x86_64') +url="https://craftycontrol.com/" +license=('GPL') +depends=('python' 'python-pip' 'java-runtime=8' 'python-argon2_cffi' 'python-bleach' 'python-colorama' 'python-peewee' 'python-pexpect' 'python-psutil' 'python-pyftpdlib' 'python-pyopenssl' 'python-pyaml' 'python-requests' 'python-schedule' 'python-termcolor' 'python-tornado' 'python-pipenv') +makedepends=('git') +provides=("$pkgname" "$_pkgname") +conflicts=("$_pkgname") +source=("$_pkgname"::"git+https://gitlab.com/crafty-controller/crafty-web.git" +"$_pkgname.install" +"$_pkgname.service" +"start.sh") +md5sums=('SKIP' +'b3f6d60e6c7e480c94128105b56530c2' +'2e7d24f5d2982fc6f7ac224378cf2f02' +'0b6cd32e5c31ed3bb576f5ad652c0db6') + +pkgver() { + cd "$srcdir"/"$_pkgname" + git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' +} + + +package() { + cd "$srcdir"/"$_pkgname" + mkdir -p "$pkgdir"/opt/craftycontroller/ + cp -r * "$pkgdir"/opt/craftycontroller/ + mkdir -p "$pkgdir"/etc/systemd/system/ + cp "$srcdir"/"$_pkgname.service" "$pkgdir"/etc/systemd/system/ + install -m774 -o crafty "$srcdir"/"start.sh" "$pkgdir"/opt/craftycontroller/ +} diff --git a/craftycontroller.install b/craftycontroller.install new file mode 100644 index 000000000000..0154b68b95d7 --- /dev/null +++ b/craftycontroller.install @@ -0,0 +1,29 @@ +post_install() { + echo "Creating user for Crafty Controller..." + useradd crafty -M -r -s /bin/bash -b /opt/craftycontroller + echo "Setting Permissions..." + chown -R /opt/craftycontroller crafty:crafty + echo "Creating the Python Virtual Enviorment..." + python3 -m venv craftycontroller + echo "Warning: About to run first-time Launch!" + echo + echo "Prepare for prompt, for first-time configuration!" + echo "Crafty Controller/Crafty Web, is located at: /opt/craftycontroller" + echo + echo "Starting..." + echo "3..." + echo "2.. + echo "1." + sudo -u crafty ./opt/craftycontroller/start.sh && success=1 & exit 0 + if [ ! -z $success ]; then + success=0 + fi + if [ "$success" == "0" ]; then + echo "Initialisation failed; Please run /opt/craftycontroller/start.sh as 'crafty' user." + fi +} + +post_remove() { + echo "Removing Crafty User" + userdel crafty +} diff --git a/craftycontroller.service b/craftycontroller.service new file mode 100644 index 000000000000..93b402defb89 --- /dev/null +++ b/craftycontroller.service @@ -0,0 +1,16 @@ +[Unit] +Description=Crafty Controller +After=network.target +StartLimitIntervalSec=0 + +[Service] +Type=simple +Restart=on-failure +RestartSec=3 +User=crafty +WorkingDirectory=/opt/craftycontroller/ +ExecStart="/opt/craftycontroller/start.sh" + +[Install] +WantedBy=multi-user.target + diff --git a/start.sh b/start.sh new file mode 100755 index 000000000000..cd873599795f --- /dev/null +++ b/start.sh @@ -0,0 +1,7 @@ +#!/bin/bash +if [ ! "$PWD" == "/opt/craftycontroller" ]; then + cd /opt/craftycontroller +fi + +source venv/bin/activate +python3 crafty.py |