Files
pyMC_Repeater/scripts/setup-build-env.sh
Lloyd 59a151f382 Add build scripts and setup for pyMC_Repeater
- Implemented build-dev.sh for creating development .deb packages from untagged commits.
- Implemented build-prod.sh for creating production .deb packages from tagged commits, including checks for a clean git state.
- Added setup-build-env.sh to automate the installation of required build dependencies for Debian/Ubuntu.
- Created setup.py to manage package setup using setuptools with versioning from git tags.
2025-12-30 15:17:48 +00:00

82 lines
1.9 KiB
Bash
Executable File

#!/bin/bash
# Setup Debian/Ubuntu build environment for pyMC_Repeater
# This script installs all required build dependencies using apt
set -euo pipefail
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
log_info() {
echo -e "${GREEN}[INFO]${NC} $1"
}
log_warn() {
echo -e "${YELLOW}[WARN]${NC} $1"
}
log_error() {
echo -e "${RED}[ERROR]${NC} $1"
}
# Check if running as root or with sudo
if [ "$EUID" -ne 0 ]; then
log_error "This script must be run with sudo or as root"
exit 1
fi
log_info "Setting up build environment for pyMC_Repeater..."
# Update package list
log_info "Updating package lists..."
apt-get update
# Install Debian packaging tools
log_info "Installing Debian packaging tools..."
apt-get install -y \
debhelper \
devscripts \
build-essential \
fakeroot \
lintian \
git
# Install Python build dependencies
log_info "Installing Python build dependencies..."
apt-get install -y \
dh-python \
python3-all \
python3-setuptools \
python3-setuptools-scm \
python3-wheel \
python3-pip \
python3-dev
# Install Python runtime dependencies (for building)
log_info "Installing Python runtime dependencies..."
apt-get install -y \
python3-yaml \
python3-cherrypy3 \
python3-paho-mqtt \
python3-psutil \
python3-jwt || {
log_warn "python3-jwt not available via apt, will be installed via pip during build"
}
# Note: cherrypy-cors is not available in Debian repos
# For development testing: pip install cherrypy-cors
# Clean up
log_info "Cleaning up..."
apt-get autoremove -y
apt-get clean
log_info "Build environment setup complete!"
log_info ""
log_info "Next steps:"
log_info " - Run './scripts/build-dev.sh' to build a development .deb package"
log_info " - Run './scripts/build-prod.sh' to build a production .deb package (requires git tag)"