Files
qt6-migration-pipeline/app/prepare_rpm.sh
T
torsten 77c67c12ca Execute the same instructions but now for tools in folders you are getti
Entire-Metadata: .entire/metadata/fb87247f-2a75-407e-b336-cbc8c20ba5a6
Entire-Session: fb87247f-2a75-407e-b336-cbc8c20ba5a6
Entire-Strategy: manual-commit
2026-09-24 16:24:51 +00:00

42 lines
1.3 KiB
Bash
Executable File

#!/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