35 lines
928 B
Bash
35 lines
928 B
Bash
#!/bin/bash
|
|
# RHEL Mock Build Script
|
|
# Sprint: SPRINT_1227_0002_0001 (Reproducible Builders)
|
|
#
|
|
# Builds SRPMs using mock for isolation and reproducibility
|
|
|
|
set -euo pipefail
|
|
|
|
SRPM="${1:-}"
|
|
RESULT_DIR="${2:-/build/output}"
|
|
CONFIG="${3:-stellaops-repro}"
|
|
|
|
[[ -z "${SRPM}" ]] && { echo "Usage: $0 <srpm> [result_dir] [mock_config]"; exit 1; }
|
|
[[ ! -f "${SRPM}" ]] && { echo "SRPM not found: ${SRPM}"; exit 1; }
|
|
|
|
mkdir -p "${RESULT_DIR}"
|
|
|
|
echo "Building SRPM with mock: ${SRPM}"
|
|
echo "Config: ${CONFIG}"
|
|
echo "Output: ${RESULT_DIR}"
|
|
|
|
# Initialize mock if needed
|
|
mock -r "${CONFIG}" --init
|
|
|
|
# Build with reproducibility settings
|
|
mock -r "${CONFIG}" \
|
|
--rebuild "${SRPM}" \
|
|
--resultdir="${RESULT_DIR}" \
|
|
--define "SOURCE_DATE_EPOCH ${SOURCE_DATE_EPOCH:-$(date +%s)}" \
|
|
--define "_buildhost stellaops.build" \
|
|
--define "debug_package %{nil}"
|
|
|
|
echo "Build complete. Results in: ${RESULT_DIR}"
|
|
ls -la "${RESULT_DIR}"
|