tools: add RPM prepare and external-install helper scripts (ArcGIS, GeographicLib, RTI)

This commit is contained in:
torsten committed 2026-07-18 18:23:30 +02:00
1 parent 0a9284ca91
commit 89f048a312
4 files changed
+141

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
#!/usr/bin/env bash
set -euo pipefail
# build_geographiclib.sh
# Build and install GeographicLib from source into /usr/local
GIT_REPO=${1:-https://github.com/GeographicLib/GeographicLib.git}
INSTALL_PREFIX=${2:-/usr/local}
echo "Cloning GeographicLib from $GIT_REPO"
TMP=$(mktemp -d)
trap 'rm -rf "$TMP"' EXIT
git clone --depth 1 "$GIT_REPO" "$TMP/GeographicLib"
mkdir -p "$TMP/GeographicLib/build"
pushd "$TMP/GeographicLib/build" >/dev/null
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$INSTALL_PREFIX"
make -j$(nproc)
sudo make install
popd >/dev/null
echo "GeographicLib installed to $INSTALL_PREFIX"
+35
View File
@@ -0,0 +1,35 @@
#!/usr/bin/env bash
set -euo pipefail
# install_arcgis.sh
# Unpacks ArcGIS Maps SDK for Qt and installs into /opt/ArcGIS
# Expects the zip at ../ArcGIS_Maps_SDK_Qt_linux_300.0.0.zip relative to repo root
ZIP_PATH="${1:-../ArcGIS_Maps_SDK_Qt_linux_300.0.0.zip}"
TARGET_DIR="/opt/ArcGIS/MapsSDK_Qt_300.0.0"
if [[ ! -f "$ZIP_PATH" ]]; then
echo "ArcGIS zip not found at $ZIP_PATH"
echo "Please place ArcGIS_Maps_SDK_Qt_linux_300.0.0.zip at that path before running this script."
exit 1
fi
sudo mkdir -p "$TARGET_DIR"
sudo chown $(id -u):$(id -g) "$TARGET_DIR"
echo "Extracting $ZIP_PATH to $TARGET_DIR..."
unzip -q "$ZIP_PATH" -d "$TARGET_DIR"
# Typical SDK layout contains lib/cmake packages and Qt plugins. Ensure CMAKE_PREFIX_PATH contains it.
echo "ArcGIS SDK extracted. Add $TARGET_DIR to CMAKE_PREFIX_PATH when building:"
echo " -DCMAKE_PREFIX_PATH=\"$TARGET_DIR:$CMAKE_PREFIX_PATH\""
# Optionally perform install actions if package contains an install script
if [[ -x "$TARGET_DIR/install.sh" ]]; then
echo "Running provided install.sh inside SDK"
pushd "$TARGET_DIR" >/dev/null
sudo ./install.sh || true
popd >/dev/null
fi
echo "ArcGIS SDK unpack complete. Files are at $TARGET_DIR"
+43
View File
@@ -0,0 +1,43 @@
#!/usr/bin/env bash
set -euo pipefail
# install_rti.sh
# Install RTI Connext from a local installer archive (user-supplied, due to licensing)
# Expected file: ../rti-connext-7.7.0.tar.gz or provided as first arg
RTI_ARCHIVE=${1:-../rti-connext-7.7.0.tar.gz}
INSTALL_PREFIX=${2:-/opt/RTI}
if [[ ! -f "$RTI_ARCHIVE" ]]; then
echo "RTI Connext archive not found at $RTI_ARCHIVE"
echo "Please place rti-connext-7.7.0 archive at that path or pass path as first arg."
exit 1
fi
echo "Installing RTI Connext from $RTI_ARCHIVE to $INSTALL_PREFIX"
sudo mkdir -p "$INSTALL_PREFIX"
sudo chown $(id -u):$(id -g) "$INSTALL_PREFIX"
echo "Extracting..."
tar xzf "$RTI_ARCHIVE" -C "$INSTALL_PREFIX" --strip-components=1
# Typical Connext installs provide scripts under $INSTALL_PREFIX/etc or bin - advise user
if [[ -f "$INSTALL_PREFIX/rticonnextdds-cxx-X.Y.Z/setup.sh" ]]; then
echo "Found setup script; source it in your environment when building."
fi
echo "RTI Connext files are in $INSTALL_PREFIX"
echo "Note: You may need to run vendor installer or agree license terms interactively; this script assumes an already prepared archive."
echo "Cloning RTI Community helper repos (examples/connectors)"
if [[ ! -d "/opt/rticommunity" ]]; then
sudo mkdir -p /opt/rticommunity
sudo chown $(id -u):$(id -g) /opt/rticommunity
fi
pushd /opt/rticommunity >/dev/null
if [[ ! -d rticonnextdds-connector ]]; then
git clone https://github.com/rticommunity/rticonnextdds-connector.git || true
fi
popd >/dev/null
echo "RTI install script finished. Please verify licensing and run vendor-provided installers if required."
+41
View File
@@ -0,0 +1,41 @@
#!/usr/bin/env bash
set -euo pipefail
# Usage: prepare_rpm.sh [PROJECT] [OS_VERSION] [LTS_VERSION] [GUEZ_MODE]
# If PROJECT omitted, runs for Legatus, Guez, DemoTablet (in that order).
PROJECTS=("Legatus" "Guez" "DemoTablet")
PROJECT=${1:-}
OS_VERSION=${2:-ubuntu24}
LTS_VERSION=${3:-1.2.0}
GUEZ_MODE=${4:-ON}
REPO_DIR="$(pwd)"
run_for_project() {
local proj="$1"
echo "Preparing RPM for project: $proj (OS=$OS_VERSION, LTS=$LTS_VERSION, GUEZ_MODE=$GUEZ_MODE)"
export PROJECT_BASE_DIR="/tmp/${proj}_staging"
rm -rf "$PROJECT_BASE_DIR"
mkdir -p "$PROJECT_BASE_DIR"
# Stage workspace similar to Jenkins: exclude rpms, .git, build
tar --exclude='./rpms' --exclude='./.git' --exclude='./build' -cf - -C "$REPO_DIR" . | tar -xf - -C "$PROJECT_BASE_DIR"
mkdir -p "$REPO_DIR/rpmbuild"
pushd "$REPO_DIR/rpmbuild" >/dev/null
python3 make_rpm.py -c LTS \
--project_name "$proj" \
--version "$LTS_VERSION" \
--output_dir "$REPO_DIR/rpms/${proj}/${OS_VERSION}/" \
--cmake_build_flags "-DUSE_IPO=ON -DUSE_UNITY_BUILD=ON -DGUEZ_MODE=${GUEZ_MODE} -DBUILD_WLS=ON -DPostgreSQL_TYPE_INCLUDE_DIR=/usr/include/pgsql/"
popd >/dev/null
echo "RPMs placed in: $REPO_DIR/rpms/${proj}/${OS_VERSION}/"
}
if [[ -n "$PROJECT" ]]; then
run_for_project "$PROJECT"
else
for p in "${PROJECTS[@]}"; do
run_for_project "$p"
done
fi