From 16e9630b79f0a7a90c6cedb6781175bb8b337dc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sat, 29 Apr 2017 12:11:08 +0200 Subject: New upstream version 4.3.0 --- distribution/osx/gtk-bundle/xtrkcad-bundler.sh | 84 ++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100755 distribution/osx/gtk-bundle/xtrkcad-bundler.sh (limited to 'distribution/osx/gtk-bundle/xtrkcad-bundler.sh') 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 -- cgit v1.2.3