head 1.8; access; symbols OPENPKG_E1_MP_HEAD:1.8 OPENPKG_E1_MP:1.8 OPENPKG_E1_MP_2_STABLE:1.7 OPENPKG_E1_FP:1.7 OPENPKG_2_STABLE_MP:1.7 OPENPKG_2_STABLE_20061018:1.7 OPENPKG_2_STABLE_20060622:1.7 OPENPKG_2_STABLE:1.7.0.2 OPENPKG_2_STABLE_BP:1.7 OPENPKG_2_5_RELEASE:1.6 OPENPKG_2_5_SOLID:1.6.0.2 OPENPKG_2_5_SOLID_BP:1.6 OPENPKG_2_4_RELEASE:1.4 OPENPKG_2_4_SOLID:1.4.0.2 OPENPKG_2_4_SOLID_BP:1.4 OPENPKG_CW_FP:1.1; locks; strict; comment @# @; 1.8 date 2007.01.01.17.37.48; author rse; state Exp; branches; next 1.7; commitid BicZD6VUl7GuqP0s; 1.7 date 2006.01.01.13.13.34; author rse; state Exp; branches; next 1.6; commitid otZG8yKMCw1JFTfr; 1.6 date 2005.07.01.11.54.28; author rse; state Exp; branches; next 1.5; 1.5 date 2005.06.25.17.23.36; author rse; state Exp; branches; next 1.4; 1.4 date 2005.06.11.22.05.39; author rse; state Exp; branches; next 1.3; 1.3 date 2005.03.24.15.40.20; author rse; state Exp; branches; next 1.2; 1.2 date 2005.03.24.11.18.46; author rse; state Exp; branches; next 1.1; 1.1 date 2004.02.10.17.09.42; author rse; state Exp; branches; next ; desc @@ 1.8 log @Welcome Year 2007! @ text @#!/bin/sh ## ## firefox -- Mozilla Firefox Startup Control Utility ## Copyright (c) 2000-2007 OpenPKG Foundation e.V. ## Copyright (c) 2000-2007 Ralf S. Engelschall ## ## Permission to use, copy, modify, and distribute this software for ## any purpose with or without fee is hereby granted, provided that ## the above copyright notice and this permission notice appear in all ## copies. ## ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ## SUCH DAMAGE. ## # configuration firefox_dir="@@l_prefix@@/lib/firefox" firefox_browser_bin="$firefox_dir/firefox" firefox_remote_bin="$firefox_dir/run-mozilla.sh $firefox_dir/mozilla-xremote-client" xsel_bin="@@l_prefix@@/bin/xsel" wmctrl_bin="@@l_prefix@@/bin/wmctrl" # option parsing opt_v=no opt_w=no opt_t=no opt_r="" while [ ".$1" != . ]; do case $1 in -v|--verbose ) opt_v=yes; shift ;; -w|--window ) opt_w=yes; shift ;; -t|--tab ) opt_t=yes; shift ;; -r|-remote|--remote ) opt_r="$2"; shift; shift ;; -* ) echo "$0:ERROR: invalid option \"$1\"" 1>&2; exit 1 ;; * ) break ;; esac done if [ $# -eq 0 ]; then set -- "" fi verbose () { if [ ".$opt_v" = .yes ]; then echo "firefox: $*" 1>&2 fi } # establish Mozilla environment MOZILLA_FIVE_HOME="$firefox_dir" export MOZILLA_FIVE_HOME LANG=en_US.ISO8859-1 export LANG # special case of direct remote option if [ ".$opt_r" != . ]; then verbose "exec: $firefox_remote_bin \"$opt_r\"" exec $firefox_remote_bin "$opt_r" fi # determine Mozilla run-time status $firefox_remote_bin "ping()" >/dev/null 2>&1 if [ $? -eq 0 ]; then verbose "process already running (available remotely)" restart=no else verbose "process still not running (not available remotely)" restart=yes fi # open one or more URLs first=yes for url in "$@@"; do # determine URL to open if [ ".`echo .$url | grep '@@'`" != . ]; then # expand at-sign into X11 selection buffer xsel=`($xsel_bin --paste) 2>/dev/null` url=`echo "$url" | sed -e "s;@@;$xsel;"` fi if [ ".$url" = . ]; then # expand an empty URL into the internal blank page url="about:blank" else # expand special URL constructs case "$url" in auto:* ) url=`echo "$url" | sed -e 's;^auto:;;'` case "$url" in http://* | https://* | ftp://* | file://* ) ;; www.* ) url="http://$url" ;; ftp.* ) url="ftp://$url" ;; *.tar.gz | *.tgz ) url="ftpsearch:$url" ;; *" "* ) url="google:$url" ;; [0-9]* ) url="rfc:$url" ;; * ) url="leo:$url" ;; esac ;; esac case "$url" in http://* | https://* | ftp://* | file://* ) : # URL is already fully qualified ;; google:* ) # expand Google query url=`echo "$url" | sed -e 's;^google:;;' | tr ' ' '+'` url="http://www.google.com/search?q=$url" ;; leo:* ) # expand Leo Dictionary query url=`echo "$url" | sed -e 's;^leo:;;' | tr ' ' '+'` url="http://dict.leo.org/?search=$url" ;; ftpsearch:* ) # expand FTPSearch query url=`echo "$url" | sed -e 's;^ftpsearch:;;' | sed -e 's; ;%20;g'` url="http://www.alltheweb.com/search?advanced=1&cat=ftp&q=$url" ;; rfc:* ) # expand Zvon.org RFC query url=`echo "$url" | sed -e 's;^rfc:;;'` url="http://zvon.org/tmRFC/RFC$url/Output/index.html" ;; whois:* ) # expand Geektools.com WHOIS query url=`echo "$url" | sed -e 's;^whois:;;'` url="http://www.whois-search.com/whois/$url" ;; jargon:* ) # expand UMEC Jargon File query url=`echo "$url" | sed -e 's;^jargon:;;' | tr ' ' '+'` url="http://www.tf.hut.fi/cgi-bin/jargon?search=$url" ;; /* ) # expand absolute filename into file URL url="file://$url" ;; * ) # expand relative filename into file URL url="file://`pwd`/$url" ;; esac fi if [ ".$first" = .yes -a ".$restart" = .yes ]; then # handling of first URL if restarting is necessary verbose "running new process" if [ ".$url" = ".about:blank" ]; then verbose "exec: $firefox_browser_bin >/dev/null 2>&1 &" $firefox_browser_bin >/dev/null 2>&1 & else verbose "exec: $firefox_browser_bin \"$url\" >/dev/null 2>&1 &" $firefox_browser_bin "$url" >/dev/null 2>&1 & fi else # delayed waiting for process to be finally remotely available # if it was started from scratch for the handling of the first # URL. This way we wait only if necessary, i.e., if more than # one URL was given. if [ ".$first" = .no -a ".$restart" = .yes ]; then verbose "waiting for new process to be available remotely" sleep 4 # give it a little bit of time to fully startup i=0 while [ $i -lt 10 ]; do $firefox_remote_bin "ping()" >/dev/null 2>&1 if [ $? -eq 0 ]; then break fi sleep 1 # give it a little bit more time to startup i=`expr $i + 1` done fi # try to activate (and bring to foreground) the Mozilla Firefox window $wmctrl_bin -a "Mozilla Firefox" >/dev/null 2>&1 || true # determine remote command if [ ".$opt_w" = .yes ]; then if [ ".$url" = ".about:blank" ]; then cmd="xfeDoCommand(openBrowser)" else cmd="openURL($url, new-window)" fi elif [ ".$opt_t" = .yes ]; then cmd="openURL($url, new-tab)" else cmd="openURL($url)" fi # perform remote command verbose "sending remote command to running process" verbose "exec: $firefox_remote_bin \"$cmd\" >/dev/null 2>&1" $firefox_remote_bin "$cmd" >/dev/null 2>&1 fi first=no done @ 1.7 log @adjust copyrights for new year 2006 @ text @d4 2 a5 2 ## Copyright (c) 2000-2006 OpenPKG Foundation e.V. ## Copyright (c) 2000-2006 Ralf S. Engelschall @ 1.6 log @synchronize Mozilla Firefox control program with Mozilla Suite version by adding wmctrl and file:// support @ text @d4 2 a5 2 ## Copyright (c) 2000-2005 OpenPKG Foundation e.V. ## Copyright (c) 2000-2005 Ralf S. Engelschall @ 1.5 log @fix remote command handling and description @ text @d31 1 d98 1 a98 1 http://* | https://* | ftp://* ) ;; d109 1 a109 1 http://* | https://* | ftp://* ) d182 3 @ 1.4 log @fix whois: URL queries; make SVG support optional and disabled by default as Firefox 1.0.4 is incompatible with current Cairo 0.5; fix indentation; align options with Mozilla package; provide updated logos which now include both the fox in the firefox logo and an updated OpenPKG logo @ text @d28 2 a29 1 firefox_bin="@@l_prefix@@/lib/firefox/firefox" d65 2 a66 2 verbose "exec: $firefox_bin -remote \"$opt_r\"" exec $firefox_bin -remote "$opt_r" d70 1 a70 1 $firefox_bin -remote "ping()" >/dev/null 2>&1 d156 2 a157 2 verbose "exec: $firefox_bin >/dev/null 2>&1 &" $firefox_bin >/dev/null 2>&1 & d159 2 a160 2 verbose "exec: $firefox_bin \"$url\" >/dev/null 2>&1 &" $firefox_bin "$url" >/dev/null 2>&1 & d172 1 a172 1 $firefox_bin -remote "ping()" >/dev/null 2>&1 d196 2 a197 2 verbose "exec: $firefox_bin -remote \"$cmd\" >/dev/null 2>&1" $firefox_bin -remote "$cmd" >/dev/null 2>&1 @ 1.3 log @Firefox finally builds, so bring this package into a usable shape @ text @d133 1 a133 1 url="http://www.geektools.com/cgi-bin/proxy.cgi?query=$url" @ 1.2 log @Adjust the copyright declaration in this (RSE's) copy of the OpenPKG source code now that the fork point for C&W was established (CVS tag OPENPKG_CW_FP), the shared copyright agreement between RSE and C&W is no longer active (as C&W no longer officially sponsors OpenPKG) and the new shared copyright from RSE can be taken over by the newly established juristic entity OpenPKG Foundation e.V. (instead of the non-juristic entity OpenPKG Project). @ text @d27 2 a28 2 mozilla_dir="@@l_prefix@@/lib/firefox" mozilla_bin="@@l_prefix@@/lib/firefox/mozilla" d57 1 a57 1 MOZILLA_FIVE_HOME="$mozilla_dir" d64 2 a65 2 verbose "exec: $mozilla_bin -remote \"$opt_r\"" exec $mozilla_bin -remote "$opt_r" d69 1 a69 1 $mozilla_bin -remote "ping()" >/dev/null 2>&1 d155 2 a156 2 verbose "exec: $mozilla_bin >/dev/null 2>&1 &" $mozilla_bin >/dev/null 2>&1 & d158 2 a159 2 verbose "exec: $mozilla_bin \"$url\" >/dev/null 2>&1 &" $mozilla_bin "$url" >/dev/null 2>&1 & d171 1 a171 1 $mozilla_bin -remote "ping()" >/dev/null 2>&1 d195 2 a196 2 verbose "exec: $mozilla_bin -remote \"$cmd\" >/dev/null 2>&1" $mozilla_bin -remote "$cmd" >/dev/null 2>&1 @ 1.1 log @new package: firefox 0.8 (Graphical Web Browser) @ text @d4 2 a5 3 ## Copyright (c) 2000-2003 The OpenPKG Project ## Copyright (c) 2000-2003 Ralf S. Engelschall ## Copyright (c) 2000-2003 Cable & Wireless @