diff options
author | Michal Čihař <michal@cihar.com> | 2011-01-19 08:33:59 +0100 |
---|---|---|
committer | Michal Čihař <michal@cihar.com> | 2011-01-19 08:33:59 +0100 |
commit | a92feb0ede986fd672d2fc6d642ac93084c4da62 (patch) | |
tree | b8109d1a8219f7a21ee8d7d58aeced8f8e493c3d /installer | |
parent | 35925197481d458417cadb3ec06a05278a4799e4 (diff) |
Imported Upstream version 1.29.0
Diffstat (limited to 'installer')
-rwxr-xr-x | installer/macpostinstall | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/installer/macpostinstall b/installer/macpostinstall index 2fd304e..b1c2c7b 100755 --- a/installer/macpostinstall +++ b/installer/macpostinstall @@ -1,7 +1,31 @@ -#!/bin/sh +#!/bin/sh -e -pref=`python-config --prefix` -pyver=`python -c "import sys; print('.'.join([str(x) for x in sys.version_info[:2]]))"` -# Fixed because I compile with python 2.6 +# find a Python 2.6 binary pyver=2.6 -ln -s /usr/lib/python$pyver/site-packages/gammu /Library/Python/$pyver/site-packages +for dir in /usr/bin /usr/local/bin /Library/Frameworks/Python.framework/Versions/$pyver/bin /System/Library/Frameworks/Python.framework/Versions/$pyver/bin; do + if [ -e $dir/python$pyver ]; then + PYTHON=$dir/python$pyver + break + fi +done + +if [ -z $PYTHON ]; then + echo ERROR: Unable to find a Python $pyver binary + exit 1 +fi + + +# and all of the wxPython package should be group writable + +# install a .pth file in any Python installs we can find +for dir in /Library/Python/$pyver/site-packages /Library/Frameworks/Python.framework/Versions/$pyver/lib/python$pyver/site-packages; do + if [ -d $dir ]; then + echo Writing gammu.pth in $dir + DEST=`dirname /usr/lib/python$pyver/site-packages/gammu` + cat > $dir/gammu.pth <<pthEOF +import site; site.addsitedir('$DEST') +pthEOF + fi +done + +exit 0 |