34 lines
1.4 KiB
Bash
Executable File
34 lines
1.4 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Baut die Windows-.exe mit Windows-Python unter Wine (z. B. im Container tobix/pywine:3.12).
|
|
# Ergebnis: dist/Provisionsmanager95.exe und dist/Provisionsmanager95-<version>.zip
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")/.."
|
|
|
|
export WINEDEBUG=-all
|
|
export LANG=C.UTF-8 LC_ALL=C.UTF-8 # sonst kann Wine keine Umlaute in Dateinamen abbilden
|
|
export WINEPREFIX="${WINEPREFIX:-/opt/wineprefix}"
|
|
PY="wine python"
|
|
|
|
$PY --version
|
|
$PY -m pip install --disable-pip-version-check -q -r requirements-dev.txt
|
|
|
|
echo "== Tests (Windows-Python) =="
|
|
$PY -m pytest -q
|
|
|
|
echo "== Version =="
|
|
VERSION=$($PY build/version_info.py | tr -d '\r')
|
|
echo "Version $VERSION"
|
|
|
|
echo "== PyInstaller =="
|
|
$PY -m PyInstaller --noconfirm --clean --distpath dist --workpath build/tmp build/provisionsmanager.spec
|
|
|
|
test -f dist/Provisionsmanager95.exe
|
|
cp README.md dist/LIESMICH.md 2>/dev/null || true
|
|
( cd dist && rm -f Provisionsmanager95-*.zip && \
|
|
python3 -c "import zipfile,sys; z=zipfile.ZipFile(sys.argv[1],'w',zipfile.ZIP_DEFLATED); [z.write(f) for f in sys.argv[2:]]; z.close()" \
|
|
"Provisionsmanager95-${VERSION}.zip" Provisionsmanager95.exe LIESMICH.md 2>/dev/null \
|
|
|| $PY -c "import zipfile,sys; z=zipfile.ZipFile(sys.argv[1],'w',zipfile.ZIP_DEFLATED); [z.write(f) for f in sys.argv[2:]]; z.close()" \
|
|
"Provisionsmanager95-${VERSION}.zip" Provisionsmanager95.exe LIESMICH.md )
|
|
echo "$VERSION" > dist/VERSION
|
|
ls -la dist
|