#
# Coin binary packaging for Mac OS X checklist
#

NB! The instructions below assume that you build the Universal Binary
(gcc4) version of Coin on an Intel Mac and the Legacy (gcc3) version
on a PowerPC Mac. 


1. Preparation
   -----------

* Remove old Coin installation(s) on your system, if any.

* Choose the compiler version

  Use gcc_select to choose gcc-4.0 (Mac OS 10.4 "Tiger" only) or
  gcc-3.3 (backwards compatible). Note that UB support requires gcc-4.

* Create working directory. (You can call this whatever you want.)

    mkdir Coin-$VERSION_release
    cd Coin-$VERSION_release

* Download official Coin-$VERSION.tar.gz source:

    wget ftp://ftp.coin3d.org/pub/coin/src/all/Coin-$VERSION.tar.gz

* Configure and build simage:

  Remember to --enable-universal if building the UB package!

    mkdir simage-config
    cd simage-config
    $SRCDIR/simage/configure --prefix=$PWD/../macosx/supportlibs/install --enable-universal --enable-quicktime --enable-optimization --disable-debug --disable-symbols --without-oggvorbis --without-libsndfile --libdir=$PWD/../macosx/supportlibs/lib
    make install
    cd ..

* Get freetype:

  If you have Apple's X11 SDK installed, you can just use the library
  that comes with that. 

    cp /usr/X11R6/lib/libfreetype.* macosx/supportlibs/lib/

  Or you can build freetype yourself. Remember that you need to create
  a Universal Binary if you are building the Coin UB version!


2. Build and package Coin
   ----------------------

* Unpack the source archive:

    tar xzf Coin-$VERSION.tar.gz

* Universal Binary support?

  If you want to build Universal Binaries, add --enable-universal
  to the BUILDOPTIONS in Coin-$VERSION/packaging/macosx/Makefile.in

* Building 

  Run

    MACOSX_DEPLOYMENT_TARGET=10.2 ./Coin-$VERSION/configure
    MACOSX_DEPLOYMENT_TARGET=10.2 make macosx-packages

  You will be asked for your root password after the build itself is
  complete, this is because we need to change the permissions of the
  package.

  The script will then mount the newly created disk image and ask you
  to set the background image. After setting the background image, do
  *NOT* manually unmount the disk image, it will be unmounted
  automatically.

  The above step must be done twice, once for the installer package
  and once for the framework-only package. (No need for you to do
  anything, but the script will ask you to do the same operation
  twice. This is intentional, no need to be alarmed.)


3. Verification
   ------------

  You should now have the following in macosx/

    Coin-$VERSION-no_inst.dmg
    Coin-$VERSION.dmg

o Check that you can mount the images.

o Check that you actually got Universal Binaries

    file /Volumes/Coin-$VERSION/Inventor.framework/Libraries/libCoin*.dylib
    [output should be "Mach-O universal binary with 2 architectures"]

o Check that you can run the installer

o Run through some of your pre-release tests both on PowerPC and Intel

    (e.g. check that you can build the basic glutiv binding example,
    that the UB version works both on Intel and PowerPC Macs, etc.)


4. Publishing
   ----------

o Rename the disk images

  The gcc-4 disk images should be renamed to

    Coin-$VERSION-gcc4.dmg (e.g. Coin-2.4.6-gcc4.dmg)
    Coin-$VERSION-gcc4-no_inst.dmg

  and the gcc-3 ones to 

    Coin-$VERSION-gcc3.dmg
    Coin-$VERSION-gcc3-no_inst.dmg

o Upload 

  The disk images should go into ftp://ftp.coin3d.org/pub/coin/bin/macosx/all/

o Symbolic links

  Remove the symlinks for the previous version and create symlinks for
  the new version in ftp://ftp.coin3d.org/pub/coin/bin/macosx/

o Update the coin3d.org release page with the links to the files.

