public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Tony Vroon" <chainsaw@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: games-server/minecraft-server/files/, games-server/minecraft-server/
Date: Wed, 11 Jul 2018 11:17:55 +0000 (UTC)	[thread overview]
Message-ID: <1531307865.98c36709a0e9bfd4e9c61f88b5383a780727a83d.chainsaw@gentoo> (raw)

commit:     98c36709a0e9bfd4e9c61f88b5383a780727a83d
Author:     Conrad Kostecki <conrad <AT> kostecki <DOT> com>
AuthorDate: Wed Jul 11 11:00:18 2018 +0000
Commit:     Tony Vroon <chainsaw <AT> gentoo <DOT> org>
CommitDate: Wed Jul 11 11:17:45 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=98c36709

games-server/minecraft-server: New package

Closes: https://bugs.gentoo.org/652338
Package-Manager: Portage-2.3.41, Repoman-2.3.9

 games-server/minecraft-server/Manifest             |  1 +
 .../minecraft-server/files/minecraft-server.confd  |  7 +++
 .../minecraft-server/files/minecraft-server.initd  | 48 ++++++++++++++++
 games-server/minecraft-server/metadata.xml         | 18 ++++++
 .../minecraft-server-1.12.2.ebuild                 | 67 ++++++++++++++++++++++
 5 files changed, 141 insertions(+)

diff --git a/games-server/minecraft-server/Manifest b/games-server/minecraft-server/Manifest
new file mode 100644
index 00000000000..7c3f0d5cf48
--- /dev/null
+++ b/games-server/minecraft-server/Manifest
@@ -0,0 +1 @@
+DIST minecraft-server-1.12.2.jar 30222121 BLAKE2B 91733822789405dbec5d335fc67e47d3278138929280c4fdcf6053fb0824651474c8e2310c342862fc1aefdf74f55d0a21d78b3c34f32484ec8196b7c5921d72 SHA512 327196bfb833160ae6fb7d12b7d372d031bc0ffbac3455481c1635b01e00f0d5502d4698fbc4f8e7ee59cc3902d56c41261c45d1f1c8f3972e192631f504a0fc

diff --git a/games-server/minecraft-server/files/minecraft-server.confd b/games-server/minecraft-server/files/minecraft-server.confd
new file mode 100644
index 00000000000..700498e5aea
--- /dev/null
+++ b/games-server/minecraft-server/files/minecraft-server.confd
@@ -0,0 +1,7 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# Java options for your started server
+# You should at least define some memory settings (-Xms, -Xmx),
+# for maximum memory, as the java default is far to low for Minecraft
+MINECRAFT_OPTS="-Xms1024m -Xmx1024m"

diff --git a/games-server/minecraft-server/files/minecraft-server.initd b/games-server/minecraft-server/files/minecraft-server.initd
new file mode 100644
index 00000000000..630c88871d7
--- /dev/null
+++ b/games-server/minecraft-server/files/minecraft-server.initd
@@ -0,0 +1,48 @@
+#!/sbin/openrc-run
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+if [ "${SVCNAME}" = "minecraft-server" ]; then
+	instance="main"
+else
+	instance="${SVCNAME#minecraft-server.}"
+fi
+
+java="${JAVA_HOME-/usr}"/bin/java
+minecraft_jar="/usr/share/games/minecraft-server/minecraft-server.jar"
+minecraft_logs="/var/log/minecraft-server"
+minecraft_path="/var/lib/minecraft-server/${instance}"
+name="Minecraft Server (World: ${instance})"
+pidfile="/run/minecraft-server.${instance}.pid"
+screen_name="minecraft-server.${instance}"
+start_stop_daemon_args="--chdir ${minecraft_path}"
+
+command="screen"
+command_args="-DmUS ${screen_name} ${java} ${MINECRAFT_OPTS} -jar ${minecraft_jar}"
+command_background="true"
+command_group="minecraft"
+command_user="minecraft"
+
+depend() {
+	use net
+}
+
+start_pre() {
+	checkpath -d -o "${command_user}:${command_group}" -q "${minecraft_path}"
+
+	checkpath -f -o "${command_user}:${command_group}" -q "${minecraft_path}"/eula.txt
+	echo "eula=true" > "${minecraft_path}"/eula.txt
+
+	checkpath -d -o "${command_user}:${command_group}" -q "${minecraft_logs}"/"${instance}"
+
+	if [ ! -L "${minecraft_path}"/logs ]; then
+		cd "$minecraft_path}" && ln -s ../../../log/minecraft-server/"${instance}" logs
+	fi
+
+	if [ -z ${MINECRAFT_OPTS} ]; then
+		eerror "You must define MINECRAFT_OPTS in /etc/conf.d/minecraft.${SVCNAME}!"
+		return 1
+	fi
+
+	return 0
+}

