diff options
author | jlam <jlam@pkgsrc.org> | 2007-08-07 21:37:24 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2007-08-07 21:37:24 +0000 |
commit | 93cb6d7ecb65c6d71d344834f0c8ad2f4496bfc8 (patch) | |
tree | 1188a322b156f5ca22bbeff50ee9a5feb9edfed2 /www/opera/files | |
parent | e02ce61dad1d286c1962573d768eaeaf65cc53b9 (diff) | |
download | pkgsrc-93cb6d7ecb65c6d71d344834f0c8ad2f4496bfc8.tar.gz |
Rewrite the opera.sh shell script to properly check for versions of
Linux kernel emulation <= 2.0.38. Also ensure that /lib is in
LD_LIBRARY_PATH so that the opera binary can find /lib/libpthread.so.0
in ${EMULDIR} and not NetBSD's /usr/lib/libpthread.so.0.
Bump the PKGREVISION to 1.
Diffstat (limited to 'www/opera/files')
-rw-r--r-- | www/opera/files/opera.sh | 73 |
1 files changed, 50 insertions, 23 deletions
diff --git a/www/opera/files/opera.sh b/www/opera/files/opera.sh index e42c0b923c0..9fcb6bceaba 100644 --- a/www/opera/files/opera.sh +++ b/www/opera/files/opera.sh @@ -1,25 +1,52 @@ -#!/bin/sh -LINUX_KERN_OSREL=`/sbin/sysctl -n emul.linux.kern.osrelease 2>/dev/null` -if [ -z "$LINUX_KERN_OSREL" -o "$LINUX_KERN_OSREL" = "2.0.38" ] -then - OPERADIR=$HOME/.opera - mkdir -p $OPERADIR || exit 1 - for FILE in $OPERADIR/opera6.ini $OPERADIR/opera.ini - do - if [ -f ${FILE} ] - then - if grep -q '^Synchronous DNS Lookup=0$' ${FILE} - then - cp -p ${FILE} ${FILE}.patch - sed -e 's#^\(Synchronous DNS Lookup\)=0$#\1=1#' ${FILE}.patch >${FILE} - rm -f ${FILE}.patch - fi - else - echo >${FILE} "[Performance]" - echo >>${FILE} "Synchronous DNS Lookup=1" - fi - done -fi +#!@SH@ +# +# $NetBSD: opera.sh,v 1.4 2007/08/07 21:37:25 jlam Exp $ +# +# This script is used with linux-* emulations to ensure that opera is +# started with the proper environment. +# + +# +# fixup_opera_ini +# This corrects opera.ini and opera6.ini files in the user's +# $HOME directory to enable synchronous DNS lookups on older +# versions of NetBSD. +# +fixup_opera_ini() +{ + linux_osrel=`/sbin/sysctl -n emul.linux.kern.osrelease 2>/dev/null` + case "$linux_osrel" in + [01].*|2.0|2.0.[0-9]|2.0.[12][0-9]|2.0.3[0-8]) + # On older NetBSD (linux kernel emulation <= 2.0.38), + # synchronous DNS lookups need to be explicitly enabled. + ;; + *) return 0 ;; + esac + + OPERADIR=$HOME/.opera + @MKDIR@ $OPERADIR || return 1 + for inifile in $OPERADIR/opera6.ini $OPERADIR/opera.ini; do + if [ ! -f $inifile ]; then + echo >$inifile "[Performance]" + echo >>$inifile "Synchronous DNS Lookup=1" + continue + fi + @SED@ "s/^\(Synchronous DNS Lookup\)=0/\1=1/" \ + $inifile > $inifile.patched + if @CMP@ -s $inifile $inifile.patched; then + @RM@ -f $inifile.patched + else + @MV@ -f $inifile.patched $inifile + fi + done + return 0 +} + +fixup_opera_ini || exit 1 + +# Fix up LD_LIBRARY_PATH so that /lib is always searched for shared +# libraries. +# +LD_LIBRARY_PATH=/lib:/usr/lib; export LD_LIBRARY_PATH -unset LD_LIBRARY_PATH exec @EMULDIR@/bin/bash /usr/bin/opera "$@" |