aboutsummaryrefslogtreecommitdiff
path: root/tools/darwin/packaging/xbmc-osx/mkdmg-xbmc-osx.sh
blob: 47c8db2d830b3dabaa1e7cece4f170bc0f4ccf77 (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
#!/bin/sh

# usage: ./mkdmg-xbmc-osx.sh release/debug (case insensitive)
# Allows us to run mkdmg-xbmc-osx.sh from anywhere in the three, rather than the tools/darwin/packaging/xbmc-osx folder only
SWITCH=`echo $1 | tr [A-Z] [a-z]`
DIRNAME=`dirname $0`

if [ ${SWITCH:-""} = "debug" ]; then
  echo "Packaging Debug target for OSX"
  XBMC="$DIRNAME/../../../../build/Debug/XBMC.app"
elif [ ${SWITCH:-""} = "release" ]; then
  echo "Packaging Release target for OSX"
  XBMC="$DIRNAME/../../../../build/Release/XBMC.app"
else
  echo "You need to specify the build target"
  exit 1 
fi

if [ ! -d $XBMC ]; then
  echo "XBMC.app not found! are you sure you built $1 target?"
  exit 1
fi
ARCHITECTURE=`file $XBMC/Contents/MacOS/XBMC | awk '{print $NF}'`

PACKAGE=org.xbmc.xbmc-osx

VERSION=13.1
REVISION=0~rc1
ARCHIVE=${PACKAGE}_${VERSION}-${REVISION}_macosx-intel-${ARCHITECTURE}

echo Creating $PACKAGE package version $VERSION revision $REVISION
${SUDO} rm -rf $DIRNAME/$ARCHIVE

if [ -e "/Volumes/$ARCHIVE" ]
then 
  umount /Volumes/$ARCHIVE
fi

$DIRNAME/dmgmaker.pl $XBMC $ARCHIVE

echo "done"