Ticket #9530: trac_9530-spkg_update_openSUSE_Arch_workarounds.2.patch

File trac_9530-spkg_update_openSUSE_Arch_workarounds.2.patch, 2.6 KB (added by mpatel, 12 years ago)

Use uname -m and ln -snf but leave cp -a. Updated SPKG patch. Replaces previous.

  • SPKG.txt

    # HG changeset patch
    # User Mitesh Patel <qed777@gmail.com>
    # Date 1287972742 25200
    # Node ID b12525cd1a089d120707b3de21abc8c441949a88
    # Parent  894db1d3de14955fd48aec4c071cc729a5d6fb80
    #9530: Update openSUSE and Arch Linux workarounds.  Thomas Bächler
    
    diff --git a/SPKG.txt b/SPKG.txt
    a b Website: http://tiswww.case.edu/php/chet 
    3333   since it took tons of space; didn't delete anything else.
    3434 * Work around some MacOSX dynamic lib flags
    3535
     36== readline-6.0p3 (Thomas Bächler, Mitesh Patel, October 24th, 2010) ==
     37 * #9530: Update openSUSE and Arch Linux workarounds to fix failed
     38   builds.
     39
    3640== readline-6.0p2 (Mike Hansen, June 22nd, 2010) ==
    3741 * #7821: readline-6.0.p1 fails on FreeBSD
    3842
  • spkg-install

    diff --git a/spkg-install b/spkg-install
    a b rm -rf "$SAGE_LOCAL"/lib/libreadline.* 
    163163# for now.
    164164
    165165if [ -f /etc/SuSE-release ]; then
    166     if [ `grep 11.1 /etc/SuSE-release > /dev/null; echo $?` -eq 0 ]; then
    167         echo "OpenSUSE 11.1 detected"
     166    if grep -q 11\\. /etc/SuSE-release 2>/dev/null; then
     167        echo "OpenSUSE 11 detected"
    168168        if [ -d /usr/include/readline/ ]; then
    169169            echo "The development version of libreadline is installed -> copying"
    170             if [ `uname -p` = "x86_64" ]; then
    171                 cp /lib64/libreadline.so.* "$SAGE_LOCAL"/lib
     170            # Note: -a is not a POSIX option for cp, but we run the
     171            # code below only on Linux.  TODO: Conform to POSIX and/or
     172            # find a better way to handle openSUSE and Arch Linux.
     173            if [ `uname -m` = "x86_64" ]; then
     174                cp -a /lib64/libreadline.so.6* "$SAGE_LOCAL"/lib
    172175            else
    173                 cp /lib/libreadline.so.* "$SAGE_LOCAL"/lib
     176                cp -a /lib/libreadline.so.6* "$SAGE_LOCAL"/lib
    174177            fi
     178            ln -snf libreadline.so.6 "$SAGE_LOCAL"/lib/libreadline.so
    175179            cp -r /usr/include/readline  "$SAGE_LOCAL"/include
    176180            exit 0
    177181        else
    fi 
    185189# We also check for Arch Linux, since it crashes with "undefined symbol: PC".
    186190# If anyone knows a better way to fix this, please do.
    187191
    188 if [ $UNAME = "Linux" -a -n "`uname -r | grep ARCH`" ]; then
    189     if [ -f "/usr/lib/libreadline.so" ]; then
     192if [ -f /etc/arch-release ]; then
     193    if [ -f "/lib/libreadline.so.6" ]; then
    190194        echo "Copying over system's libreadline."
    191         cp /lib/libreadline.so.* "$SAGE_LOCAL"/lib
     195        cp -a /lib/libreadline.so.6* "$SAGE_LOCAL"/lib
     196        ln -s libreadline.so.6 "$SAGE_LOCAL"/lib/libreadline.so
    192197        exit 0
    193198    else
    194199        echo "Could not find a system copy of libreadline. Exiting."