3 # Copyright (c) 1994-2009 by Marc Feeley, All Rights Reserved.
5 herefromroot
="prebuilt/macosx"
8 PACKAGE_SHORTNAME
="@PACKAGE_SHORTNAME@"
9 PACKAGE_NAME
="@PACKAGE_NAME@"
10 PACKAGE_VERSION
="@PACKAGE_VERSION@"
11 PACKAGE_STRING
="@PACKAGE_STRING@"
12 PACKAGE_BUGREPORT
="@PACKAGE_BUGREPORT@"
13 PACKAGE_TARNAME
="@PACKAGE_TARNAME@"
15 PKGM
="/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker"
20 SOURCE_DIR
="$INSTALL_PREFIX"
21 INSTALL_DIR
="$INSTALL_PREFIX"
24 INCLUDE_DIR
="/usr/include"
25 TITLE
="$PACKAGE_STRING ($VARIANT variant)"
26 VERSION
="`echo $PACKAGE_VERSION | sed -e s/^v//g`"
27 PKG_FILE
="`pwd`/$PACKAGE_TARNAME-macosx-$VARIANT.pkg"
28 DMG_FILE
="`pwd`/$PACKAGE_TARNAME-macosx-$VARIANT.dmg"
29 BACKGROUND_FILE
="`pwd`/gambc.tif"
30 PMPROJ_FILE
="`pwd`/gambc.pmproj"
31 WELCOME_FILE
="`pwd`/welcome.html"
32 README_FILE
="`pwd`/readme.html"
33 CONCLUSION_FILE
="`pwd`/conclusion.html"
34 EXTRAS_DIR
="`pwd`/extras"
35 DESCRIPTION
="This is the $TITLE installer"
36 PROGRAMS
="gsc gsc-script gsi gsi-script scheme-ieee-1178-1990 scheme-r4rs scheme-r5rs scheme-srfi-0 six six-script gambc-cc.bat gambc-doc.bat uninstall-gambc"
37 LIBRARIES
="libgambc@LIB_EXTENSION@ libgambcgsi@LIB_EXTENSION@ libgambcgsc@LIB_EXTENSION@"
40 instantiate_file
() # input, output
42 sed -e "s|@BIN_DIR@|$BIN_DIR|g" -e "s|@LIB_DIR@|$LIB_DIR|g" -e "s|@INCLUDE_DIR@|$INCLUDE_DIR|g" -e "s|@SOURCE_DIR@|$SOURCE_DIR|g" -e "s|@INSTALL_DIR@|$INSTALL_DIR|g" -e "s|@VERSION@|$VERSION|g" -e "s|@PACKAGE_VERSION@|$PACKAGE_VERSION|g" -e "s|@TITLE@|$TITLE|g" -e "s|@DESCRIPTION@|$DESCRIPTION|g" -e "s|@PROGRAMS@|$PROGRAMS|g" -e "s|@LIBRARIES@|$LIBRARIES|g" -e "s|@INCLUDES@|$INCLUDES|g" -e "s|@BACKGROUND_FILE@|$BACKGROUND_FILE|g" -e "s|@WELCOME_FILE@|$WELCOME_FILE|g" -e "s|@README_FILE@|$README_FILE|g" -e "s|@CONCLUSION_FILE@|$CONCLUSION_FILE|g" -e "s|@EXTRAS_DIR@|$EXTRAS_DIR|g" -e "s|@NAME@|$PACKAGE_NAME|g" -e "s|@VARIANT@|$VARIANT|g" "$1" > "$2"
47 rm -rf "$PMPROJ_FILE" "$WELCOME_FILE" "$README_FILE" "$CONCLUSION_FILE" "$PKG_FILE" "$SOURCE_DIR" "$EXTRAS_DIR"
57 if [ "$RUN_TESTS" == "0" ] ; then
58 echo "************ TESTS SKIPPED ($VARIANT variant)"
63 make check
> build-phase2-tests.out
65 cat build-phase2-tests.out
67 if fgrep
"============ ALL TESTS SUCCESSFUL" build-phase2-tests.out
> /dev
/null
; then
71 rm -f build-phase2-tests.out
73 if [ "$TESTS_SUCCESS" == "1" ] ; then
74 echo "************ TESTS SUCCESSFUL ($VARIANT variant)"
76 echo "************ TESTS FAILED ($VARIANT variant)"
88 "$SOURCE_DIR/$PACKAGE_VERSION/bin/uninstall-gambc"
93 rm -f "$SOURCE_DIR/$PACKAGE_VERSION/bin/uninstall-gambc"
95 instantiate_file
"uninstall-gambc.in" "$SOURCE_DIR/$PACKAGE_VERSION/bin/uninstall-gambc"
97 chmod 755 "$SOURCE_DIR/$PACKAGE_VERSION/bin/uninstall-gambc"
104 touch "$EXTRAS_DIR/InstallationCheck.strings"
108 for f
in $PROGRAMS ; do
110 echo "\"`expr $i + 16`\" = \"The installation process is being aborted because the file $BIN_DIR/$f exists and it was not created by the Gambit-C installer. A possible solution is to remove this file manually and restart the installer.\";" >> "$EXTRAS_DIR/InstallationCheck.strings"
116 for f
in $LIBRARIES ; do
118 echo "\"`expr $i + 16`\" = \"The installation process is being aborted because the file $LIB_DIR/$f exists and it was not created by the Gambit-C installer. A possible solution is to remove this file manually and restart the installer.\";" >> "$EXTRAS_DIR/InstallationCheck.strings"
124 for f
in $INCLUDES ; do
126 echo "\"`expr $i + 16`\" = \"The installation process is being aborted because the file $INCLUDE_DIR/$f exists and it was not created by the Gambit-C installer. A possible solution is to remove this file manually and restart the installer.\";" >> "$EXTRAS_DIR/InstallationCheck.strings"
132 for file in InstallationCheck postflight
; do
133 instantiate_file
"$file.in" "$EXTRAS_DIR/$file"
134 chmod 755 "$EXTRAS_DIR/$file"
140 for file in "$PMPROJ_FILE" "$WELCOME_FILE" "$README_FILE" "$CONCLUSION_FILE" ; do
141 instantiate_file
"$file.in" "$file"
144 plutil
-convert binary1
"$PMPROJ_FILE"
149 $PKGM -build -proj "$PMPROJ_FILE" -p "$PKG_FILE"
154 hdiutil create
-srcfolder "$PKG_FILE" -volname "$PACKAGE_STRING" -fs HFS
+ "$DMG_FILE"
167 mv "$DMG_FILE" "$rootfromhere"