Append version to PyInstaller packages

This commit is contained in:
iabdalkader 2015-08-19 18:17:39 +02:00
parent 3341c894c5
commit 9f4664c2b8
2 changed files with 11 additions and 7 deletions

View File

@ -31,7 +31,7 @@ exe = EXE(pyz,
upx=True,
console=False )
import shutil
import sys, shutil
# remove util dir if it exists
util_dir = 'util'
@ -54,13 +54,11 @@ if platform.system() == "Linux":
else:
data_tree += Tree('C:/Python27/Lib/site-packages/gtk-2.0/runtime/share/gtksourceview-2.0', prefix='share/gtksourceview-2.0')
coll = COLLECT(exe,
data_tree,
strip=None,
upx=True,
name='openmv')
name=sys.argv[2])
# cleanup
if os.path.exists(util_dir):
shutil.rmtree(util_dir)

View File

@ -3,11 +3,17 @@
# Execute in openmv/user ./mkpkg.sh
DIST_DIR=dist
BUILD_DIR=build
OPENMV_DIR=openmv
PACKAGE=$(python -c "import sys,platform; print('openmv_'+sys.platform+'_'+platform.machine()+'.zip'.lower())")
OPENMV_DIR=openmv_$1
PACKAGE=$(python -c "import sys,platform; print('openmv_'+sys.platform+'_'+platform.machine()+'_$1.zip'.lower())")
SPEC_FILE=openmv-ide.spec
# Check args
if [ "$#" = "0" ]; then
echo "usage mkpkg <version>"
exit 1
fi
rm -fr $DIST_DIR $BUILD_DIR $PACKAGE
pyinstaller $SPEC_FILE
pyinstaller $SPEC_FILE $OPENMV_DIR
(cd $DIST_DIR && zip ../$PACKAGE -r $OPENMV_DIR)
rm -fr $DIST_DIR $BUILD_DIR