source: orange/install-scripts/mac/bundle-build-hg.sh @ 10277:f094769e5b4d

Revision 10277:f094769e5b4d, 3.0 KB checked in by ales_erjavec, 2 years ago (diff)

Printing more useful info.

  • Property exe set to *
Line 
1#!/bin/bash -e
2#
3# Build the orange Mac OSX bundle
4#
5# ./bundle-build-hg.sh work_dir revision bundle_output_file
6# ./bundle-build-hg.sh /private/tmp tip /private/tmp/orange-bundle-hg-tip.dmg
7#
8
9WORK_DIR=$1
10REVISION=$2
11BUNDLE=$3
12
13TMP_BUNDLE_DIR=${WORK_DIR}/bundle
14REPOS_DIR=${WORK_DIR}/repos
15
16# Remove leftovers if any
17if [ -e $TMP_BUNDLE_DIR ]; then
18    rm -rf $TMP_BUNDLE_DIR
19fi
20
21echo "Preaparing the bundle template"
22svn export --non-interactive http://orange.biolab.si/svn/orange/externals/trunk/install-scripts/mac/bundle/ $TMP_BUNDLE_DIR
23
24# Make repos dir if it does not yet exist
25if [ ! -e $REPOS_DIR ]; then
26    mkdir $REPOS_DIR
27fi
28
29echo "Checkouting and building orange"
30echo "==============================="
31./bundle-inject-hg.sh https://bitbucket.org/biolab/orange orange $REVISION $REPOS_DIR ${TMP_BUNDLE_DIR}/Orange.app
32
33echo "Checkouting and building bioinformatics addon"
34echo "============================================="
35./bundle-inject-hg.sh https://bitbucket.org/biolab/orange-addon-bioinformatics bioinformatics $REVISION $REPOS_DIR ${TMP_BUNDLE_DIR}/Orange.app
36
37echo "Checkouting and building text addon"
38echo "==================================="
39./bundle-inject-hg.sh https://bitbucket.org/biolab/orange-addon-text text $REVISION $REPOS_DIR ${TMP_BUNDLE_DIR}/Orange.app
40
41echo "Removing unnecessary files."
42find $TMP_BUNDLE_DIR \( -name '*~' -or -name '*.bak' -or -name '*.pyc' -or -name '*.pyo' -or -name '*.pyd' \) -exec rm -rf {} ';'
43
44   
45echo "Preparing the .dmg image"
46echo "========================"
47
48# Makes a link to Applications folder
49ln -s /Applications/ $TMP_BUNDLE_DIR/Applications
50
51echo "Fixing bundle permissions."
52
53{ chown -Rh root:wheel $TMP_BUNDLE_DIR; } || { echo "Could not fix bundle permissions"; }
54
55echo "Creating temporary image with the bundle."
56
57TMP_BUNDLE=${WORK_DIR}/bundle.dmg
58rm -f $TMP_BUNDLE
59
60hdiutil detach /Volumes/Orange -force || true
61hdiutil create -format UDRW -volname Orange -fs HFS+ -fsargs "-c c=64,a=16,e=16" -srcfolder $TMP_BUNDLE_DIR $TMP_BUNDLE
62MOUNT_OUTPUT=`hdiutil attach -readwrite -noverify -noautoopen $TMP_BUNDLE | egrep '^/dev/'`
63DEV_NAME=`echo -n "$MOUNT_OUTPUT" | head -n 1 | awk '{print $1}'`
64MOUNT_POINT=`echo -n "$MOUNT_OUTPUT" | tail -n 1 | awk '{print $3}'`
65
66# Makes the disk image window open automatically when mounted
67bless -openfolder "$MOUNT_POINT"
68# Hides background directory even more
69/Developer/Tools/SetFile -a V "$MOUNT_POINT/.background/"
70# Sets the custom icon volume flag so that volume has nice Orange icon after mount (.VolumeIcon.icns)
71/Developer/Tools/SetFile -a C "$MOUNT_POINT"
72
73# Might mot have permissions to do this
74{ rm -rf "$MOUNT_POINT/.Trashes/"; } || { echo "Could not remove $MOUNT_POINT/.Trashes/"; }
75
76{ rm -rf "$MOUNT_POINT/.fseventsd/"; } || { echo "Could not remove $MOUNT_POINT/.fseventsd/"; }
77
78hdiutil detach "$DEV_NAME" -force
79
80echo "Converting temporary image to a compressed image."
81
82if [ -e $BUNDLE ]; then
83    rm -f $BUNDLE
84fi
85
86hdiutil convert $TMP_BUNDLE -format UDZO -imagekey zlib-level=9 -o $BUNDLE
87
88echo "Cleaning up."
89rm -f $TMP_BUNDLE
90rm -rf $TMP_BUNDLE_DIR
91
92true
Note: See TracBrowser for help on using the repository browser.