View Single Post
Posts: 3,617 | Thanked: 2,412 times | Joined on Nov 2009 @ Cambridge, UK
#3
I copied a chunk out of the main python package's post-install script (you'll need to replace the package name & path):

Code:
#!/bin/sh -e

if [ "$1" = configure ]; then
    (
        files=$(dpkg -L autocompleteeditor | sed -n '/^\/opt\/AutoCompleteEditor\/.*\.py$/p')
        /usr/bin/python2.5 /usr/lib/python2.5/py_compile.py $files
        if grep -sq '^byte-compile[^#]*optimize' /etc/python/debian_config; then
            /usr/bin/python2.5 -O /usr/lib/python2.5/py_compile.py $files
        fi
    )