_destdir=opt/apps/larch post_install() { post_upgrade } post_upgrade() { echo "byte-compile python modules ..." python2 -m compileall -l ${_destdir}/cli python2 -m compileall -l ${_destdir}/gui python2 -m compileall -l ${_destdir}/gui/front } pre_remove() { pre_upgrade } pre_upgrade() { echo "Remove .pyc files ..." rm -f ${_destdir}/cli/*.pyc rm -f ${_destdir}/gui/*.pyc rm -f ${_destdir}/gui/front/*.pyc } op=$1 shift $op $*