diff --git a/games-server/minecraft-server/metadata.xml b/games-server/minecraft-server/metadata.xml
new file mode 100644
index 00000000000..45b32f4be81
--- /dev/null
+++ b/games-server/minecraft-server/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer type="person">
+		<email>ck+gentoo@bl4ckb0x.de</email>
+		<name>Conrad Kostecki</name>
+	</maintainer>
+	<maintainer type="project">
+		<email>proxy-maint@gentoo.org</email>
+		<name>Proxy Maintainers</name>
+	</maintainer>
+	<longdescription>
+		Minecraft is a sandbox video game created and designed
+		by Swedish game designer Markus "Notch" Persson,
+		and later fully developed and published by Mojang.
+		This is the headless server for Minecraft.
+	</longdescription>
+</pkgmetadata>

diff --git a/games-server/minecraft-server/minecraft-server-1.12.2.ebuild b/games-server/minecraft-server/minecraft-server-1.12.2.ebuild
new file mode 100644
index 00000000000..5b0f749a455
--- /dev/null
+++ b/games-server/minecraft-server/minecraft-server-1.12.2.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit user
+
+DESCRIPTION="The official server for the sandbox video game Minecraft"
+HOMEPAGE="https://www.minecraft.net/"
+SRC_URI="https://s3.amazonaws.com/Minecraft.Download/versions/${PV}/minecraft_server.${PV}.jar -> ${P}.jar"
+
+LICENSE="Mojang"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+RDEPEND="app-misc/screen
+	virtual/jre"
+
+RESTRICT="bindist mirror strip"
+
+S="${WORKDIR}"
+
+pkg_setup() {
+	enewgroup minecraft
+	enewuser minecraft -1 -1 /var/lib/minecraft-server minecraft
+}
+
+src_unpack() {
+	# Don't unpack that jar, just copy it to WORKDIR
+	cp "${DISTDIR}"/${A} "${WORKDIR}" || die
+}
+
+src_install() {
+	insinto /usr/share/games/minecraft-server
+	insopts -o minecraft -g minecraft
+	newins minecraft-server-${PV}.jar minecraft-server.jar
+
+	newinitd "${FILESDIR}"/minecraft-server.initd minecraft-server
+	newconfd "${FILESDIR}"/minecraft-server.confd minecraft-server
+
+	diropts -o minecraft -g minecraft
+	keepdir /var/lib/minecraft-server
+	keepdir /var/log/minecraft-server
+}
+
+pkg_postinst() {
+	elog "This package provides an init script and a conf file."
+	elog "You don't have to modify those files directly,"
+	elog "but instead you can make a symlink of that init script"
+	elog "and a copy of that conf file."
+	elog "You would do this for every server, you want to setup."
+	elog ""
+	elog "For example, you wan't to setup an world called 'gentoo',"
+	elog "you would do:"
+	elog ""
+	elog "cd /etc/init.d"
+	elog "ln -s minecraft-server minecraft-server.gentoo"
+	elog ""
+	elog "cd /etc/conf.d"
+	elog "cp minecraft-server minecraft-server.gentoo"
+	elog ""
+	elog "After that, make your settings in"
+	elog "/etc/conf.d/minecraft-server.gentoo."
+	elog ""
+	elog "If you don't make a symlink, but use the default scripts,"
+	elog "your world will be called 'main'"
+}


             reply	other threads:[~2018-07-11 11:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-11 11:17 Tony Vroon [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-08-05 21:48 [gentoo-commits] repo/gentoo:master commit in: games-server/minecraft-server/files/, games-server/minecraft-server/ Patrice Clement
2018-09-15 20:12 Michał Górny
2020-02-04 18:09 Conrad Kostecki
2020-08-23 18:14 Conrad Kostecki
2020-11-03  8:21 Conrad Kostecki
2020-11-03  8:21 Conrad Kostecki
2021-12-05 21:45 Conrad Kostecki
2022-01-20 22:58 Conrad Kostecki
2024-04-24 12:51 Conrad Kostecki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1531307865.98c36709a0e9bfd4e9c61f88b5383a780727a83d.chainsaw@gentoo \
    --to=chainsaw@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox