#!/bin/bash
echo "=== LineDance Player - Linux Build ==="
echo

# Aktiver venv
source venv/bin/activate 2>/dev/null || echo "ADVARSEL: venv ikke aktiveret"

# Installer PyInstaller
pip show pyinstaller > /dev/null 2>&1 || pip install pyinstaller

# Ryd tidligere build
rm -rf dist/LineDancePlayer build/LineDancePlayer

echo "Bygger LineDance Player..."
echo "Dette tager 1-3 minutter..."
echo

pyinstaller build_windows.spec --clean

if [ $? -eq 0 ]; then
    echo
    echo "=== BUILD FÆRDIG ==="
    echo "Programmet ligger i: dist/LineDancePlayer/LineDancePlayer"
    echo
    echo "HUSK: VLC skal stadig være installeret på maskinen!"
    echo "  sudo apt install vlc"
else
    echo "FEJL: Build mislykkedes!"
    exit 1
fi
