diff options
author | Ross Charles Campbell <rossbridger.cc@gmail.com> | 2020-10-26 11:51:15 +0800 |
---|---|---|
committer | Conrad Kostecki <conikost@gentoo.org> | 2020-11-03 09:20:56 +0100 |
commit | e3af652a6121b5d82043b51532a183a39e4782ce (patch) | |
tree | a1c161e8094e695b44cefae2f4eab670c799886e /games-server | |
parent | net-im/transwhat: drop old version (diff) | |
download | gentoo-e3af652a6121b5d82043b51532a183a39e4782ce.tar.gz gentoo-e3af652a6121b5d82043b51532a183a39e4782ce.tar.bz2 gentoo-e3af652a6121b5d82043b51532a183a39e4782ce.zip |
games-server/minecraft-server: Add systemd unit, add ~arm64 keyword
Tested fine on Pi4
Closes: https://github.com/gentoo/gentoo/pull/18038
Package-Manager: Portage-3.0.8, Repoman-3.0.2
Signed-off-by: Ross Charles Campbell <rossbridger.cc@gmail.com>
Signed-off-by: Conrad Kostecki <conikost@gentoo.org>
Diffstat (limited to 'games-server')
-rw-r--r-- | games-server/minecraft-server/files/minecraft-server.service | 16 | ||||
-rw-r--r-- | games-server/minecraft-server/minecraft-server-1.16.3-r1.ebuild | 54 |
2 files changed, 70 insertions, 0 deletions
diff --git a/games-server/minecraft-server/files/minecraft-server.service b/games-server/minecraft-server/files/minecraft-server.service new file mode 100644 index 000000000000..ad9167e5b1c9 --- /dev/null +++ b/games-server/minecraft-server/files/minecraft-server.service @@ -0,0 +1,16 @@ +[Unit] +Description=Minecraft Server (World: %I) +After=network.target + +[Service] +User=minecraft +Group=minecraft +WorkingDirectory=-/var/lib/minecraft-server/%I +PIDFile=/run/minecraft-server.%I.pid +ExecStartPre=!/bin/mkdir -p /var/lib/minecraft-server/%I +ExecStartPre=!/bin/chown -R minecraft:minecraft /var/lib/minecraft-server/%I +ExecStartPre=/bin/sh -c 'echo "eula=true" > /var/lib/minecraft-server/%I/eula.txt' +ExecStart=/bin/sh -c '/usr/bin/dtach -N $(mktemp -u) /usr/bin/minecraft-server' + +[Install] +WantedBy=multi-user.target diff --git a/games-server/minecraft-server/minecraft-server-1.16.3-r1.ebuild b/games-server/minecraft-server/minecraft-server-1.16.3-r1.ebuild new file mode 100644 index 000000000000..59b209b82637 --- /dev/null +++ b/games-server/minecraft-server/minecraft-server-1.16.3-r1.ebuild @@ -0,0 +1,54 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +EGIT_COMMIT="f02f4473dbf152c23d7d484952121db0b36698cb" +README_GENTOO_SUFFIX="-r1" + +inherit readme.gentoo-r1 java-pkg-2 systemd + +DESCRIPTION="The official server for the sandbox video game" +HOMEPAGE="https://www.minecraft.net/" +SRC_URI="https://launcher.mojang.com/v1/objects/${EGIT_COMMIT}/server.jar -> ${P}.jar" + +LICENSE="Mojang" +SLOT="0" +KEYWORDS="~amd64 ~arm64 ~x86" + +RDEPEND=" + acct-group/minecraft + acct-user/minecraft + app-misc/dtach + || ( + >=virtual/jre-1.8 + >=virtual/jdk-1.8 + ) +" + +RESTRICT="bindist mirror" + +S="${WORKDIR}" + +src_unpack() { + cp "${DISTDIR}/${A}" "${WORKDIR}" || die +} + +src_compile() { + :; +} + +src_install() { + java-pkg_newjar minecraft-server-${PV}.jar minecraft-server.jar + java-pkg_dolauncher minecraft-server --jar minecraft-server.jar --java_args "\${JAVA_OPTS}" + + newinitd "${FILESDIR}"/minecraft-server.initd-r4 minecraft-server + newconfd "${FILESDIR}"/minecraft-server.confd-r1 minecraft-server + systemd_newunit "${FILESDIR}"/minecraft-server.service minecraft-server@.service + + readme.gentoo_create_doc +} + +pkg_postinst() { + readme.gentoo_print_elog +} |