aboutsummaryrefslogtreecommitdiff
path: root/games/minecraft-server
diff options
context:
space:
mode:
authorJohn Marino <marino@FreeBSD.org>2014-10-10 12:58:03 +0000
committerJohn Marino <marino@FreeBSD.org>2014-10-10 12:58:03 +0000
commit27962c34b8e51511188a7bd85c77bc198939c541 (patch)
treed9e216b7f03558876b5879dca9062f7567e7eca9 /games/minecraft-server
parent2927522986b4e81d89fb5696b4b97cccb76690c6 (diff)
downloadports-27962c34b8e51511188a7bd85c77bc198939c541.tar.gz
ports-27962c34b8e51511188a7bd85c77bc198939c541.zip
Notes
Diffstat (limited to 'games/minecraft-server')
-rw-r--r--games/minecraft-server/Makefile91
-rw-r--r--games/minecraft-server/distinfo6
-rw-r--r--games/minecraft-server/files/banned-ips.txt.sample1
-rw-r--r--games/minecraft-server/files/banned-players.txt.sample1
-rw-r--r--games/minecraft-server/files/minecraft-server9
-rw-r--r--games/minecraft-server/files/minecraft.in120
-rw-r--r--games/minecraft-server/files/ops.txt.sample1
-rw-r--r--games/minecraft-server/files/pkg-deinstall.in20
-rw-r--r--games/minecraft-server/files/pkg-message.in52
-rw-r--r--games/minecraft-server/files/server.properties.sample24
-rw-r--r--games/minecraft-server/files/white-list.txt.sample1
-rw-r--r--games/minecraft-server/pkg-descr3
-rw-r--r--games/minecraft-server/pkg-plist31
13 files changed, 74 insertions, 286 deletions
diff --git a/games/minecraft-server/Makefile b/games/minecraft-server/Makefile
index 8c15c2a61263..cbf5412dcf90 100644
--- a/games/minecraft-server/Makefile
+++ b/games/minecraft-server/Makefile
@@ -1,85 +1,46 @@
-# Created by: Martin Kropfinger
# $FreeBSD$
PORTNAME= minecraft-server
-PORTVERSION= 1.4.7
-PORTREVISION= 1
+PORTVERSION= 1.8
CATEGORIES= games java
-MASTER_SITES= http://assets.minecraft.net/${PORTVERSION:S|.|_|g}/ \
- http://media-mcw.cursecdn.com/f/f7/:icon
-DISTNAME= minecraft_server
-DISTFILES= minecraft_server.jar \
- Bookshelf.png:icon
-DIST_SUBDIR= ${PORTNAME}/${PORTVERSION}
-EXTRACT_ONLY= #empty
+MASTER_SITES= https://s3.amazonaws.com/Minecraft.Download/versions/${PORTVERSION}/
+DISTNAME= minecraft_server.${PORTVERSION}.jar
+EXTRACT_SUFX=
+EXTRACT_ONLY=
-MAINTAINER= ports@FreeBSD.org
-COMMENT= Server for the block building game
+MAINTAINER= freebsd@jonathanprice.org
+COMMENT= Dedicated server for the game Minecraft
-RUN_DEPENDS= tmux:${PORTSDIR}/sysutils/tmux
+ETCDIR= ${PREFIX}/etc/minecraft-server
-OPTIONS_DEFINE= X11
-OPTIONS_DEFAULT=X11
+USERS= mcserver
+GROUPS= ${USERS}
-ETCDIR= ${PREFIX}/etc/minecraft
-
-WRKSRC= ${WRKDIR}
NO_BUILD= yes
USE_JAVA= yes
-USERS?= mcserver
-GROUPS?= ${USERS}
-USE_RC_SUBR= minecraft
-SUB_FILES= pkg-deinstall \
- pkg-message
-
-SUB_LIST+= USERS=${USERS} \
- GROUPS=${GROUPS}
+SUB_FILES= pkg-message \
+ pkg-deinstall
-CONFIG_FILES= banned-ips.txt \
- banned-players.txt \
- ops.txt \
+CONFIG_FILES= banned-ips.json \
+ banned-players.json \
+ ops.json \
server.properties \
- white-list.txt
-
-.include <bsd.port.options.mk>
-
-.if ${PORT_OPTIONS:MX11}
-DESKTOP_ENTRIES="Minecraft-Server" \
- "Block building game (server)" \
- "${PREFIX}/share/pixmaps/minecraft-server.png" \
- "${PORTNAME}" \
- "Game;Java;" \
- false
-.endif
-
-.if ${PORT_OPTIONS:MX11}
-PLIST_SUB+= X11=""
-.else
-PLIST_SUB+= X11="@comment "
-.endif
+ usercache.json \
+ whitelist.json
do-install:
${MKDIR} ${STAGEDIR}${DATADIR}
- ${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/minecraft_server.jar ${STAGEDIR}${DATADIR}/
-.if ${PORT_OPTIONS:MX11}
- ${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/Bookshelf.png ${STAGEDIR}${PREFIX}/share/pixmaps/minecraft-server.png
-.endif
- echo "#!/bin/sh" > ${WRKDIR}/${PORTNAME}
- echo "if ! test -d ~/.minecraft-server ; then" >> ${WRKDIR}/${PORTNAME}
- echo " mkdir ~/.minecraft-server" >> ${WRKDIR}/${PORTNAME}
- echo "fi" >> ${WRKDIR}/${PORTNAME}
- echo "cd ~/.minecraft-server" >> ${WRKDIR}/${PORTNAME}
- ${CP} ${WRKDIR}/${PORTNAME} ${WRKDIR}/${PORTNAME}-nogui
- echo "java -Xmx1024M -Xms1024M -jar ${DATADIR}/minecraft_server.jar" >> ${WRKDIR}/${PORTNAME}
- echo "java -Xmx1024M -Xms1024M -jar ${DATADIR}/minecraft_server.jar nogui" >> ${WRKDIR}/${PORTNAME}-nogui
-.if ${PORT_OPTIONS:MX11}
- ${INSTALL_SCRIPT} ${WRKDIR}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin/
-.endif
- ${INSTALL_SCRIPT} ${WRKDIR}/${PORTNAME}-nogui ${STAGEDIR}${PREFIX}/bin/
+ ${INSTALL_DATA} ${DISTDIR}/${DISTNAME} ${STAGEDIR}${DATADIR}
${MKDIR} ${STAGEDIR}${ETCDIR}
+ ${MKDIR} ${STAGEDIR}/var/db/minecraft-server
+ ${MKDIR} ${STAGEDIR}/var/log/minecraft-server
+ ${INSTALL_SCRIPT} ${FILESDIR}/minecraft-server ${STAGEDIR}${PREFIX}/bin
.for file in ${CONFIG_FILES}
- ${INSTALL_DATA} ${FILESDIR}/${file}.sample ${STAGEDIR}${ETCDIR}
- ${CHMOD} 644 ${STAGEDIR}${ETCDIR}/${file}.sample
+ ${TOUCH} ${STAGEDIR}${ETCDIR}/${file}
+ ${LN} -s ${ETCDIR}/${file} ${STAGEDIR}${DATADIR}/${file}
.endfor
+ ${LN} -sf /var/log/minecraft-server ${STAGEDIR}${DATADIR}/logs
+ ${LN} -sf /var/log/minecraft-server/debug ${STAGEDIR}${DATADIR}/debug
+ ${LN} -sf /var/db/minecraft-server ${STAGEDIR}/${DATADIR}/world
.include <bsd.port.mk>
diff --git a/games/minecraft-server/distinfo b/games/minecraft-server/distinfo
index a7919a6192ff..26b97479051c 100644
--- a/games/minecraft-server/distinfo
+++ b/games/minecraft-server/distinfo
@@ -1,4 +1,2 @@
-SHA256 (minecraft-server/1.4.7/minecraft_server.jar) = 96b7512aead2fb20ddf780d7dd74208d77f209e16058ea8944150179e65b4dd3
-SIZE (minecraft-server/1.4.7/minecraft_server.jar) = 2061638
-SHA256 (minecraft-server/1.4.7/Bookshelf.png) = fe5e7f0bbbbe284379cb5e7aed8d539b727a3039f7fe8c64a179e4fc2a0e1821
-SIZE (minecraft-server/1.4.7/Bookshelf.png) = 9674
+SHA256 (minecraft_server.1.8.jar) = 40e23f3823d6f0e3cbadc491cedb55b8ba53f8ab516b68182ddd1536babeb291
+SIZE (minecraft_server.1.8.jar) = 10375504
diff --git a/games/minecraft-server/files/banned-ips.txt.sample b/games/minecraft-server/files/banned-ips.txt.sample
deleted file mode 100644
index 4b2789f21526..000000000000
--- a/games/minecraft-server/files/banned-ips.txt.sample
+++ /dev/null
@@ -1 +0,0 @@
-# each line one ip.
diff --git a/games/minecraft-server/files/banned-players.txt.sample b/games/minecraft-server/files/banned-players.txt.sample
deleted file mode 100644
index 99be54e4bfc5..000000000000
--- a/games/minecraft-server/files/banned-players.txt.sample
+++ /dev/null
@@ -1 +0,0 @@
-# each line one name
diff --git a/games/minecraft-server/files/minecraft-server b/games/minecraft-server/files/minecraft-server
new file mode 100644
index 000000000000..23fea4abc092
--- /dev/null
+++ b/games/minecraft-server/files/minecraft-server
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+if [ "$(id -u)" != "0" ]; then
+ echo "$0 must be run as root" 1>&2
+ exit 1
+fi
+
+cd /usr/local/share/minecraft-server
+su -m mcserver -c "java -Xmx1024M -Xms1024M -jar minecraft_server.1.7.10.jar nogui"
diff --git a/games/minecraft-server/files/minecraft.in b/games/minecraft-server/files/minecraft.in
deleted file mode 100644
index ac1015b0a64e..000000000000
--- a/games/minecraft-server/files/minecraft.in
+++ /dev/null
@@ -1,120 +0,0 @@
-#!/bin/sh
-#
-# PROVIDE: minecraft
-# REQUIRE: LOGIN
-# KEYWORD: shutdown
-
-. /etc/rc.subr
-
-name="minecraft"
-rcvar=minecraft_enable
-
-load_rc_config $name
-
-extra_commands="clean killworld clearlog"
-start_cmd="${name}_start"
-stop_cmd="${name}_stop"
-clean_cmd="${name}_clean"
-killworld_cmd="${name}_killworld"
-clearlog_cmd="${name}_clearlog"
-
-eval "${rcvar}=\${${rcvar}:-'NO'}"
-
-minecraft_start()
-{
-if [ -e %%DATADIR%%/server.log.lck ]; then
- echo "Server already running."
-else
- echo "Starting Minecraft-Server..."
- cd %%DATADIR%%
- /usr/bin/su %%USERS%% -c "%%LOCALBASE%%/bin/tmux new-session -d -s minecraft \"%%LOCALBASE%%/bin/java -Xmx1024M -Xms1024M -jar %%DATADIR%%/minecraft_server.jar nogui\""
-
- i=0
- while [ $i -lt 15 ]; do
- i=$(($i + 1))
- if [ -e %%DATADIR%%/server.log.lck ]; then
- echo "Minecraft-Server running."
- break
- else
- sleep 1
- fi
- done
-
- if [ $i -ge 10 ]; then
- echo "ERROR: Server could not be started."
- /usr/bin/su %%USERS%% -c "%%LOCALBASE%%/bin/tmux kill-session -t minecraft"
- fi
-fi
-}
-
-minecraft_stop(){
-if [ -e %%DATADIR%%/server.log.lck ]; then
- echo "Halting Minecraft-Server."
- /usr/bin/su %%USERS%% -c "%%LOCALBASE%%/bin/tmux send -t minecraft:0.0 stop \"Enter\""
-
-
- i=0
- while [ $i -lt 15 ]; do
- i=$(($i + 1))
- if [ -e %%DATADIR%%/server.log.lck ]; then
- sleep 1
- else
- echo "Minecraft-Server halted."
- break
- fi
- done
-
- if [ $i -ge 10 ];then
- echo "ERROR: Server could not be halted."
- fi
-else
- echo "Minecraft-Server not running."
-fi
-}
-
-minecraft_clean(){
- echo "Giving a stop to the server..."
- minecraft_stop
- echo "Cleaning..."
- if [ -e %%DATADIR%%/server.log.lck ]; then
- rm %%DATADIR%%/server.log.lck
- echo "Cleaning done."
- else
- echo "Nothing to do. No unclean sessions."
- fi
-}
-
-minecraft_killworld(){
- echo "Trying to delete World"
- if [ -e %%DATADIR%%/server.log.lck ]; then
- echo "Server seems to be running. Stop server before deletion."
- else
- rm -rf %%DATADIR%%/world
- if [ -d %%DATADIR%%/world ]; then
- echo "ERROR: World could not be deleted"
- else
- echo "World deleted. Next serverstart will generate a new one"
- fi
- fi
-}
-
-minecraft_clearlog(){
- echo "Trying to delete server.log"
- if [ -e %%DATADIR%%/server.log.lck ]; then
- echo "Server seems to be running. Stop server before deletion."
- else
- if [ -e %%DATADIR%%/server.log ]; then
- rm %%DATADIR%%/server.log
- if [ -e %%DATADIR%%/server.log ]; then
- echo "ERROR: server.log could not be deleted"
- else
- echo "server.log deleted."
- fi
- else
- echo "No server.log found"
- fi
- fi
-}
-
-run_rc_command "$1"
-
diff --git a/games/minecraft-server/files/ops.txt.sample b/games/minecraft-server/files/ops.txt.sample
deleted file mode 100644
index 99be54e4bfc5..000000000000
--- a/games/minecraft-server/files/ops.txt.sample
+++ /dev/null
@@ -1 +0,0 @@
-# each line one name
diff --git a/games/minecraft-server/files/pkg-deinstall.in b/games/minecraft-server/files/pkg-deinstall.in
index c1b91f190c74..27bcf133fba6 100644
--- a/games/minecraft-server/files/pkg-deinstall.in
+++ b/games/minecraft-server/files/pkg-deinstall.in
@@ -4,18 +4,8 @@ if [ "$2" != "POST-DEINSTALL" ]; then
exit 0
fi
-if [ -d %%DATADIR%% ]; then
- echo "There are some files (like your world and your server.log)"
- echo "left in %%DATADIR%%."
- echo "Use 'rm -rf %%DATADIR%%' to delete them."
- echo
-fi
-
-if [ -d %%ETCDIR%% ]; then
- echo "There are some changed config files left in %%ETCDIR%%."
- echo "Use 'rm -rf %%ETCDIR%%' to delete them."
- echo
-fi
-
-exit 0
-
+echo
+echo "NOTE: Your world has not been deleted. It is still in"
+echo "/var/db/minecraft-server. If you no longer want the world, you will"
+echo "need to manually delete it."
+echo "Also, you may want to delete any remaining files in %%DATADIR%%"
diff --git a/games/minecraft-server/files/pkg-message.in b/games/minecraft-server/files/pkg-message.in
index dc88ee729e2f..946b37c8a2ba 100644
--- a/games/minecraft-server/files/pkg-message.in
+++ b/games/minecraft-server/files/pkg-message.in
@@ -1,40 +1,12 @@
-**************************************************
-Daemon:
- The user %%USERS%% has been added to your system.
-
- To run the server automativally with the system
- add the following line to your /etc/rc.conf:
-
- minecraft_enable="YES"
-
- Serverfiles will be in
- %%PREFIX%%/share/minecraft-server
-
- Configuration can be done using the config-files
- or as OP using the Client. Config files are in
- %%PREFIX%%/etc/minecraft
-
- If you have trouble starting or stopping the
- server try to delete an unclean server.log.lck:
-
- %%PREFIX%%/etc/rc.d/minecraft clean
-
- If you don't like your generated world it can
- be deleted (do generate a new one next time
- the server starts) using:
-
- %%PREFIX%%/etc/rc.d/minecraft killworld
-
- You can delete the server.log (so it's not
- getting to fat) using:
-
- %%PREFIX%%/etc/rc.d/minecraft clearlog
-
-Unprivileged users:
- Running a server as unprivilieged user try
- minecraft-server{-nogui}
-
- The serverfiles will be in
- ~/.minecraft-server
-
-**************************************************
+When you first run minecraft-server, it will create the file
+%%DATADIR%%/eula.txt
+
+You need to read the EULA, and then set:
+eula=true
+
+- To run the server, run %%PREFIX%%/bin/minecraft-server
+- Configuration files can be found at %%ETCDIR%%
+- Log files can be found at /var/log/minecraft-server/
+- World files can be found at /var/db/minecraft-server
+- Debug output files can be found at /var/log/minecraft-server/debug/
+- To edit java's parameters, edit %%PREFIX%%/bin/minecraft-server
diff --git a/games/minecraft-server/files/server.properties.sample b/games/minecraft-server/files/server.properties.sample
deleted file mode 100644
index f0790739a85a..000000000000
--- a/games/minecraft-server/files/server.properties.sample
+++ /dev/null
@@ -1,24 +0,0 @@
-#Minecraft server properties
-#Thu Dec 22 00:12:43 CET 2011
-
-#Do NOT change the Levelname or some Scripts will no longer worf for
-#you!
-level-name=world
-
-allow-nether=true
-allow-flight=false
-enable-query=false
-server-port=25565
-enable-rcon=false
-level-seed=
-server-ip=
-white-list=false
-spawn-animals=true
-online-mode=true
-pvp=true
-difficulty=1
-gamemode=0
-max-players=20
-spawn-monsters=true
-view-distance=10
-motd=A FreeBSD Minecraft Server
diff --git a/games/minecraft-server/files/white-list.txt.sample b/games/minecraft-server/files/white-list.txt.sample
deleted file mode 100644
index 130fd21f3522..000000000000
--- a/games/minecraft-server/files/white-list.txt.sample
+++ /dev/null
@@ -1 +0,0 @@
-# each line one name.
diff --git a/games/minecraft-server/pkg-descr b/games/minecraft-server/pkg-descr
index 2c31d98d4e47..f659a7702252 100644
--- a/games/minecraft-server/pkg-descr
+++ b/games/minecraft-server/pkg-descr
@@ -1,4 +1,3 @@
-This is the server for the popular block building game Minecraft.
-There is a nongui-version and a gui-version.
+This is the dedicated server for the popular block building game Minecraft.
WWW: http://www.minecraft.net/
diff --git a/games/minecraft-server/pkg-plist b/games/minecraft-server/pkg-plist
index 1e983d9ea631..fc735b34fc3d 100644
--- a/games/minecraft-server/pkg-plist
+++ b/games/minecraft-server/pkg-plist
@@ -1,16 +1,23 @@
-@stopdaemon minecraft
-%%X11%%bin/minecraft-server
-bin/minecraft-server-nogui
+bin/minecraft-server
@owner mcserver
@group mcserver
-@sample %%ETCDIR%%/banned-ips.txt.sample
-@sample %%ETCDIR%%/banned-players.txt.sample
-@sample %%ETCDIR%%/ops.txt.sample
-@sample %%ETCDIR%%/server.properties.sample
-@sample %%ETCDIR%%/white-list.txt.sample
-%%DATADIR%%/minecraft_server.jar
+%%ETCDIR%%/banned-ips.json
+%%ETCDIR%%/banned-players.json
+%%ETCDIR%%/ops.json
+%%ETCDIR%%/server.properties
+%%ETCDIR%%/usercache.json
+%%ETCDIR%%/whitelist.json
+%%DATADIR%%/banned-ips.json
+%%DATADIR%%/banned-players.json
+%%DATADIR%%/debug
+%%DATADIR%%/logs
+%%DATADIR%%/minecraft_server.1.8.jar
+%%DATADIR%%/ops.json
+%%DATADIR%%/server.properties
+%%DATADIR%%/usercache.json
+%%DATADIR%%/whitelist.json
+%%DATADIR%%/world
+@dir /var/db/minecraft-server
+@dir /var/log/minecraft-server
@owner
@group
-%%X11%%share/pixmaps/minecraft-server.png
-@dirrmtry %%DATADIR%%
-@dirrmtry %%ETCDIR%%