summaryrefslogtreecommitdiffstats
path: root/packaging/osx/deluged
diff options
context:
space:
mode:
authorCalum Lind <calumlind+deluge@gmail.com>2015-08-21 10:58:30 +0200
committerCalum Lind <calumlind+deluge@gmail.com>2015-08-21 10:58:30 +0200
commitd96633f3f7b8510eca51cd41d0a8611bb6f2f3dc (patch)
treedb0938c92b116340c885b1a3554887d5bcb03b48 /packaging/osx/deluged
parentRevert "Remove generated javascript gettext file from git" (diff)
downloaddeluge-d96633f3f7b8510eca51cd41d0a8611bb6f2f3dc.tar.xz
deluge-d96633f3f7b8510eca51cd41d0a8611bb6f2f3dc.zip
Create a packaging directory
Diffstat (limited to 'packaging/osx/deluged')
-rwxr-xr-xpackaging/osx/deluged66
1 files changed, 66 insertions, 0 deletions
diff --git a/packaging/osx/deluged b/packaging/osx/deluged
new file mode 100755
index 000000000..011dbb745
--- /dev/null
+++ b/packaging/osx/deluged
@@ -0,0 +1,66 @@
+#!/bin/bash
+
+EXEC="exec"
+
+name="`basename $0`"
+if [[ "$0" == `pwd`* ]] || [[ "$0" == "/"* ]]; then
+ full_path="$0"
+else
+ full_path="`pwd`/$0"
+fi
+tmp=`dirname "$full_path"`
+tmp=`dirname "$tmp"`
+bundle=`dirname "$tmp"`
+bundle_contents="$bundle"/Contents
+bundle_macos="$bundle_contents"/MacOS
+bundle_res="$bundle_contents"/Resources
+bundle_lib="$bundle_res"/lib
+bundle_data="$bundle_res"/share
+bundle_etc="$bundle_res"/etc
+
+export DYLD_LIBRARY_PATH="$bundle_lib"
+export XDG_CONFIG_DIRS="$bundle_etc"/xdg
+export XDG_DATA_DIRS="$bundle_data"
+
+#Set $PYTHON to point inside the bundle
+export PYTHON="$bundle_macos/Deluge-python"
+export PYTHONHOME="$bundle_res"
+#Add the bundle's python modules
+PYTHONPATH="$bundle_lib:$PYTHONPATH"
+PYTHONPATH="$bundle_lib/python/lib-dynload/:$PYTHONPATH"
+PYTHONPATH="$bundle_lib/python/:$PYTHONPATH"
+export PYTHONPATH
+
+# We need a UTF-8 locale.
+lang=`defaults read .GlobalPreferences AppleLocale 2>/dev/null`
+if test "$?" != "0"; then
+ lang=`defaults read .GlobalPreferences AppleCollationOrder 2>/dev/null | sed 's/_.*//'`
+fi
+LANG=""
+if test "$lang" != ""; then
+ LANG="`grep \"\`echo $lang\`_\" /usr/share/locale/locale.alias | \
+ tail -n1 | sed 's/\./ /' | awk '{print $2}'`"
+fi
+if test "$LANG" == ""; then
+ export LANG="C"
+else
+ export LANG="$LANG.utf8"
+fi
+
+if test -f "$bundle_lib/charset.alias"; then
+ export CHARSETALIASDIR="$bundle_lib"
+fi
+
+# Extra arguments can be added in environment.sh.
+EXTRA_ARGS=
+if test -f "$bundle_res/environment.sh"; then
+ source "$bundle_res/environment.sh"
+fi
+
+# Strip out the argument added by the OS.
+if [ "x`echo "x$1" | sed -e "s/^x-psn_.*//"`" == "x" ]; then
+ shift 1
+fi
+
+# Note that we're calling $PYTHON here to override the version used.
+$EXEC "$PYTHON" "$bundle_contents/MacOS/deluged-bin" "$@"