From e8f92098abba22627136657be50471ac8d605abf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20F=C3=B6rster?= Date: Sat, 4 Aug 2012 13:36:00 +0200 Subject: [PATCH] [games-server/craftbukkit] bump to last 1.2.5 release from java-overlay, add the dependencies introduced in R4 --- games-server/craftbukkit/Manifest | 2 + .../craftbukkit/craftbukkit-2262.ebuild | 114 ++++++++++++++++++ games-server/craftbukkit/files/directory.sh | 34 ++++++ 3 files changed, 150 insertions(+) create mode 100644 games-server/craftbukkit/Manifest create mode 100644 games-server/craftbukkit/craftbukkit-2262.ebuild create mode 100644 games-server/craftbukkit/files/directory.sh diff --git a/games-server/craftbukkit/Manifest b/games-server/craftbukkit/Manifest new file mode 100644 index 0000000..2748ef9 --- /dev/null +++ b/games-server/craftbukkit/Manifest @@ -0,0 +1,2 @@ +DIST craftbukkit-2262.tar.gz 373318 SHA256 fc6a18e1011b3a36be6d1dfb4d4b5ff71470241eba886e37c017a2d3f2a45796 SHA512 d34758e100b0af613b1af0bd6188ce2f2c91ced0338c6008043667c69f6c1fef3e07546e7ca847a5b5aa65b94fdc13c334f7dd7f01223031e5e30fb19f5f393f WHIRLPOOL 3792b16e77a3ccd8cafb077ea26ec9c4e2c0c76783dafdc2ba404f0c29f85ac850e05f47b32a70a2f40e698a70935b80987d5c724254c8ef325fdfc0d6371ef5 +DIST minecraft-server-unobfuscated-1.2.5.jar 1603471 SHA256 49ed609d41c2a515cc20cf59da8be0b54d4970c0e5244fbb03430bf543e93c82 SHA512 4fe47932621b974a477dfb21885fb1b13270c9ed88c9f7edf290363530d09000b400920cbe1025b7b429f44d6332e59e830ccaa3783a17075e458cd38c679363 WHIRLPOOL 220a02abefd92a96382e2420c118c337708438e5fd150c166125c52fd5bbf95e2b2804b00faad06385526f4f0257e77c354b6753708a02b98201ec7c471d208e diff --git a/games-server/craftbukkit/craftbukkit-2262.ebuild b/games-server/craftbukkit/craftbukkit-2262.ebuild new file mode 100644 index 0000000..45de3c4 --- /dev/null +++ b/games-server/craftbukkit/craftbukkit-2262.ebuild @@ -0,0 +1,114 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI=2 +COMMIT="d95aee5" +MC_PV="1.2.5" +MC_PN="minecraft-server-unobfuscated" +MC_JAR="${MC_PN}-${MC_PV}.jar" + +inherit games java-pkg-2 java-pkg-simple + +DESCRIPTION="Bukkit implementation for the official Minecraft server" +HOMEPAGE="http://bukkit.org" +SRC_URI="https://github.com/Bukkit/CraftBukkit/tarball/${COMMIT} -> ${P}.tar.gz + http://repo.bukkit.org/content/repositories/releases/org/bukkit/minecraft-server/${MC_PV}/minecraft-server-${MC_PV}.jar -> ${MC_JAR}" +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="ipv6" + +CDEPEND="dev-java/commons-lang:2.1 + dev-java/ebean:0 + dev-java/gson:2 + dev-java/guava:10 + >=dev-java/jline-2.7:0 + dev-java/jopt-simple:0 + >=dev-java/snakeyaml-1.9:0 + >=dev-java/jansi-1.8:0 + ~games-server/bukkit-1500:0" + +DEPEND="${CDEPEND} + >=virtual/jdk-1.6" + +RDEPEND="${CDEPEND} + >=virtual/jre-1.6 + games-server/minecraft-common" + +S="${WORKDIR}/Bukkit-CraftBukkit-${COMMIT}" + +JAVA_GENTOO_CLASSPATH="bukkit commons-lang-2.1 ebean gson-2 guava-10 jansi jline jopt-simple snakeyaml" +JAVA_CLASSPATH_EXTRA="${DISTDIR}/${MC_JAR}" +JAVA_SRC_DIR="src/main/java" + +src_unpack() { + unpack "${P}.tar.gz" + mkdir -p "${S}/target/classes/META-INF" || die + cd "${S}/target/classes" || die + unpack "${MC_JAR}" +} + +java_prepare() { + # Easier to use java-pkg-simple. + rm -v pom.xml || die + + cp "${FILESDIR}"/directory.sh . || die + sed -i "s/@GAMES_USER_DED@/${GAMES_USER_DED}/g" directory.sh || die + + echo "Implementation-Version: Gentoo-${PVR}" > target/classes/META-INF/MANIFEST.MF || die + cp -r src/main/resources/* target/classes || die +} + +src_install() { + local ARGS + use ipv6 || ARGS="-Djava.net.preferIPv4Stack=true" + + java-pkg-simple_src_install + java-pkg_dolauncher "${PN}" -into "${GAMES_PREFIX}" -pre directory.sh \ + --java_args "-Xmx1024M -Xms512M ${ARGS}" --main org.bukkit.craftbukkit.Main + + dosym minecraft-server "/etc/init.d/${PN}" || die + dodoc README.md || die + + prepgamesdirs +} + +pkg_postinst() { + einfo "You may run ${PN} as a regular user or start a system-wide" + einfo "instance using /etc/init.d/${PN}. The multiverse files are" + einfo "stored in ~/.minecraft/servers or /var/lib/minecraft respectively." + echo + einfo "The console for system-wide instances can be accessed by any user in" + einfo "the ${GAMES_GROUP} group using the minecraft-server-console command. This" + einfo "starts a client instance of tmux. The most important key-binding to" + einfo "remember is Ctrl-b d, which will detach the console and return you to" + einfo "your previous screen without stopping the server." + echo + einfo "This package allows you to start multiple CraftBukkit server instances." + einfo "You can do this by adding a multiverse name after ${PN} or by" + einfo "creating a symlink such as /etc/init.d/${PN}.foo. You would" + einfo "then access the console with \"minecraft-server-console foo\". The" + einfo "default multiverse name is \"main\"." + echo + einfo "Some Bukkit plugins store information in a database. Regardless of" + einfo "whether they handle their own database connectivity or use Bukkit's" + einfo "own Ebean solution, you can install your preferred JDBC driver through" + einfo "Portage. The available drivers are..." + einfo "" + einfo " # dev-java/h2" + einfo " # dev-java/sqlite-jdbc" + einfo " # dev-java/jdbc-mysql" + einfo " # dev-java/jdbc-postgresql" + echo + + if has_version games-server/minecraft-server; then + ewarn "You already have the official server installed. You may run both this" + ewarn "and CraftBukkit against the same multiverse but not simultaneously." + ewarn "This is not recommended though so don't come crying to us if it" + ewarn "trashes your world." + echo + fi + + games_pkg_postinst +} diff --git a/games-server/craftbukkit/files/directory.sh b/games-server/craftbukkit/files/directory.sh new file mode 100644 index 0000000..a1ceea9 --- /dev/null +++ b/games-server/craftbukkit/files/directory.sh @@ -0,0 +1,34 @@ + +if [[ -z "$1" ]] || [[ "${1:0:1}" == "-" ]]; then + NAME="main" + echo "Multiverse name not specified. Defaulting to \"${NAME}\"." >&2 +else + NAME="$1" + echo "Using multiverse name \"${NAME}\"." >&2 + shift +fi + +if [[ "$(whoami)" == "@GAMES_USER_DED@" ]]; then + gjl_pwd="/var/lib/minecraft/${NAME}" +else + gjl_pwd="${HOME}/.minecraft/servers/${NAME}" +fi + +echo "Multiverse directory is ${gjl_pwd}." >&2 +mkdir -p "${gjl_pwd}"/{lib,plugins/update} + +if [[ "$(whoami)" == "@GAMES_USER_DED@" ]]; then + chmod g+ws "${gjl_pwd}"/{lib,plugins,plugins/update} +fi + +for LIB in "h2" "mysql jdbc-mysql" "sqlite sqlite-jdbc" "postgresql jdbc-postgresql"; do + SRC="/usr/share/${LIB#* }/lib/${LIB#* }.jar" + DEST="${gjl_pwd}/lib/${LIB% *}.jar" + + if [[ -f "${SRC}" ]]; then + ln -snf "${SRC}" "${DEST}" + elif [[ ! -f "${DEST}" ]]; then + rm -f "${DEST}" + fi +done +