X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=scripts%2Fbuild%2Fmacosx_makePackage.sh;fp=scripts%2Fbuild%2Fmacosx_makePackage.sh;h=35b4f884839ff0b3c4f7531397a26b0352653ff1;hp=0000000000000000000000000000000000000000;hb=335e3cf6203327b3ce1ee6e47c09a8139232317c;hpb=35a00d1e582573fe782e02c02a7c0060c532e4eb diff --git a/scripts/build/macosx_makePackage.sh b/scripts/build/macosx_makePackage.sh new file mode 100755 index 00000000..35b4f884 --- /dev/null +++ b/scripts/build/macosx_makePackage.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +myname=$0 +if [ -s "$myname" ] && [ -x "$myname" ]; then + # $myname is already a valid file name + + mypath=$myname +else + case "$myname" in + /*) exit 1;; # absolute path - do not search PATH + *) + # Search all directories from the PATH variable. Take + # care to interpret leading and trailing ":" as meaning + # the current directory; the same is true for "::" within + # the PATH. + + # Replace leading : with . in PATH, store in p + p=${PATH/#:/.:} + # Replace trailing : with . + p=${p//%:/:.} + # Replace :: with :.: + p=${p//::/:.:} + # Temporary input field separator, see FAQ #1 + OFS=$IFS IFS=: + # Split the path on colons and loop through each of them + for dir in $p; do + [ -f "$dir/$myname" ] || continue # no file + [ -x "$dir/$myname" ] || continue # not executable + mypath=$dir/$myname + break # only return first matching file + done + # Restore old input field separator + IFS=$OFS + ;; + esac +fi + +if [ ! -f "$mypath" ]; then + echo >&2 "cannot find full path name: $myname" + exit 1 +fi + +SCRIPTDIR=$(dirname $mypath) +QUASSEL_VERSION=$(git-describe) +BUILDTYPE=$1 +if [[ $BUILDTYPE = "Core" ]] || [[ $BUILDTYPE = "Client" ]]; then + QUASSEL_DMG="Quassel${BUILDTYPE}_MacOSX-universal_${QUASSEL_VERSION}.dmg" + mkdir $BUILDTYPE + if [[ $BUILDTYPE = "Client" ]]; then + cp -r Quassel\ Client.app Client/ + ${SCRIPTDIR}/macosx_DeployApp.py "Client/Quassel Client.app" + else + cp quasselcore Core/ + ${SCRIPTDIR}/macosx_DeployApp.py --nobundle Core + fi + hdiutil create -srcfolder ${BUILDTYPE} -format UDBZ -volname "Quassel ${BUILDTYPE} - ${QUASSEL_VERSION}" "Quassel${BUILDTYPE}_MacOSX-universal_${QUASSEL_VERSION}.dmg" >/dev/null +else + echo >&2 "Valid parameters are \"Client\" or \"Core\"" +fi