# HG changeset patch # User Dirk Olmes # Date 1411188287 -7200 # Node ID d666b9fe5663c99af7b2fc0134f642dfa3347b03 # Parent fc866be7843cbe84afe5dbacb17715ccddc91704 dist.sh builds an executable zip file diff -r fc866be7843c -r d666b9fe5663 .hgignore --- a/.hgignore Sat Sep 20 06:44:17 2014 +0200 +++ b/.hgignore Sat Sep 20 06:44:47 2014 +0200 @@ -2,4 +2,5 @@ .eric5project .pyc PyQtLib -Ui_* \ No newline at end of file +RemoteViewer.zip +Ui_* diff -r fc866be7843c -r d666b9fe5663 Makefile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Makefile Sat Sep 20 06:44:47 2014 +0200 @@ -0,0 +1,12 @@ +.PHONY: remote_viewer pyqt_lib clean + +all: remote_viewer pyqt_lib + +remote_viewer: + $(MAKE) -C RemoteViewer + +pyqt_lib: + $(MAKE) -C PyQtLib + +clean: + rm $(ZIP_FILE) diff -r fc866be7843c -r d666b9fe5663 RemoteViewer/Makefile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/RemoteViewer/Makefile Sat Sep 20 06:44:47 2014 +0200 @@ -0,0 +1,17 @@ +# find all .ui files and generate corresponding filenames ending in .py +UI_PY_FILES=$(patsubst %.ui, Ui_%.py, $(wildcard *.ui)) +RC_FILES = $(patsubst %.qrc, %_rc.py, $(wildcard *.qrc)) + +all: $(UI_PY_FILES) $(RC_FILES) + +Ui_%.py: %.ui + pyuic4 -o $@ $< + +%_rc.py: %.qrc + pyrcc4 -o $@ $< + +.PHONY: clean + +clean: + rm $(UI_PY_FILES) + rm *.pyc diff -r fc866be7843c -r d666b9fe5663 dist.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dist.sh Sat Sep 20 06:44:47 2014 +0200 @@ -0,0 +1,26 @@ +#!/bin/bash + +ZIP_FILE="RemoteViewer.zip" + +if [ -d $ZIP_FILE ]; then + rm $ZIP_FILE +fi + +# make sure all resources are generated before byte-compiling +make + +python -m compileall . + +for file in `find . -name \*\.pyc -print`; do + echo $file + if [[ $file =~ (.*)__pycache__/(.*)\.cpython-..(.*) ]]; then + target="${BASH_REMATCH[1]}${BASH_REMATCH[2]}${BASH_REMATCH[3]}" + cp $file $target + rm $file + else + echo 'no match' + exit 1 + fi +done + +find . -name \*.pyc -print | xargs zip -@ $ZIP_FILE