Update for renamed libfile
[supercollider.git] / Packager / package
blobda0c5f8864cfdd0543dbcf0060a5c5ac78055d45
1 #!/bin/bash
3 basename=`basename $PWD`
4 if [ $basename != "Packager" ]; then
5 echo "This script must be ran from within the Packager directory."
6 exit 1
7 fi
9 if [ -d SuperCollider ]; then
10 echo "Please remove the ./SuperCollider directory before running this script."
11 exit 1
14 version=`date "+%Y-%m-%d"`
15 include_optionals=false
16 if [ `uname` = 'Darwin' ]; then
17 package_type="osx"
18 else
19 package_type="source"
22 while getopts ":v:os" Option
24 case $Option in
25 v ) version=$OPTARG
27 o ) include_optionals=true
29 s ) package_type="source"
31 esac
32 done
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"
54 else
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" -or -name scide_scapp -or -name "iPhone*" > 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/README IPHONE
68 SuperCollider-Source/xtralibs/include/libsndfile
69 SuperCollider-Source/xtralibs/include/curl
70 SuperCollider-Source/xtralibs/include/icu
71 SuperCollider-Source/xtralibs/mac
72 SuperCollider-Source/Standalone Resources
73 SuperCollider-Source/clean-compile.sh
74 SuperCollider-Source/compile.sh
75 SuperCollider-Source/Headers/app
76 SuperCollider-Source/Source/app' >> LinuxExclusions.txt
78 tar cfz "$filename" SuperCollider-Source
79 tar cfzX "$filenamelinux" LinuxExclusions.txt SuperCollider-Source
80 rm -rf SuperCollider-Source
81 exit
82 else
83 if $include_optionals; then
84 opt_options='--copy dmg_with_optionals.ds_store:/.DS_Store --copy optional/:/Optional\ Installs --copy OPTIONALS_README_OSX.rtf:/Optional\ Installs/README.rtf'
85 filename="SuperCollider-$version-With-Extras.dmg"
86 else
87 opt_options='--copy dmg_without_optionals.ds_store:/.DS_Store'
88 filename="SuperCollider-$version.dmg"
91 about_version="$version (Revision $revision)"
92 echo "About box version string:" $about_version
94 svn export -q --force ../build SuperCollider
95 cp -R ../build/SuperCollider.app ../build/scsynth ../build/sclang SuperCollider
96 cp ../build/plugins/* SuperCollider/plugins/
97 cp ../COPYING SuperCollider/COPYING
98 find SuperCollider/help/ \( -name "*.htm" -or -name "*.html" \) -exec /Developer/Tools/SetFile -c SCjm {} \;
99 defaults write $PWD/SuperCollider/SuperCollider.app/Contents/Info CFBundleVersion -string "$about_version"
100 defaults write $PWD/SuperCollider/SuperCollider.app/Contents/Info CFBundleGetInfoString -string "$version"
101 plutil -convert xml1 $PWD/SuperCollider/SuperCollider.app/Contents/Info.plist
103 # use eval to force any escapes or quotes in $opt_options to be evaluated
104 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
106 rm -rf ./SuperCollider