you can now lock the positions of the docks (inputline, chat monitor, topic) which...
[quassel.git] / scripts / build / macosx_makePackage.sh
1 #!/bin/bash
2
3 myname=$0
4 if [ -s "$myname" ] && [ -x "$myname" ]; then
5     # $myname is already a valid file name
6
7     mypath=$myname
8 else
9     case "$myname" in
10     /*) exit 1;;             # absolute path - do not search PATH
11     *)
12         # Search all directories from the PATH variable. Take
13         # care to interpret leading and trailing ":" as meaning
14         # the current directory; the same is true for "::" within
15         # the PATH.
16     
17         # Replace leading : with . in PATH, store in p
18         p=${PATH/#:/.:}
19         # Replace trailing : with .
20         p=${p//%:/:.}
21         # Replace :: with :.:
22         p=${p//::/:.:}
23         # Temporary input field separator, see FAQ #1
24         OFS=$IFS IFS=:
25         # Split the path on colons and loop through each of them
26         for dir in $p; do
27                 [ -f "$dir/$myname" ] || continue # no file
28                 [ -x "$dir/$myname" ] || continue # not executable
29                 mypath=$dir/$myname
30                 break           # only return first matching file
31         done
32         # Restore old input field separator
33         IFS=$OFS
34         ;;
35     esac
36 fi
37
38 if [ ! -f "$mypath" ]; then
39     echo >&2 "cannot find full path name: $myname"
40     exit 1
41 fi
42
43 SCRIPTDIR=$(dirname $mypath)
44 QUASSEL_VERSION=$(git-describe)
45 BUILDTYPE=$1
46 if [[ $BUILDTYPE = "Core" ]] || [[ $BUILDTYPE = "Client" ]]; then
47     QUASSEL_DMG="Quassel${BUILDTYPE}_MacOSX-universal_${QUASSEL_VERSION}.dmg"
48     mkdir $BUILDTYPE
49     if [[ $BUILDTYPE = "Client" ]]; then
50         cp -r Quassel\ Client.app Client/
51         ${SCRIPTDIR}/macosx_DeployApp.py "Client/Quassel Client.app"
52     else
53         cp quasselcore Core/
54         ${SCRIPTDIR}/macosx_DeployApp.py --nobundle Core
55     fi
56     hdiutil create -srcfolder ${BUILDTYPE} -format UDBZ -volname "Quassel ${BUILDTYPE} - ${QUASSEL_VERSION}" "Quassel${BUILDTYPE}_MacOSX-universal_${QUASSEL_VERSION}.dmg" >/dev/null
57 else
58     echo >&2 "Valid parameters are \"Client\" or \"Core\""
59 fi