6 WS_VERSION=`sed -nre 's/VERSION_STR = "(.*)"/\1/p' setup.py`
7 BUILD_FOLDER="naja-${WS_VERSION}"
8 ZIP_NAME="${BUILD_FOLDER}.zip"
9 PY2EXE_LOG="py2exe.log"
11 WINE_PYTHON=`winepath "C:/Python27"`
12 WINE_SYS32=`winepath "C:/windows/system32"`
15 # Run py2exe build under wine
18 echo "=== Running wine python setup.py ==="
20 echo " Robolock version: ${WS_VERSION}"
21 echo " Writing log to ${PY2EXE_LOG}."
23 echo " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
24 echo " WARNING: After running please fix the naja.exe"
25 echo " checksum and executable size using PETools!"
26 echo " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
29 rm -rf "dist/${BUILD_FOLDER}"
30 mkdir -p "dist/${BUILD_FOLDER}"
31 rm -rf "dist/${ZIP_NAME}"
33 wine python setup.py py2exe >${PY2EXE_LOG} 2>&1
36 # Copy dependencies py2exe missed
39 echo "=== Copying dependencies that py2exe missed ==="
42 DEST="dist/${BUILD_FOLDER}"
44 cp -v "${WINE_PYTHON}/python27.dll" "${DEST}"
46 echo "'data' -> '${DEST}/data'"
47 cp -R data ${DEST}/data
49 echo "'${WINE_PYTHON}/Lib/site-packages/pygame' -> '${DEST}'"
50 rm -rf "${DEST}/pygame"
51 cp -R "${WINE_PYTHON}/Lib/site-packages/pygame" "${DEST}"
52 rm -rf "${DEST}/pygame/examples" "${DEST}/pygame/tests" "${DEST}/pygame/docs"
58 echo "=== Creating zip of patched py2exe dist folder ==="
60 echo " Zip file: dist/${ZIP_NAME}"
61 echo " Build folder: dist/${BUILD_FOLDER}"
66 zip -r -q "$ZIP_NAME" "$BUILD_FOLDER"
71 echo -n " "; du -sh dist/${ZIP_NAME}
72 echo -n " "; du -sh dist/${BUILD_FOLDER}