From nobody Mon May 27 16:36:50 2024 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vp1WR1Z1mz5LSQ7; Mon, 27 May 2024 16:36:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vp1WQ6Ly7z4QCy; Mon, 27 May 2024 16:36:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716827810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kzEwKZtNGhmAQ0zWTdtrQcCN/AYi9u2UKbauP82TDHQ=; b=ydYrlIxFMT2+TaJBIYI+y05UuK69BhvrMJFYxexdHX7pBkqtMgteZhgq7T8SNY0I09m5xt Xz9GQ3IQxi/+wf+FF0I970zKwkXjGkOlzK7jNzfPDShI2RT/OFhdx0XaNnbQi7jbQbWRgL 5ehH++0J4ixt8JqMdge74fqwjsnv3I4xfr6XqtF4Iyv62B11Xyw4wcnf2dEsi/fWk8sg4H k97ga/F4PWRrbqKh8IBsyvsrrRYCDPMkj2+vH1nEYvkXDAYsbYUN7tJueDMoQoGR92RyJh xVm7QGkyI6x1Syw28cRrgeH0ZSvqFJDgM/PSBfXBLd7u6MR1gb+sbcb0lUnDwg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716827810; a=rsa-sha256; cv=none; b=n3rA/bCUGk4Kjrqb5gsWSInOCUJRf6q/0z7nUPDibMdX2qZMsyKYn0CN6lCLiB70wFoC+8 FUVHtEjA2fc4MuQJ54A22fHCdBlSlYJMp8X/m+rnM8nv34JopTQ5tvksydWX8QzoLvtdIf Jlj29kdgOJWx5Ek2OsQVox7KH1plBoYkGZiPdkdbItgrMgRKLYi2sJKaxgoV1k5jYZgnSQ S4FH944YjgqJRzPxdx2aCGWCl/KEwhSqUxEzNIHxjRWB7akLgAV3jUcn+MLND5wOiPTiK2 HFZOFAxrfOeiw+fwUuNtC+bdItLXIdHXQaigDPE57U/0WSBueejRtxLltbJk5w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716827810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kzEwKZtNGhmAQ0zWTdtrQcCN/AYi9u2UKbauP82TDHQ=; b=azRKrj0FQMLGZjQILmS6h4ErBQCh9rirOXaR6T6s7KU27i/ZJFwQ1yu6f7CuG4xUmLUFYA j4jJnMnO1Eq9//jSWonqd6DGaAV4KwHZ4K39ULwINYKous55LkX1jQdanEPNp80cb34l9o AIs69p0M0HiNfJBL8giYa2syHllJwPza8r2GvzYFlmxjw3FEJBDZzM+SbaH+S6VstI6e0o H/X5l4qnJt9H7nm3ZtOPCRKUu9CEfZotP5tbiRMhNgBmaPWB8pFwjf3CRLhvGxVK0SOiPa /9w0AnGenvem/+7ahvqqCpX3AiIalAQje7tKigavPGnt0tlFzXxOXTWkfHI1Wg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vp1WQ5qnYzrbp; Mon, 27 May 2024 16:36:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44RGaoQ7010078; Mon, 27 May 2024 16:36:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44RGao8x010075; Mon, 27 May 2024 16:36:50 GMT (envelope-from git) Date: Mon, 27 May 2024 16:36:50 GMT Message-Id: <202405271636.44RGao8x010075@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Dmitry Marakasov Subject: git: f5c99763242c - main - games/minetest: fix rc.d script List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-main@freebsd.org Sender: owner-dev-commits-ports-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: amdmi3 X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f5c99763242c21f3ce4072ba5518d66b5174e84a Auto-Submitted: auto-generated The branch main has been updated by amdmi3: URL: https://cgit.FreeBSD.org/ports/commit/?id=f5c99763242c21f3ce4072ba5518d66b5174e84a commit f5c99763242c21f3ce4072ba5518d66b5174e84a Author: Dmitry Marakasov AuthorDate: 2024-05-24 20:42:37 +0000 Commit: Dmitry Marakasov CommitDate: 2024-05-27 16:25:24 +0000 games/minetest: fix rc.d script - Introduce `minetest_gameid` rc.d variable (set to minetest_game by default), which passes required --gameid to minetestserver. - Rework minetestserver arguments handling, simplify specifying extra arguments with `minetest_args`. - Add check for empty list of games, suggesting to install minetest_game port or other mods. - Fix `minetest_config` variable spelling PR: 279251 Submitted by: DtxdF@disroot.org --- games/minetest/Makefile | 1 + games/minetest/files/minetest.in | 28 ++++++++++++---------------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/games/minetest/Makefile b/games/minetest/Makefile index da692c3c99e1..1d73d911f5b9 100644 --- a/games/minetest/Makefile +++ b/games/minetest/Makefile @@ -1,5 +1,6 @@ PORTNAME= minetest PORTVERSION= 5.8.0 +PORTREVISION= 1 CATEGORIES= games MAINTAINER= amdmi3@FreeBSD.org diff --git a/games/minetest/files/minetest.in b/games/minetest/files/minetest.in index 2f1cf002309b..6598ecd2d556 100644 --- a/games/minetest/files/minetest.in +++ b/games/minetest/files/minetest.in @@ -8,7 +8,7 @@ # # minetest_enable (bool): Set to "NO" by default # Set it to "YES" to enable minetest server -# minetest_conffile (str): Path to config file (required). +# minetest_config (str): Path to config file (required). # (default: /usr/local/etc/minetest.conf) # minetest_rundir (str): Path to directory holding a pidfile. # (default: /var/run/minetest) @@ -20,6 +20,10 @@ # (default: /var/log/minetest) # minetest_dbdir (str): Path to world database directory # (default: /var/db/minetest) +# minetest_gameid (str): Path to world database directory +# (default: minetest_game) +# minetest_args (str): Additional arguments to minetestserver +# (default: "") . /etc/rc.subr @@ -29,34 +33,26 @@ rcvar=minetest_enable load_rc_config ${name} : ${minetest_enable="NO"} -: ${minetest_config="/usr/local/etc/minetest.conf"} +: ${minetest_config="%%PREFIX%%/etc/minetest.conf"} : ${minetest_rundir="/var/run/minetest"} : ${minetest_user="minetest"} : ${minetest_group="minetest"} : ${minetest_logdir="/var/log/minetest"} : ${minetest_dbdir="/var/db/minetest"} -: ${minetest_args:="--logfile ${minetest_logdir}/debug.log --world ${minetest_dbdir}/world ${minetest_flags}"} - -pidfile= - -case "${minetest_args}" in -*--config\ *) - echo "Warning \$minetest_args includes --config option." \ - "Please use \$minetest_conffile instead." - ;; -*) - minetest_args="--config ${minetest_config} ${minetest_args}" - ;; -esac +: ${minetest_gameid="minetest_game"} +: ${minetest_args=""} command=/usr/sbin/daemon procname=/usr/local/bin/minetestserver pidfile=${minetest_rundir}/minetest.pid -command_args="-c -f -p ${pidfile} /usr/bin/env HOME='${minetest_dbdir}' ${procname} ${minetest_args}" +command_args="-c -f -p ${pidfile} /usr/bin/env HOME='${minetest_dbdir}' ${procname} --config ${minetest_config} --logfile ${minetest_logdir}/debug.log --world ${minetest_dbdir}/world --gameid ${minetest_gameid} ${minetest_args}" required_files=${minetest_config} start_precmd=minetest_prestart minetest_prestart () { + if ! ${procname} --gameid list | grep -q "."; then + echo "Warning: no games installed (\`${procname} --gameid list\` is empty). You may want to install games/minetest_game or other games from https://content.minetest.net/." 1>&2 + fi if [ ! -d ${minetest_rundir} ]; then mkdir -m 755 -p ${minetest_rundir} chown -R ${minetest_user}:${minetest_group} ${minetest_rundir}