games-server/vintagestory-server: new package, add 1.19.8, 1.20.0_rc6
[gentoo-zh.git] / games-server / vintagestory-server / vintagestory-server-1.19.8.ebuild
blobd3e3ed05d029dc6623b0d6f0c4c7c7ed04cfc5ad
1 # Copyright 2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=8
5 DOTNET_PKG_COMPAT=7.0
6 inherit dotnet-pkg-base systemd
8 MY_PV="${PV/_rc/-rc.}"
9 _CHANNEL="stable"
11 DESCRIPTION="Dedicated game server for Vintage Story"
12 HOMEPAGE="https://www.vintagestory.at/"
13 SRC_URI="https://cdn.vintagestory.at/gamefiles/${_CHANNEL}/vs_server_linux-x64_${MY_PV}.tar.gz"
14 S="${WORKDIR}"
16 LICENSE="all-rights-reserved"
17 SLOT="${PV}"
18 KEYWORDS="-* ~amd64"
20 RDEPEND="
21         acct-group/vintagestory
22         acct-user/vintagestory
23         app-misc/dtach
24         net-misc/curl
25         virtual/dotnet-sdk:${DOTNET_PKG_COMPAT}
27 BDEPEND="
28         virtual/dotnet-sdk:${DOTNET_PKG_COMPAT}
31 # Do NOT Distribute!
32 RESTRICT="bindist mirror strip"
34 QA_PREBUILT="*"
35 QA_PRESTRIPPED="*"
37 DOTNET_PKG_OUTPUT="${S}"
38 INST_DIR="/opt/${PN}-${PV}"
40 src_prepare() {
41         rm "${S}/server.sh" || die
43         envsubst < "${FILESDIR}/vintagestory-server.service" > "${S}/vintagestory-server-${PV}@.service" || die
44         envsubst < "${FILESDIR}/vintagestory-server.initd" > "${S}/vintagestory-server-${PV}.initd" || die
46         default
49 src_compile() {
50         :
53 src_install() {
54         dotnet-pkg-base_install "${INST_DIR}"
55         dotnet-pkg-base_dolauncher "${INST_DIR}/VintagestoryServer" "${P}"
57         newinitd "${S}/vintagestory-server-${PV}.initd" "vintagestory-server-${PV}"
58         newconfd "${FILESDIR}"/vintagestory-server.confd "vintagestory-server-${PV}"
59         systemd_dounit "${S}/vintagestory-server-${PV}@.service"