3 basename=`basename $PWD`
4 if [ $basename != "Packager" ]; then
5 echo "This script must be ran from within the Packager directory."
9 if [ -d SuperCollider
]; then
10 echo "Please remove the ./SuperCollider directory before running this script."
14 version
=`date "+%Y-%m-%d"`
15 include_optionals
=false
16 if [ `uname` = 'Darwin' ]; then
22 while getopts ":v:os" Option
27 o
) include_optionals
=true
29 s
) package_type
="source"
33 shift $
(($OPTIND - 1))
35 revision
=`svnversion -n ../`
36 if ( echo $revision |
grep "M" > /dev
/null
2>&1 ); then
37 echo "WARNING: The working copy has uncommitted changes which will be included in the package."
40 if ( echo $revision |
grep ":" > /dev
/null
2>&1 ); then
41 echo "WARNING: The working copy has mixed revision numbers (some folders had 'svn update' ran more recently than others)."
43 revision
=`echo $revision | sed -e 's/^[^:]*://;s/[A-Za-z]//'`
45 if [ $package_type == "source" ]; then
46 mkdir SuperCollider-Source
47 svn
export -q --force ..
/ SuperCollider-Source
49 if $include_optionals; then
50 cp -Rp optional SuperCollider-Source
/optional_installs
51 cp OPTIONALS_README_SOURCE.txt SuperCollider-Source
/optional_installs
/README.txt
52 filename
="SuperCollider-$version-Source-With-Extras.tar.gz"
53 filenamelinux
="SuperCollider-$version-Source-With-Extras-linux.tar.gz"
55 filename
="SuperCollider-$version-Source.tar.gz"
56 filenamelinux
="SuperCollider-$version-Source-linux.tar.gz"
59 # Here we build a list of (many) files that are useless on linux, so as to build a slimline source.tar.gz
60 find SuperCollider-Source
-iname windows
-or -iname osx
-or -name "*.xcodeproj" > LinuxExclusions.txt
61 echo 'SuperCollider-Source/SuperColliderAU
62 SuperCollider-Source/Psycollider
63 SuperCollider-Source/Resources
64 SuperCollider-Source/Intermediate Build Files
65 SuperCollider-Source/README OS X
66 SuperCollider-Source/README WINDOWS
67 SuperCollider-Source/libsndfile
68 SuperCollider-Source/curl
69 SuperCollider-Source/Standalone Resources
70 SuperCollider-Source/clean-compile.sh
71 SuperCollider-Source/compile.sh
72 SuperCollider-Source/Headers/app
73 SuperCollider-Source/Source/app' >> LinuxExclusions.txt
75 tar cfz
"$filename" SuperCollider-Source
76 tar cfzX
"$filenamelinux" LinuxExclusions.txt SuperCollider-Source
77 rm -rf SuperCollider-Source
80 if $include_optionals; then
81 opt_options
='--copy dmg_with_optionals.ds_store:/.DS_Store --copy optional/:/Optional\ Installs --copy OPTIONALS_README_OSX.rtf:/Optional\ Installs/README.rtf'
82 filename
="SuperCollider-$version-With-Extras.dmg"
84 opt_options
='--copy dmg_without_optionals.ds_store:/.DS_Store'
85 filename
="SuperCollider-$version.dmg"
88 about_version
="$version (Revision $revision)"
89 echo "About box version string:" $about_version
91 svn
export -q --force ..
/build SuperCollider
92 cp -R ..
/build
/SuperCollider.app ..
/build
/scsynth ..
/build
/sclang SuperCollider
93 cp ..
/build
/plugins
/* SuperCollider
/plugins
/
94 cp ..
/COPYING SuperCollider
/COPYING
95 find SuperCollider
/help
/ \
( -name "*.htm" -or -name "*.html" \
) -exec /Developer
/Tools
/SetFile
-c SCjm
{} \
;
96 defaults
write $PWD/SuperCollider
/SuperCollider.app
/Contents
/Info CFBundleVersion
-string "$about_version"
97 defaults
write $PWD/SuperCollider
/SuperCollider.app
/Contents
/Info CFBundleGetInfoString
-string "$version"
98 plutil
-convert xml1
$PWD/SuperCollider
/SuperCollider.app
/Contents
/Info.plist
100 # use eval to force any escapes or quotes in $opt_options to be evaluated
101 eval './pkg-dmg --verbosity 0 --source ./SuperCollider --target "$filename" --sourcefile --volname SuperCollider --mkdir /.background --copy background.png:/.background/background.png --symlink /Applications:/Applications '$opt_options
103 rm -rf .
/SuperCollider