legal: BSD-2-Clause LICENSE, THIRD-PARTY notice, package ships no third-party binaries by default
This commit is contained in:
1 parent
a6f1fea261
commit
5dc6bfb5a2
4 files changed
+112
-9
No files matched your search
+25
-9
@@ -1,8 +1,13 @@
|
||||
#!/bin/sh
|
||||
# build-package.sh - create the distributable extension tarball.
|
||||
#
|
||||
# Usage: tools/build-package.sh [--version <ver>]
|
||||
# Usage: tools/build-package.sh [--version <ver>] [--with-vendor]
|
||||
#
|
||||
# Output: dist/vmmngr-<version>.tar.gz (+ .sha256)
|
||||
#
|
||||
# By default no third-party binaries are shipped (see THIRD-PARTY.md).
|
||||
# --with-vendor bundles vendor/ for systems without packages - then you are
|
||||
# redistributing those binaries and must honour their licences.
|
||||
|
||||
set -eu
|
||||
|
||||
@@ -10,30 +15,41 @@ ROOT=$(cd "$(dirname "$0")/.." && pwd -P)
|
||||
cd "${ROOT}"
|
||||
|
||||
VERSION=$(cat version.txt 2>/dev/null | tr -d '\n')
|
||||
if [ "${1:-}" = "--version" ]; then
|
||||
VERSION="$2"
|
||||
fi
|
||||
WITH_VENDOR=0
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
--version) VERSION="$2"; shift 2 ;;
|
||||
--with-vendor) WITH_VENDOR=1; shift ;;
|
||||
*) echo "unknown option: $1" >&2; exit 2 ;;
|
||||
esac
|
||||
done
|
||||
|
||||
[ -n "${VERSION}" ] || { echo "version.txt missing or empty" >&2; exit 1; }
|
||||
|
||||
NAME="vmmngr-${VERSION}"
|
||||
STAGE="dist/${NAME}"
|
||||
|
||||
rm -rf "${STAGE}"
|
||||
|
||||
mkdir -p "${STAGE}" dist
|
||||
|
||||
# code and metadata (state/log/backup are runtime data and never shipped)
|
||||
# our code and documentation
|
||||
cp -R bin gui templates "${STAGE}/"
|
||||
cp vmm-init version.txt README.md CHANGELOG.md "${STAGE}/" 2>/dev/null || true
|
||||
[ -f LICENSE ] && cp LICENSE "${STAGE}/"
|
||||
cp vmm-init version.txt README.md CHANGELOG.md THIRD-PARTY.md LICENSE "${STAGE}/"
|
||||
|
||||
# bundled binaries (only when present)
|
||||
if [ -d vendor ]; then
|
||||
if [ "${WITH_VENDOR}" -eq 1 ] && [ -d vendor ]; then
|
||||
mkdir -p "${STAGE}/vendor"
|
||||
for d in vendor/*/; do
|
||||
[ -d "$d" ] || continue
|
||||
cp -R "$d" "${STAGE}/vendor/"
|
||||
# ship the licence text next to the binary it covers
|
||||
for lic in "$d"LICENSE* "$d"COPYING* "$d"license*; do
|
||||
[ -e "${lic}" ] && cp "${lic}" "${STAGE}/vendor/" 2>/dev/null || true
|
||||
done
|
||||
done
|
||||
find "${STAGE}/vendor" -name '.gitkeep' -delete
|
||||
echo "NOTE: vendor/ bundled - third-party licences apply (see THIRD-PARTY.md)"
|
||||
fi
|
||||
|
||||
find "${STAGE}" -name '.gitignore' -delete
|
||||
|
||||
Reference in new issue
Block a user