# HG changeset patch
# User William Stein <wstein@gmail.com>
# Date 1199307769 25200
# Node ID 01a1e83072d0bbcc38fe1835c2f9668fb0be92a0
# Parent  e54ad032604037f4fe9e4081684e109cc464ff58
Trac #1658 -- make "sage -bdist" more verbose and produce dmg's by default on osx instead of tar balls.

diff -r e54ad0326040 -r 01a1e83072d0 sage-README-osx.txt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sage-README-osx.txt	Wed Jan 02 14:02:49 2008 -0700
@@ -0,0 +1,32 @@
+This is SAGE -- open source mathematical software.
+
+         http://www.sagemath.org
+
+**
+  These binaries are only for OS X 10.4 or 10.5.  They will not work on OS X 10.3. 
+**
+
+1) Download the dmg somewhere and double click on it.
+2) Drag the sage folder somewhere, e.g., /Applications 
+3) Use finder to visit the sage folder you just copied it and double click on the "sage" icon.
+4) Select to run it with "Terminal":
+     Choose Applications, then select "All Applications" in the
+     "Enable:" drop down.  Change the "Applications" drop down
+     to "Utilities".  On the left, scroll and select "Terminal".
+     Click "Open", then in the next dialog select "Update". 
+5) SAGE should pop up in a window.
+6) For the graphical notebook, type
+     notebook()
+   and follow the directions, which are to open firefox or safari (your choice)
+   to the URL
+       http://localhost:8000
+   If you are on a single user machine, using inotebook() is a little easier.
+7) Email
+      http://groups.google.com/group/sage-support
+   with any questions.  
+
+
+If you're an OSX guru and want to make steps 4--6 much nicer, 
+join sage-devel and tell us.  You'll be greatly appreciated 
+by a lot of people!
+           http://groups.google.com/group/sage-devel
diff -r e54ad0326040 -r 01a1e83072d0 sage-bdist
--- a/sage-bdist	Mon Dec 24 10:42:44 2007 -0800
+++ b/sage-bdist	Wed Jan 02 14:02:49 2008 -0700
@@ -37,21 +37,24 @@ if [ -d "$TMP" ]; then
    rm -rf "$TMP"
 fi
 
-mkdir $TMP
+mkdir "$TMP"
 
-cd $SAGE_ROOT
-cp -$OPT examples local makefile *.txt *.sage sage ipython matplotlibrc data $TMP/
-cp -L$OPT devel/doc/html $TMP/doc
+cd "$SAGE_ROOT"
+
+echo "Copying files over to tmp directory"
+cp -$OPT examples local makefile *.txt *.sage sage ipython matplotlibrc data "$TMP"/
+cp -L$OPT devel/doc/html "$TMP"/doc
 
 if [ -d devel/sage-main ]; then
-   mkdir $TMP/devel/
-   cp -L$OPT devel/sage-main $TMP/devel/sage-main
+   echo "Copying Sage library over"
+   mkdir "$TMP"/devel/
+   cp -L$OPT devel/sage-main "$TMP"/devel/sage-main
    cd $TMP/devel
    ln -s sage-main sage
    cd sage
    rm -rf build/lib.*
    rm -rf build/temp.*
-   cd $TMP/local/lib/python/site-packages
+   cd "$TMP"/local/lib/python/site-packages
    rm -rf sage
    ln -sf ../../../../devel/sage/build/sage .   
 fi
@@ -65,8 +68,10 @@ fi
 #   ln -s doc-main doc
 #fi
 
-cd $SAGE_ROOT
+cd "$SAGE_ROOT"
+
 if [ -d $PKGDIR ]; then
+   echo "Making empty spkg's"
    cd $PKGDIR
    mkdir $TMP/$PKGDIR
    mkdir $TMP/$PKGDIR/build
@@ -80,8 +85,21 @@ if [ -d $PKGDIR ]; then
    done
 fi
 
-cd $CUR/tmp/
-tar zcvf $TARGET.tar.gz $TARGET
+cd "$CUR"/tmp/
+if [ "$UNAME" = "Darwin" ]; then
+    cd "$TARGET"
+    mkdir x
+    echo "There will be an error about x below that you can safely ignore."
+    mv * x
+    mv x sage
+    cp sage/local/bin/sage-README-osx.txt README.txt
+    cd "$CUR"/tmp/
+    echo "Creating dmg"
+    hdiutil create -srcfolder "$TARGET" -format UDBZ "$TARGET".dmg
+else
+    echo "Creating tar.gz"
+    tar zcvf "$TARGET".tar.gz "$TARGET"
+fi
 
 if [ ! -d $SAGE_ROOT/dist ]; then
     mkdir $SAGE_ROOT/dist
@@ -91,5 +109,7 @@ if [ -d $SAGE_ROOT/dist/$TARGET ]; then
     rm -rf "$SAGE_ROOT/dist/$TARGET"
 fi
 
+echo "Moving final distribution file to $SAGE_ROOT/dist"
+
 mv $TARGET $SAGE_ROOT/dist/
-mv $TARGET.tar.gz $SAGE_ROOT/dist/
\ No newline at end of file
+mv $TARGET.* $SAGE_ROOT/dist/
