summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 087e337c6227501f9900330501f5740833908a0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Maintainer: Felix Golatofski <contact@xdfr.de>
# Contributor: Moses Narrow <moe_narrow@use.startmail.com>

projectname=pterodactyl
pkgname=pterodactyl-panel
_pkgname=panel
pkgdesc="Open-source game server management panel"
pkgver=0.7.17
pkgpath="github.com/${projectname}/${_pkgname}"
pkgrel=1
arch=('any')
url="https://${pkgpath}"
license=()
makedepends=()
depends=(mariadb mariadb-clients php php-gd php-fpm redis composer dialog)
source=("${url}/releases/download/v${pkgver}/${_pkgname}.tar.gz"
pterodactyl.conf
pterodactyl-panel.sh)
sha256sums=('b3e37e5cf34b3fbcec73cab8947300dd55f1ba289a83501c76f198dd4e6c3750'
            '9c412eb73baff0ba32cb15e8b86e52b40ec5a3fda5768e6b034b08ccbf2edc75'
            '8ac1252a2357927bd95f5091502907e1b7d6a335b8809e9f49d8dbbce306f244')

build() {
cd ${srcdir}/${_pkgname}-${pkgver}
cp .env.example .env
composer install --no-interaction --no-dev --prefer-dist --optimize-autoloader
cd ${srcdir}
echo -e "# Pterodactyl Queue Worker File
# ----------------------------------
[Unit]
Description=Pterodactyl Queue Worker
After=redis-server.service

[Service]
# On some systems the user and group might be different.
# Some systems use `apache` or `nginx` as the user and group.
User=http
Group=http
Restart=always
ExecStart=/usr/bin/php /var/www/pterodactyl/artisan queue:work --queue=high,standard,low --sleep=3 --tries=3

[Install]
WantedBy=multi-user.target" > ${srcdir}/pteroq.service

cp ${srcdir}/${projectname}.conf ${srcdir}/${_pkgname}-${pkgver}/${projectname}.conf
}

package() {
	#https://pterodactyl.io/daemon/installing.html#installing-daemon-software
	mkdir -p ${pkgdir}/var/www/ #${pkgname}
	mkdir -p ${pkgdir}/usr/lib/systemd/system/
	mkdir -p ${pkgdir}/usr/bin
	cp -r ${srcdir}/${_pkgname}-${pkgver} ${pkgdir}/var/www/${projectname}
	cd ${pkgdir}/var/www/${projectname}
	#tar --strip-components=1 -xzvf ${srcdir}/panel.tar.gz
	chmod -R 755 ${pkgdir}/var/www/${projectname}/storage/* ${pkgdir}/var/www/${projectname}/bootstrap/cache/
	chown -R http:http *
	#cp ${pkgdir}/var/www/${projectname}/.env.example ${pkgdir}/var/www/${projectname}/.env
	install -Dm644 ${srcdir}/pteroq.service ${pkgdir}/usr/lib/systemd/system/
	install -Dm755 ${srcdir}/${pkgname}.sh  ${pkgdir}/var/www/${projectname}/${pkgname}.sh
	ln -rTsf ${pkgdir}/var/www/${projectname}/${pkgname}.sh ${pkgdir}/usr/bin/${pkgname}
}