summaryrefslogtreecommitdiffstats
path: root/osx/make-app
blob: 19062ce45ea8afd5305dfbdcda95157b30eb8c56 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash

APPDIR="./app/Deluge.app"
RSCDIR="${APPDIR}/Contents/Resources"
LIBDIR="${RSCDIR}/lib"

function msg() { echo "==> $1"; }

echo "*** Packaging Deluge.app to $APPDIR..."

msg "Clearing app dir"
rm -fr $APPDIR

msg "Fixing permissions on file we will need to relocate"
if [ ! -z "${JHBUILD_PREFIX}" ]; then
    chmod 755 "${JHBUILD_PREFIX}/lib/"libpython*.dylib
    chmod 755 "${JHBUILD_PREFIX}/lib/"libssl*.dylib
    chmod 755 "${JHBUILD_PREFIX}/lib/"libcrypto*.dylib
fi

chmod 755 deluge deluge-web deluge-console deluged

msg "Calling gtk-mac-bundler"
gtk-mac-bundler deluge.bundle

msg "Unzip site-packages and make python softlink without version number"
pushd ${LIBDIR} || exit 1
ln -sf python* python
cd python
unzip -nq site-packages.zip
rm site-packages.zip
popd

msg "Replacing deluge by its egg..."
rm -fr ${LIBDIR}/python/deluge
rsync -rpl $JHBUILD_PREFIX/lib/python2.7/site-packages/deluge-*.egg "${LIBDIR}/python/"

msg "Clean unnecessary files"
find $APPDIR -name "*.la" -exec rm -f {} \;  # Should not be packaged
find $APPDIR -name "*.pyo" -exec rm -f {} \; # Just duplicates
rm -fr $LIBDIR/pygtk/2.0/*demo*

echo "*** Packaging done:`du -hs $APPDIR | cut -f 1`"