#!/bin/sh # $FreeBSD$ # environment variables: # # ADOBE_LANG: # Set this if you want to invoke a specific localized version. # If $LANG is set, this will be set automatically based on it. # # ADOBE_VER: # Set this if you want to invoke a specific version of # Adobe Reader by "acroread". Currently "7" and "8" are valid. # When this script is invoked as "acroread7" and "acroread8", # ADOBE_VER is automatically set. # # ADOBE_DISABLEIMMODULEHACK: # This script sets GTK_IM_MODULE as "xim" by default because # immodules other than xim require the corresponding module files # in Linux binary, not FreeBSD native versions (if a FreeBSD # native immodule library exists and the corresponding Linux # library does not, Adobe Reader attempts to load the FreeBSD # binary and it will fail). If $ADOBE_DISABLEIMMODULEHACK is # defined as "YES", this behavior is disabled. ADOBE_LANG=`echo "${ADOBE_LANG}" | tr a-z A-Z` case ${LANG} in af_*) : ${ADOBE_LANG:=ENU} ;; am_*) : ${ADOBE_LANG:=ENU} ;; be_*) : ${ADOBE_LANG:=ENU} ;; ca_*) : ${ADOBE_LANG:=ENU} ;; da_*) : ${ADOBE_LANG:=DAN} ;; de_*) : ${ADOBE_LANG:=DEU} ;; el_*) : ${ADOBE_LANG:=ENU} ;; en_*) : ${ADOBE_LANG:=ENU} ;; es_*) : ${ADOBE_LANG:=ESP} ;; et_*) : ${ADOBE_LANG:=ENU} ;; eu_*) : ${ADOBE_LANG:=ENU} ;; fi_*) : ${ADOBE_LANG:=SUO} ;; fr_*) : ${ADOBE_LANG:=FRA} ;; he_*) : ${ADOBE_LANG:=ENU} ;; hi_*) : ${ADOBE_LANG:=ENU} ;; hr_*) : ${ADOBE_LANG:=ENU} ;; hu_*) : ${ADOBE_LANG:=ENU} ;; hy_*) : ${ADOBE_LANG:=ENU} ;; is_*) : ${ADOBE_LANG:=ENU} ;; it_*) : ${ADOBE_LANG:=ITA} ;; ja_*) : ${ADOBE_LANG:=JPN} ;; kk_*) : ${ADOBE_LANG:=ENU} ;; ko_*) : ${ADOBE_LANG:=KOR} ;; la_*) : ${ADOBE_LANG:=ENU} ;; lt_*) : ${ADOBE_LANG:=ENU} ;; nl_*) : ${ADOBE_LANG:=NLD} ;; no_*) : ${ADOBE_LANG:=NOR} ;; pl_*) : ${ADOBE_LANG:=ENU} ;; pt_*) : ${ADOBE_LANG:=PTB} ;; ro_*) : ${ADOBE_LANG:=ENU} ;; ru_*) : ${ADOBE_LANG:=ENU} ;; sk_*) : ${ADOBE_LANG:=ENU} ;; sl_*) : ${ADOBE_LANG:=ENU} ;; sr_*) : ${ADOBE_LANG:=ENU} ;; sv_*) : ${ADOBE_LANG:=SVE} ;; tr_*) : ${ADOBE_LANG:=ENU} ;; uk_*) : ${ADOBE_LANG:=ENU} ;; zh_CN.*): ${ADOBE_LANG:=CHS} ;; zh_HK.*): ${ADOBE_LANG:=CHS} ;; zh_TW.*): ${ADOBE_LANG:=CHT} ;; *) : ${ADOBE_LANG:=ENU} ;; esac case ${ADOBE_LANG} in CHS) : ${GDK_USE_XFT:=0}; export GDK_USE_XFT ;; CHT) : ${GDK_USE_XFT:=0}; export GDK_USE_XFT ;; KOR) : ${GDK_USE_XFT:=0}; export GDK_USE_XFT ;; esac case ${ADOBE_VER} in "") BN=${0##*/} VN=${BN#????????} case ${VN} in [78]) ADOBE_VER=${VN} ;; *) if [ -d %%PREFIX%%/%%ACROBASE7%% ]; then ADOBE_VER=7; fi if [ -d %%PREFIX%%/%%ACROBASE8%% ]; then ADOBE_VER=8; fi ;; esac ;; esac case ${ADOBE_VER} in 7) ACROBASE=%%ACROBASE7%% BINPREFIX=bin ;; 8) ACROBASE=%%ACROBASE8%% BINPREFIX=Adobe/Reader8/bin MOZILLA_COMP_PATH=/../%%PREFIX%%/lib/linux-nvu export MOZILLA_COMP_PATH ;; esac case ${ADOBE_DISABLEIMMODULEHACK} in [Yy][Ee][Ss]) ;; # do nothing *) case ${ADOBE_VER}:${GTK_IM_MODULE} in *:""|*:xim) GTK_IM_MODULE=xim; export GTK_IM_MODULE ;; 7:scim) GTK_IM_MODULE=xim; export GTK_IM_MODULE XMODIFIERS="@im=SCIM"; export XMODIFIERS ;; 8:scim) GTK_IM_MODULE=scim; export GTK_IM_MODULE XMODIFIERS="@im=SCIM"; export XMODIFIERS ;; *) XMODIFIERS="@im=${GTK_IM_MODULE}"; export XMODIFIERS ;; esac ;; esac case $1 in --install-plugin) echo "installing PDF plugin..." echo "%%PREFIX%%/${ACROBASE}/${ADOBE_LANG}/Browser/intellinux/nppdf.so -> %%PREFIX%%/%%PLUGINDIR%%/nppdf.so" mkdir -p %%PREFIX%%/%%PLUGINDIR%% ln -s -f %%PREFIX%%/${ACROBASE}/${ADOBE_LANG}/${BINPREFIX}/../Browser/intellinux/nppdf.so \ %%PREFIX%%/%%PLUGINDIR%%/nppdf.so exit 0 ;; --deinstall-plugin) echo "deinstalling PDF plugin..." rm -f %%PREFIX%%/%%PLUGINDIR%%/nppdf.so rmdir %%PREFIX%%/%%PLUGINDIR%% > /dev/null 2>&1 || true exit 0 ;; esac UNAME_s=Linux; export UNAME_s if [ -x %%PREFIX%%/${ACROBASE}/${ADOBE_LANG}/${BINPREFIX}/acroread ]; then exec %%LINUXSH%% %%PREFIX%%/${ACROBASE}/${ADOBE_LANG}/${BINPREFIX}/acroread "$@" else echo "?warning: localized acroread (${ADOBE_LANG}) not found." 1>&2 if [ -x %%PREFIX%%/${ACROBASE}/ENU/${BINPREFIX}/acroread ]; then echo "Trying to invoke English version..." 1>&2 exec %%LINUXSH%% %%PREFIX%%/${ACROBASE}/ENU/${BINPREFIX}/acroread "$@" fi fi echo "!fatal: No acroread binary found. Check \$LANG or \$ADOBE_LANG, and installed acroread packages." 1>&2 exit 1