License dedicated server packaging under GPLv3

This commit is contained in:
Alexander Sellite 2026-08-12 10:11:20 -04:00
parent a68d6157be
commit 9473fc0b33
12 changed files with 774 additions and 3 deletions

View file

@ -11,6 +11,7 @@ game_version="$2"
game_commit="${3,,}"
repository_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)"
destination_dir="${repository_dir}/dist"
licenses_dir="${destination_dir}/licenses"
if [[ ! "${game_version}" =~ ^[A-Za-z0-9][A-Za-z0-9._-]*$ ]]; then
echo "GAME_VERSION must contain only letters, numbers, dots, underscores, or hyphens." >&2
@ -32,6 +33,18 @@ install -m 0755 "${source_dir}/NETfishingServer.x86_64" \
"${destination_dir}/NETfishingServer.x86_64"
install -m 0644 "${source_dir}/NETfishingServer.pck" \
"${destination_dir}/NETfishingServer.pck"
rm -rf -- "${licenses_dir}"
install -d -m 0755 "${licenses_dir}"
install -m 0644 "${repository_dir}/LICENSE" \
"${licenses_dir}/GPL-3.0-or-later.txt"
install -m 0644 "${repository_dir}/ASSET-LICENSE.md" \
"${licenses_dir}/ASSET-LICENSE.md"
install -m 0644 "${repository_dir}/THIRD-PARTY-NOTICES.md" \
"${licenses_dir}/THIRD-PARTY-NOTICES.md"
install -m 0644 "${repository_dir}/TRADEMARKS.md" \
"${licenses_dir}/TRADEMARKS.md"
install -m 0644 "${repository_dir}/CREDITS.md" \
"${licenses_dir}/CREDITS.md"
cd -- "${destination_dir}"
executable_sha256="$(sha256sum NETfishingServer.x86_64 | awk '{print $1}')"
@ -48,6 +61,27 @@ printf '%s\n' \
"executable_sha256=${executable_sha256}" \
"pck_sha256=${pck_sha256}" \
> BUILD_INFO
cat >SOURCE-CODE.md <<EOF
# Corresponding source
NETfishing dedicated game-server code is licensed under GPL-3.0-or-later.
Source repository: https://forge.makearmy.io/woofmeow/netfishing
Exact game source revision: ${game_commit}
Packaging source:
https://forge.makearmy.io/woofmeow/netfishing-dedicated-server
EOF
umask "${apply_umask}"
sha256sum NETfishingServer.x86_64 NETfishingServer.pck BUILD_INFO > SHA256SUMS
sha256sum \
NETfishingServer.x86_64 \
NETfishingServer.pck \
BUILD_INFO \
SOURCE-CODE.md \
licenses/GPL-3.0-or-later.txt \
licenses/ASSET-LICENSE.md \
licenses/THIRD-PARTY-NOTICES.md \
licenses/TRADEMARKS.md \
licenses/CREDITS.md \
> SHA256SUMS
echo "Staged dedicated server build in ${destination_dir}"