79 lines
1.8 KiB
Bash
Executable File
79 lines
1.8 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# YourPart Daemon Local Build Script für OpenSUSE Tumbleweed
|
|
# Führen Sie dieses Script lokal auf Ihrem Entwicklungsrechner aus
|
|
|
|
set -euo pipefail
|
|
|
|
# Farben für Output
|
|
RED='\033[0;31m'
|
|
GREEN='\033[0;32m'
|
|
YELLOW='\033[1;33m'
|
|
BLUE='\033[0;34m'
|
|
NC='\033[0m' # No Color
|
|
|
|
log_info() {
|
|
echo -e "${BLUE}[INFO]${NC} $1"
|
|
}
|
|
|
|
log_success() {
|
|
echo -e "${GREEN}[SUCCESS]${NC} $1"
|
|
}
|
|
|
|
log_warning() {
|
|
echo -e "${YELLOW}[WARNING]${NC} $1"
|
|
}
|
|
|
|
log_error() {
|
|
echo -e "${RED}[ERROR]${NC} $1"
|
|
}
|
|
|
|
log_info "Starte lokalen Build für YourPart Daemon auf OpenSUSE Tumbleweed..."
|
|
|
|
# Prüfe ob wir im richtigen Verzeichnis sind
|
|
if [ ! -f "CMakeLists.txt" ] || [ ! -f "daemon.conf" ]; then
|
|
log_error "Bitte führen Sie dieses Script aus dem Projektverzeichnis aus!"
|
|
exit 1
|
|
fi
|
|
|
|
# Prüfe Dependencies
|
|
log_info "Prüfe Dependencies..."
|
|
if ! command -v cmake &> /dev/null; then
|
|
log_error "CMake nicht gefunden. Führen Sie zuerst install-dependencies-opensuse.sh aus!"
|
|
exit 1
|
|
fi
|
|
|
|
if ! command -v g++ &> /dev/null; then
|
|
log_error "G++ nicht gefunden. Führen Sie zuerst install-dependencies-opensuse.sh aus!"
|
|
exit 1
|
|
fi
|
|
|
|
# Erstelle Build-Verzeichnis
|
|
log_info "Erstelle Build-Verzeichnis..."
|
|
if [ ! -d "build" ]; then
|
|
mkdir build
|
|
fi
|
|
|
|
cd build
|
|
|
|
# Konfiguriere CMake
|
|
log_info "Konfiguriere CMake..."
|
|
cmake .. -DCMAKE_BUILD_TYPE=Release
|
|
|
|
# Kompiliere
|
|
log_info "Kompiliere Projekt..."
|
|
make -j$(nproc)
|
|
|
|
cd ..
|
|
|
|
log_success "Lokaler Build abgeschlossen!"
|
|
log_info ""
|
|
log_info "Build-Ergebnisse:"
|
|
log_info "- Binärdatei: build/yourpart-daemon"
|
|
log_info "- Größe: $(du -h build/yourpart-daemon | cut -f1)"
|
|
log_info ""
|
|
log_info "Nächste Schritte:"
|
|
log_info "1. Testen Sie die Binärdatei lokal"
|
|
log_info "2. Deployen Sie auf den Server mit deploy.sh"
|
|
log_info "3. Oder verwenden Sie deploy-server.sh direkt auf dem Server"
|