freebsd-ports/games/minecraft-server/Makefile
Alexandre Labarre 62a61b0aa8 games/minecraft-server: update to 1.20.2
Changelog:
https://www.minecraft.net/en-us/article/minecraft-java-edition-1-20-2

PR:		274534
Approved by:	Jonathan Price <freebsd@jonathanprice.org> (maintainer), tcberner (mentor), arrowd (mentor)
2023-11-24 17:09:19 +03:00

64 lines
2 KiB
Makefile

PORTNAME= minecraft-server
PORTVERSION= 1.20.2
CATEGORIES= games java
MASTER_SITES= https://launcher.mojang.com/v1/objects/5b868151bd02b41319f54c8d4061b8cae84e665c/
DISTNAME= server
EXTRACT_SUFX= .jar
DIST_SUBDIR= ${PORTNAME}-${PORTVERSION}
EXTRACT_ONLY=
MAINTAINER= freebsd@jonathanprice.org
COMMENT= Dedicated server for the game Minecraft
WWW= http://www.minecraft.net/
LICENSE= minecraft
LICENSE_NAME= Minecraft End User License Agreement
LICENSE_TEXT= The license can be viewed at: https://account.mojang.com/documents/minecraft_eula
LICENSE_PERMS= no-dist-mirror no-dist-sell no-pkg-mirror no-pkg-sell
USE_JAVA= yes
JAVA_VERSION= 17
NO_ARCH= yes
NO_BUILD= yes
SUB_FILES= minecraft-server pkg-deinstall pkg-message
SUB_LIST= VERSION=${PORTVERSION}
USERS= mcserver
GROUPS= ${USERS}
PLIST_SUB= VERSION=${PORTVERSION}
CONFIG_FILES= banned-ips.json banned-players.json eula.txt ops.json \
server.properties usercache.json whitelist.json
OPTIONS_DEFAULT= STANDALONE
OPTIONS_SINGLE= RUN
OPTIONS_SINGLE_RUN= DAEMON STANDALONE
OPTIONS_SUB= yes
DAEMON_DESC= Run as a service
STANDALONE_DESC= Run the .jar file directly
DAEMON_RUN_DEPENDS= tmux:sysutils/tmux
DAEMON_VARS= USE_RC_SUBR=minecraft
do-install:
${MKDIR} ${STAGEDIR}${PREFIX}/${PORTNAME}
${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/${DISTFILES} \
${STAGEDIR}${PREFIX}/${PORTNAME}
${MKDIR} ${STAGEDIR}${ETCDIR}
${MKDIR} ${STAGEDIR}/var/db/minecraft-server
${MKDIR} ${STAGEDIR}/var/log/minecraft-server
.for file in ${CONFIG_FILES}
${LN} -s ${ETCDIR}/${file} ${STAGEDIR}${PREFIX}/${PORTNAME}/${file}
.endfor
${LN} -sf /var/log/minecraft-server ${STAGEDIR}${PREFIX}/${PORTNAME}/logs
${LN} -sf /var/log/minecraft-server/debug ${STAGEDIR}${PREFIX}/${PORTNAME}/debug
${LN} -sf /var/db/minecraft-server ${STAGEDIR}${PREFIX}/${PORTNAME}/world
post-install-STANDALONE-on:
${INSTALL_SCRIPT} ${WRKDIR}/minecraft-server \
${STAGEDIR}${PREFIX}/bin
${CP} ${FILESDIR}/java-args.txt ${STAGEDIR}${ETCDIR}
.include <bsd.port.mk>