#!/usr/bin/perl $II2PKGDIR = $ENV{"II2PKGDIR"}; $II2INSTALLDIR = $ENV{"II2INSTALLDIR"}; $II2RESOURCES = $ENV{"II2RESOURCES"}; $II2DOSERVER = $ENV{"II2DOSERVER"}; $II2BUILDSTAMP = $ENV{"II2BUILDSTAMP"}; if (${II2BUILDSTAMP} < 1223415500) { warn "### You need at least i-Installer 2.94 for this package. Bailing out...\n"; exit 1; } $PROGNAME = `"${II2RESOURCES}/basename" "$0"`; chomp( $PROGNAME); # Load shared stuff if (not -e "$ENV{'II2RESOURCES'}/ii2plfuncs.pm") { my $msg = "i-Installer is damaged. Perl support routines are missing."; warn "### ${PROGNAME}: ${msg}"; if (exists $ENV{'II2DOSERVER'}) { `"$ENV{'II2RESOURCES'}/doalerter" -s "$ENV{'II2DOSERVER'}" -V -t Alert -T "i-Installer isd damaged" -I "${msg}" -1 "Accept"`; } exit 1; } require "$ENV{'II2RESOURCES'}/ii2plfuncs.pm"; print "### ${PROGNAME}: Started...\n"; if (${II2INSTALLDIR} eq "") { print "### ${PROGNAME}: II2INSTALLDIR is empty. Bailing out...\n"; exit( 1); } if ( ! -w "${II2INSTALLDIR}/share" or ! -d "${II2INSTALLDIR}/share") { print "### ${PROGNAME}: Cannot write in directories ${II2INSTALLDIR}/share. Bailing out...\n"; exit( 1); } $ENV{"PATH"} = "${II2INSTALLDIR}/bin:$ENV{'PATH'}"; #ii2fixPreLeopardX11(); # Unused because -mmacosx compile flag does not work for X11 if ( -e "${II2INSTALLDIR}/bin/gs-noX11" ) { my $darwinmainversion=`/usr/bin/uname -r|/usr/bin/sed 's/\..*//'`; chomp( $darwinmainversion); if ($darwinmainversion < 9) { print "### ${PROGNAME}: Pre-Leopard. No X11 support\n"; system( "rm \"${II2INSTALLDIR}/bin/gs\""); system( "ln -s gs-noX11 \"${II2INSTALLDIR}/bin/gs\""); if (not -e '/usr/local/lib/libfontconfig.1.dylib') { print "### ${PROGNAME}: Non-X11 fontconfig not detected.\n"; `"${II2RESOURCES}/doalerter" -s "${II2DOSERVER}" -V -t Alert -T "Fontconfig missing" -I "You do not have a separate fontconfig and X11 is not supported on pre-Leopard systems for this Ghostscript distribution. You need to install a separate fontconfig (i-Package available) for this Ghostscript to work.\n\nAs it is now, it will not work." -1 "Understood"`; } } else { if ( -e "/usr/X11/lib/libXt.6.dylib" ) { print "### ${PROGNAME}: Detected X11 installation.\n"; system( "rm \"${II2INSTALLDIR}/bin/gs\""); system( "ln -s gs-X11 \"${II2INSTALLDIR}/bin/gs\""); } else { print "### ${PROGNAME}: X11 installation not detected.\n"; system( "rm \"${II2INSTALLDIR}/bin/gs\""); system( "ln -s gs-noX11 \"${II2INSTALLDIR}/bin/gs\""); if (not -e '/usr/local/lib/libfontconfig.1.dylib') { print "### ${PROGNAME}: Non-X11 fontconfig not detected.\n"; `"${II2RESOURCES}/doalerter" -s "${II2DOSERVER}" -V -t Alert -T "Fontconfig missing" -I "You do not have Apple's X11 installed (which contains fontconfig) and also no separate fontconfig. You need to install Apple's X11 and reconfigure this i-Package or install a separate fontconfig (i-Package available) for this Ghostscript to work.\n\nAs it is now, it will not work." -1 "Understood"`; } } } } else { warn "### ${PROGNAME}: You are running this script on a distribution that cannot switch between X11 and non-X11 operation.\n"; } #$doresult = `"${II2RESOURCES}/doalerter" -s "${II2DOSERVER}" -V -t Alert -T "Add TeX fonts to GS map?" -I "Would you like me to locate TeX and system type1 fonts and add them to the Ghostscript map? If you have no TeX installed, select No. You can always add them later by just re-running the configuration stage from this package." -1 "Yes" -3 "No"`; #chomp( $doresult); # #if ($doresult eq "Yes") { # $gsversion = `"${II2INSTALLDIR}"/bin/gs --version`; # chomp( $gsversion); # print "### ${PROGNAME}: Adding fonts to map for gs $gsversion (please wait) ...\n"; # system "\"${II2PKGDIR}\"/gsbuildfontmap --gsprefix=\"${II2INSTALLDIR}\" --gsversion=\"$gsversion\""; #} $doresult = `"${II2RESOURCES}/doalerter" -s "${II2DOSERVER}" -V -t Alert -T "Add ${II2INSTALLDIR}/bin to CLI environment?" -I "Would you like me to add ${II2INSTALLDIR}/bin to your command line environment? You can always add it later by just re-running the configuration stage from this package. Say yes if you want to be able to use the software from the command line." -1 "Yes" -3 "No"`; chomp( $doresult); if ($doresult eq "Yes") { print "### ${PROGNAME}: Adding ${II2INSTALLDIR}/bin to csh and sh startup files...\n"; system "\"${II2PKGDIR}\"/setloginpath /usr/local/bin"; } warn "### ${PROGNAME}: Finished.\n"; print "### ${PROGNAME}: Finished.\n"; exit( 0); # $Id: ghostscript-8.configure 118 2008-10-04 09:51:34Z gctwnl $