Ticket #9530: readline-6.0.p2.spkg.patch

File readline-6.0.p2.spkg.patch, 1.8 KB (added by baechler, 12 years ago)
  • readline-6.0.p2

    diff -Nur readline-6.0.p2.orig//spkg-install readline-6.0.p2/spkg-install
    old new  
    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"
    170170            if [ `uname -p` = "x86_64" ]; then
    171                 cp /lib64/libreadline.so.* "$SAGE_LOCAL"/lib
     171                cp -a /lib64/libreadline.so.6* "$SAGE_LOCAL"/lib
    172172            else
    173                 cp /lib/libreadline.so.* "$SAGE_LOCAL"/lib
     173                cp -a /lib/libreadline.so.6* "$SAGE_LOCAL"/lib
    174174            fi
     175            ln -s libreadline.so.6 "$SAGE_LOCAL"/lib/libreadline.so
    175176            cp -r /usr/include/readline  "$SAGE_LOCAL"/include
    176177            exit 0
    177178        else
     
    185186# We also check for Arch Linux, since it crashes with "undefined symbol: PC".
    186187# If anyone knows a better way to fix this, please do.
    187188
    188 if [ $UNAME = "Linux" -a -n "`uname -r | grep ARCH`" ]; then
    189     if [ -f "/usr/lib/libreadline.so" ]; then
     189if [ -f /etc/arch-release ]; then
     190    if [ -f "/lib/libreadline.so.6" ]; then
    190191        echo "Copying over system's libreadline."
    191         cp /lib/libreadline.so.* "$SAGE_LOCAL"/lib
     192        cp -a /lib/libreadline.so.6* "$SAGE_LOCAL"/lib
     193        ln -s libreadline.so.6 "$SAGE_LOCAL"/lib/libreadline.so
    192194        exit 0
    193195    else
    194196        echo "Could not find a system copy of libreadline. Exiting."