blob: 8f0e9231c4e3f4f46d357f28b58621b1f2dd485e (
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
63
64
65
66
|
# Maintainer: Gordian Edenhofer <gordian.edenhofer@gmail.com>
pkgname=papermc
# curl -X GET "https://papermc.io/api/v2/projects/paper" -H "accept: application/json"
_pkgver=1.21.1
# curl -X GET "https://papermc.io/api/v2/projects/paper/versions/${_pkgver}" -H "accept: application/json"
_build=12
_license_commit=54a2340
pkgver="${_pkgver}+b${_build}"
pkgrel=2
_mng_ver=1.0.4
pkgdesc="Next generation of Minecraft server, compatible with Spigot plugins and offering uncompromising performance"
arch=('any')
url="https://papermc.io/"
license=('custom')
depends=('java-runtime-headless>=16' 'tmux' 'sudo' 'bash' 'awk' 'sed')
optdepends=("tar: needed in order to create world backups"
"netcat: required in order to suspend an idle server")
conflicts=('papermc-git')
backup=('etc/conf.d/papermc')
install="${pkgname}.install"
source=("papermc.${pkgver}.jar"::"https://papermc.io/api/v2/projects/paper/versions/${_pkgver}/builds/${_build}/downloads/paper-${_pkgver}-${_build}.jar"
"LICENSE_${pkgver}.md"::"https://raw.githubusercontent.com/PaperMC/Paper/${_license_commit}/LICENSE.md"
"minecraft-server-${_mng_ver}.tar.gz"::"https://github.com/Edenhofer/minecraft-server/archive/refs/tags/v${_mng_ver}.tar.gz")
noextract=("papermc.${pkgver}.jar")
sha512sums=('b6163b6aa13eaf9b46d0f9c4c59079560f4d8edb98a2429005750191c6094ecd1ec803bf31e9c4b131bada258885daa006998cb524ef24c4366cae856e91cf14'
'5a0621414323f85d8e583f61827e733f5abb6b77ed6d850a7b10ecd831c9a88f22a8705e06d4adfb30ee314228647fd87dd655eb53eb321432d6324944c15e2a'
'dd4d68ca061c97a1e3cb5c0bb68439f7d8d45b15092344f3c4dbd4f7f39fef433d566670ad440970061007d93055183b570c7bf98f09c111ecdf8ab0f208f556')
_game="papermc"
_server_root="/srv/papermc"
build() {
make -C "${srcdir}/minecraft-server-${_mng_ver}" clean
make -C "${srcdir}/minecraft-server-${_mng_ver}" \
GAME=${_game} \
INAME=${_game} \
SERVER_ROOT=${_server_root} \
BACKUP_PATHS="world" \
GAME_USER=${_game} \
MAIN_EXECUTABLE=papermc_server.jar \
SERVER_START_CMD="java -Xms512M -Xmx1024M -jar ./papermc_server.jar nogui" \
all
}
package() {
make -C "${srcdir}/minecraft-server-${_mng_ver}" \
DESTDIR="${pkgdir}" \
GAME=${_game} \
INAME=${_game} \
install
install -Dm644 ${_game}.${pkgver}.jar "${pkgdir}/${_server_root}/${_game}.${pkgver}.jar"
ln -s "${_game}.${pkgver}.jar" "${pkgdir}${_server_root}/${_game}_server.jar"
# Link the log files
mkdir -p "${pkgdir}/var/log/"
install -dm2755 "${pkgdir}/${_server_root}/logs"
ln -s "${_server_root}/logs" "${pkgdir}/var/log/${_game}"
# Give the group write permissions and set user or group ID on execution
chmod g+s "${pkgdir}${_server_root}"
install -D ./LICENSE_${pkgver}.md "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
|