2 ## This is a shell script to automatically create a gnuplot distribution
3 ## for Mac OS X. It will download and build a source tarball and create
4 ## a disk image with a standard GUI installer and folders with supporting
5 ## files (ReadMe, docs in PDF and demos).
7 ## The utility "freeze" from the application Iceberg is required, see
8 ## http://s.sudre.free.fr/Software/Iceberg.html
10 ## 2004-10-21 Per Persson, persquare@users.sf.net
17 ## No changes needed below this line
19 echo "==== Creating distro of gnuplot $VERSION$BETA"
21 TARBALL="gnuplot-$VERSION.tar.gz"
22 WORK_DIR="$DISTRO_DIR/work"
23 SRC_DIR="$WORK_DIR/gnuplot-$VERSION"
24 BUILD_DIR="$DISTRO_DIR/build"
25 PRODUCTS_DIR="$BUILD_DIR/products"
26 DMG_ROOT="$BUILD_DIR/dmg_root"
28 ## Always remove product
29 rm -rf $BUILD_DIR/Gnuplot-$VERSION$BETA.dmg
31 if [ "$1" = "pack" ]; then
32 echo "*** Warning skipping build"
34 echo "Setting up directories"
38 if [ ! -d $WORK_DIR ]; then
41 (cd $WORK_DIR; rm -rf $SRC_DIR)
48 echo "Fetching tarball to $WORK_DIR"
49 if [ ! -f $WORK_DIR/$TARBALL ]; then
50 curl -o $WORK_DIR/$TARBALL http://heanet.dl.sourceforge.net/sourceforge/gnuplot/$TARBALL
57 echo "Configuring in $SRC_DIR"
60 ./configure --prefix=/usr/local \
61 --without-gd --without-png
63 echo "#undef'ing HAVE_STPCPY which didn't exist prior to 10.3"
66 cp config.h config_10_3.h
67 sed "s/#define HAVE_STPCPY 1/\/\* #undef HAVE_STPCPY \*\//g" < config.h > config_10_2.h
68 cp config_10_2.h config.h
71 echo "Building in $SRC_DIR"
77 echo "Installing in $PRODUCTS_DIR"
80 make install DESTDIR=$PRODUCTS_DIR
83 echo "Copying demo files to $DMGROOT/Demo"
84 cp $SRC_DIR/demo/* $DMG_ROOT/Demo/.
85 rm -f $DMG_ROOT/demo/Make*
86 rm -f $DMG_ROOT/demo/webify.pl
93 dvipdfm -p a4 -x 1.25in gpcard.dvi
102 echo "Copying docs to $DMGROOT/Docs"
103 cp $SRC_DIR/docs/{gnuplot,gpcard}.pdf $DMG_ROOT/Docs/.
104 cp $SRC_DIR/tutorial/tutorial.pdf $DMG_ROOT/Docs/gnuplot_LateX_tutorial.pdf
105 cp $SRC_DIR/{FAQ,README,Copyright} $DMG_ROOT/Docs/.
108 echo "==== Making distro ===="
109 echo "gnuplot $VERSION$BETA for Mac OS X binary distribution" > build.log
110 echo "Dependencies" >> build.log
111 otool -L $PRODUCTS_DIR/usr/local/bin/gnuplot | tee -a build.log
112 otool -L $PRODUCTS_DIR/usr/local/libexec/gnuplot/$SHORTVER/gnuplot_x11 | tee -a build.log
113 echo "Installer contents" >> build.log
114 lsbom $DMG_ROOT/gnuplot.pkg/Contents/Archive.bom | tee -a build.log
116 echo "---- Packing up ----"
117 freeze gnuplot.packproj
119 echo "---- Creating DMG ----"
120 cp $DISTRO_DIR/ReadMe.rtf $DMG_ROOT/.
121 hdiutil create -volname Gnuplot-$VERSION -fs HFS+ -srcfolder $DMG_ROOT $BUILD_DIR/Gnuplot-$VERSION$BETA.dmg
123 echo "---- Done ----"