Ticket #11503: trac11503.patch

File trac11503.patch, 3.9 KB (added by ddrake, 10 years ago)

changes to spkg-install, SPKG.txt. For review only.

  • SPKG.txt

    # HG changeset patch
    # User Dan Drake <drake@kaist.edu>
    # Date 1326265316 -32400
    # Node ID f2bd3d03f3b0f052ee20678e20628fe1e27fa1d5
    # Parent  45af5ce70639fe3f64c553a8d1460208fb0b9bb1
    [mq]: trac11503
    
    diff --git a/SPKG.txt b/SPKG.txt
    a b  
    11= Jmol for Sage =
    2 Version 12.0.45.p2 - July 18, 2011 - added patched launch script jmol to spkg
    3      repository. 
    42
    53== Description ==
    64
     
    3129    compatible.
    3230   
    3331== Change Log ==
     32Version 12.0.45.p3 - January 11, 2012 - improvements to spkg-install.
    3433Version 12.0.45.p2 - July 18, 2011 - added patched launch script jmol to spkg
    3534     repository. 
    3635Version 12.0.45.p1 - June 24, 2011 - added signed applet to spkg and patched
  • spkg-install

    diff --git a/spkg-install b/spkg-install
    a b  
    55   exit 1
    66fi
    77
    8 SPKDIR=`pwd`
    9 echo "Temporary package directory: "$SPKDIR
     8SPKGDIR=`pwd`
     9echo "Temporary package directory: $SPKGDIR"
    1010
    1111# Patches.  Comment out this section if there are none.
    12 TEMPDIR="$SPKDIR/patches"
    13 cd "$TEMPDIR"
    14 if [ $? -ne 0 ]; then
     12if [ ! -d "$SPKGDIR"/patches ]; then
    1513   echo "Error finding patches directory. Exiting."
    1614   exit 1
    1715fi
    18 cp Jmol.js ../src/jmol
     16
     17cp "$SPKGDIR"/patches/Jmol.js "$SPKGDIR"/src/jmol/
    1918if [ $? -ne 0 ]; then
    2019   echo "Error copying Jmol.js patch. Exiting."
    2120   exit 1
    22 fi
    23 cp jmol ../src/jmol
     21fi
     22
     23cp "$SPKGDIR"/patches/jmol "$SPKGDIR"/src/jmol/
    2424if [ $? -ne 0 ]; then
    2525   echo "Error copying jmol script patch. Exiting."
    2626   exit 1
    2727fi
    2828
    2929# Check for sagenb location
    30 cd "$SAGE_ROOT/devel/sagenb/sagenb/data/jmol"
    31 if [ $? -ne 0 ]; then
     30if [ ! -d "$SAGE_ROOT/devel/sagenb/sagenb/data/jmol" ]; then
    3231    echo "No old Jmol install in notebook. Skipping removal of Jmol from notebook."
    3332else
    3433    echo "Removing Jmol files from the notebook data directory..."
    3534    rm -r "$SAGE_ROOT/devel/sagenb/sagenb/data/jmol"
    3635fi
    3736
    38 TEMPDIR="$SPKDIR/src"
    39 cd "$TEMPDIR"
    40 if [ $? -ne 0 ]; then
    41    echo "Error finding src directory. Exiting."
    42    exit 1
     37if [ ! -d "$SAGE_LOCAL"/share/jmol ]; then
     38    echo "Directory "$SAGE_LOCAL"/share/jmol does not exist.  Creating directory..."
     39    mkdir "$SAGE_LOCAL/share/jmol"
     40else
     41    echo "Deleting all files from "$SAGE_LOCAL"/share/jmol/..."
     42    rm -r "$SAGE_LOCAL"/share/jmol/*
     43    echo "Replacing jmol directory and contents..."
    4344fi
    4445
    45 cd "$SAGE_LOCAL/share/jmol"
    46 if [ $? -ne 0 ]; then
    47    echo "Directory "$SAGE_LOCAL"/share/jmol does not exist.  Creating Directory..."
    48 else
    49     echo "Deleting all files from "$SAGE_LOCAL"/share/jmol..."
    50     rm -r "$SAGE_LOCAL/share/jmol"
    51     echo "replacing jmol directory and contents..."
    52 fi
     46# "install" the Jmol files...
     47cp -r "$SPKGDIR"/src/jmol/* "$SAGE_LOCAL"/share/jmol/
    5348
    54 mkdir "$SAGE_LOCAL/share/jmol"
    55 
    56 TEMPDIR="$SPKDIR/src/jmol"
    57 cd "$TEMPDIR"
    58 cp -r * "$SAGE_LOCAL/share/jmol/"
    59 
    60 cd "$SAGE_LOCAL/bin"
    61 if [ $? -ne 0 ]; then
     49if [ ! -d "$SAGE_LOCAL"/bin ]; then
    6250   echo "Directory "$SAGE_LOCAL"/bin does not exist.  Your Sage install is broken. Exiting."
    6351   exit 1
    6452else
    65     echo "Copying jmol script to "$SAGE_LOCAL"/bin."
    66     cd "$TEMPDIR"
    67     cp -f jmol "$SAGE_LOCAL/bin"
     53    echo "Copying jmol script to $SAGE_LOCAL/bin."
     54    cp -f "$SPKGDIR"/src/jmol/jmol "$SAGE_LOCAL"/bin/
    6855fi
    6956
    7057echo "Installing applet web directory"
    7158mkdir "$SAGE_LOCAL/share/jmol/appletweb"
    72 cp Jmol.js "$SAGE_LOCAL/share/jmol/appletweb"
     59cp "$SPKGDIR"/src/jmol/Jmol.js "$SAGE_LOCAL/share/jmol/appletweb"
    7360
    74 TEMPDIR="$SPKDIR/patches/appletweb"
    75 cd "$TEMPDIR"
    76 if [ $? -ne 0 ]; then
     61if [ ! -d "$SPKGDIR"/patches/appletweb ]; then
    7762   echo "Error finding patches/appletweb directory. Exiting."
    7863   exit 1
    7964fi
    80 cp -r * "$SAGE_LOCAL/share/jmol/appletweb"
     65cp -r "$SPKGDIR"/patches/appletweb/* "$SAGE_LOCAL"/share/jmol/appletweb
     66
    8167
    8268if [ $? -ne 0 ]; then
    83    echo "Error installing PACKAGE_NAME."
     69   echo "Error installing Jmol."
    8470   exit 1
    8571else
    86     echo "New Jmol installed successfully."
     72   echo "New Jmol installed successfully."
    8773fi