diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2017-04-29 12:11:35 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2017-04-29 12:11:35 +0200 |
commit | dcef13a23c06398c0c9b3145c08b28d1110bc169 (patch) | |
tree | df8d3227b3d71fdd356b3c1e69c62533d1759f72 /distribution/osx/gtk-bundle/xtrkcad-bundler.sh | |
parent | 3e11d9c0e6173fce8a482efed8d7f965e8bd6dfa (diff) | |
parent | 16e9630b79f0a7a90c6cedb6781175bb8b337dc1 (diff) |
Merge tag 'upstream/4.3.0'
Upstream version 4.3.0
Diffstat (limited to 'distribution/osx/gtk-bundle/xtrkcad-bundler.sh')
-rwxr-xr-x | distribution/osx/gtk-bundle/xtrkcad-bundler.sh | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/distribution/osx/gtk-bundle/xtrkcad-bundler.sh b/distribution/osx/gtk-bundle/xtrkcad-bundler.sh new file mode 100755 index 0000000..54928b0 --- /dev/null +++ b/distribution/osx/gtk-bundle/xtrkcad-bundler.sh @@ -0,0 +1,84 @@ +#!/bin/sh -x + +echo "Starting Xtrkcad-bundler" "@0" + +# Script to create Mac DMGs. +# Created 12/1/2016 +# Author Adam Richards + +version="Version" + +while getopts "v:i:h" option; do + case "${option}" in + v) version="${OPTARG}";; + i) installib="${OPTARG}";; + h) usage;; + *) usage;; + esac +done +shift "$((OPTIND-1))" + +usage() { + echo "xtrkcad-bundler -i Cmake_Install_Lib [-v Version]"; + echo " -v Version - will be appended to 'xtrkcad' in the image name"; + echo " -i Cmake_Install_Lib where the binary and share files were placed by Make"; + exit 1; + + } + +if [ -z "${installib}" ]; then + usage; + exit 1; +fi + +#copy in all shares +echo "copying shares from build to share directory" +cp -R "${installib}/share/" "share/" + +#copy in binary +echo "copying binaries from build to bin directory" +cp "${installib}/bin/xtrkcad" "bin" +cp "${installib}/bin/helphelper" "bin" + +echo "executing gtk-mac-bundler" +gtk-mac-bundler xtrkcad.bundle + +#Build dmg using template +echo "making a copy of the tenplate" +rm -f xtrkcad-template.dmg + +unzip -o xtrkcad-template.dmg.zip + +echo "mounting template copy" +rm -rf dmg +mkdir -p dmg + +hdiutil attach xtrkcad-template.dmg -quiet -noautoopen -mountpoint dmg + +#copy in bundle +echo "copying in bundle" +rm -rf "dmg/xtrkcad.app" +cp -R "bin/xtrkcad.app" "dmg/xtrkcad.app" + +#convert dmg to RO +echo "closing image" +#dev_dmg='hdiutil info | grep "dmg" | grep "Apple_HFS"' && \ +hdiutil detach dmg -force +master="xtrkcad-OSX-${version}" +rm -rf "${master}".dmg +echo "making image RO and compressed" +hdiutil convert xtrkcad-template.dmg -format UDZO -imagekey zlib-level=9 -o "${master}" + +# compress the output + +rm -f "${master}".dmg.tar.gz + +tar -cvzf "${master}".dmg.tar.gz "${master}".dmg + +mv -f "${master}".dmg.tar.gz "${installib}"/bin + +rm -rf dmg + +echo "Tarball output image file ${master}.tar.gz is in ${installib}/bin directory" + +exit 0
\ No newline at end of file |