1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150
|
#!/bin/sh
#
# Installation script for PyXPlot version 0.6.3.1
#
# The code in this file is part of PyXPlot
# <http://www.pyxplot.org.uk>
#
# Copyright (C) 2006-7 Dominic Ford <coders@pyxplot.org.uk>
#
# $Id: configure 52 2007-03-15 17:13:51Z rpc25 $
#
# PyXPlot is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# You should have received a copy of the GNU General Public License along with
# PyXPlot; if not, write to the Free Software Foundation, Inc., 51 Franklin
# Street, Fifth Floor, Boston, MA 02110-1301, USA
# ----------------------------------------------------------------------------
# 1. TEST THE ECHO COMMAND TO SEE WHICH VARIANT WE HAVE
case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
*c*,-n*) ECHO_N= ECHO_C='
' ECHO_T=' ' ;;
*c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
*) ECHO_N= ECHO_C='\c' ECHO_T= ;;
esac
# 2. CHECK FOR DEPENDENCIES
for prog in "latex " "convert"
do
echo $ECHO_N "Checking for ${prog} ............. $ECHO_C"
whichout=`which ${prog} 2> /dev/null`
if [ "`echo $whichout | sed 's/\([a-z]*\).*/\1/'`" = "no" ] ; then whichout="" ; fi
if [ "$whichout" != "" ] ; then echo "YES"
else echo "NO" ; echo "ERROR: Required program ${prog} could not be found." ; exit
fi
done
# 3. FIND PYTHON
PYTHON_COMMAND=""
PYTHON_PACKSMISSING_COMMAND=""
for pyprog in "python2.3" "python2.4" "python2.5" "python "
do
echo $ECHO_N "Checking for ${pyprog} ............. $ECHO_C"
pyprogpath=`which ${pyprog} 2> /dev/null`
if [ "`echo $pyprogpath | sed 's/\([a-z]*\).*/\1/'`" = "no" ] ; then pyprogpath="" ; fi
if [ "$pyprogpath" = "" ] ; then
echo "NO"
continue
fi
echo "YES"
echo $ECHO_N "Checking for ${pyprog}/VERSION ............. $ECHO_C"
pythonout=`echo "import os ; import sys ; import re; test = re.match(r'(\\d*)\\.(\\d*)',sys.version) ; assert ((int(test.group(1)) > 2) or ((int(test.group(1)) == 2) and (int(test.group(2)) >= 3))) ; print 'qzxq'" | ${pyprog} 2> /dev/null`
if [ "`echo $pythonout | sed 's/.*\(qzxq\).*/\1/'`" != "qzxq" ] ; then
echo "NO"
continue
fi
echo "YES"
for pypack in "readline" "scipy "
do
echo $ECHO_N "Checking for ${pyprog}/${pypack}............. $ECHO_C"
pythonout=`echo "import ${pypack} ; print 'qzxq'" | ${pyprog} 2> /dev/null`
if [ "`echo $pythonout | sed 's/.*\(qzxq\).*/\1/'`" = "qzxq" ] ; then
echo "YES"
else
echo "NO"
PYTHON_PACKSMISSING_COMMAND=$pyprogpath
pyprog=""
break
fi
done
if [ "${pyprog}" != "" ] ; then
PYTHON_COMMAND=$pyprogpath
break
fi
done
if [ "$PYTHON_COMMAND" = "" ] ; then
if [ "$PYTHON_PACKSMISSING_COMMAND" = "" ] ; then
echo "PYTHON_COMMAND=/bin/false" > Makefile
echo "ERROR: Required program python, or a required python package, could not be found."
exit
else
echo "PYTHON_COMMAND=${PYTHON_PACKSMISSING_COMMAND}" > Makefile
echo "WARNING: Some non-vital, but strongly recommended, python packages were not found (see above). PyXPlot will continue to install without these, but some features may be disabled."
fi
else
echo "PYTHON_COMMAND=${PYTHON_COMMAND}" > Makefile
fi
# 4. FIND GHOSTVIEW
echo $ECHO_N "Checking for ghostview ............. $ECHO_C"
whichout_gv=`which gv 2> /dev/null`
whichout_ggv=`which ggv 2> /dev/null`
if [ "`echo $whichout_gv | sed 's/\([a-z]*\).*/\1/'`" = "no" ] ; then whichout_gv="" ; fi
if [ "`echo $whichout_ggv | sed 's/\([a-z]*\).*/\1/'`" = "no" ] ; then whichout_ggv="" ; fi
if [ "$whichout_gv" != "" ] ; then
echo $ECHO_N "YES (gv"
echo "GV_COMMAND=${whichout_gv}" >> Makefile
if [ "`gv --v 2> /dev/null`" = "" ]; then
echo ", single hyphen options)"
echo "GV_OPT=-" >> Makefile
else
echo ", double hyphen options)"
echo "GV_OPT=--" >> Makefile
fi
elif [ "$whichout_ggv" != "" ] ; then
echo "YES (ggv, don't forget to set \"watch file\" in the viewer preferences!)"
echo "GV_COMMAND=${whichout_ggv}" >> Makefile
echo "GV_OPT=--" >> Makefile
else
echo "GV_COMMAND=/bin/false" >> Makefile
echo "NO"
echo "WARNING: Ghostview could not be found. Installation will proceed, but X11 terminal will not be available in PyXPlot. If required, install either ghostview (gv) or Gnome-ghostview (ggv), and then re-install PyXPlot."
fi
# 5. FIND MAKE
echo $ECHO_N "Checking for GNU make ............. $ECHO_C"
whichout_make=`which make 2> /dev/null`
whichout_gmake=`which gmake 2> /dev/null`
if [ "`echo $whichout_make | sed 's/\([a-z]*\).*/\1/'`" = "no" ] ; then whichout_make="" ; fi
if [ "`echo $whichout_gmake | sed 's/\([a-z]*\).*/\1/'`" = "no" ] ; then whichout_gmake="" ; fi
if [ "$whichout_gmake" != "" ] ; then
echo "YES (gmake)"
echo "MAKE_COMMAND=${whichout_gmake}" >> Makefile
MAKE_COMMAND="gmake"
elif [ "$whichout_make" != "" ] ; then
echo "YES (make)"
echo "MAKE_COMMAND=${whichout_make}" >> Makefile
MAKE_COMMAND="make"
else
echo "NO"
echo "ERROR: Required program 'make' could not be found."
exit
fi
# 6. OUTPUT MAKEFILE
cat Makefile.skel >> Makefile
echo "Configuration successful."
echo "To continue installation, type '${MAKE_COMMAND}'."
|