Update to 20071020. Add Adobe Reader 8 support and $ADOBE_VER

knob.
This commit is contained in:
Hiroki Sato 2008-01-04 20:20:20 +00:00
parent eb37528ec9
commit a683cd6990
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=205020
2 changed files with 55 additions and 11 deletions

View file

@ -6,8 +6,7 @@
#
PORTNAME= acroreadwrapper
PORTVERSION= 0.0.20060221
PORTREVISION= 3
PORTVERSION= 0.0.20071020
CATEGORIES= print
MASTER_SITES= # empty
DISTFILES= # empty
@ -17,9 +16,10 @@ COMMENT= Wrapper script for Adobe Reader
ONLY_FOR_ARCHS= amd64 i386
NO_BUILD= yes
PLIST_FILES= bin/acroread
PLIST_FILES= bin/acroread7 bin/acroread8 bin/acroread
SUB_FILES= acroread
SUB_LIST= ACROBASE=${ACROBASE} \
SUB_LIST= ACROBASE7=${ACROBASE7} \
ACROBASE8=${ACROBASE8} \
ADOBE_LANG=${ADOBE_LANG:U} \
INSTALLDIR=${INSTALLDIR} \
LINUXBASE=${LINUXBASE} \
@ -27,7 +27,8 @@ SUB_LIST= ACROBASE=${ACROBASE} \
PLUGINDIR=${PLUGINDIR} \
ADOBEBASE= Adobe
ACROBASE= ${ADOBEBASE}/Acrobat7.0
ACROBASE7= ${ADOBEBASE}/Acrobat7.0
ACROBASE8= ${ADOBEBASE}/Reader8
PLUGINDIR= lib/browser_linux_plugins
do-fetch:
@ -35,6 +36,8 @@ do-fetch:
do-install:
${INSTALL_SCRIPT} ${WRKDIR}/acroread ${PREFIX}/bin/acroread
cd ${PREFIX}/bin && ${LN} -s -f acroread acroread8
cd ${PREFIX}/bin && ${LN} -s -f acroread acroread7
post-install:
@${CAT} ${PKGMESSAGE}

View file

@ -1,6 +1,19 @@
#!%%LINUXBASE%%/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_LANG=`echo "${ADOBE_LANG}" | tr a-z A-Z`
case ${LANG} in
@ -54,12 +67,39 @@ JPN) : ${GTK_IM_MODULE:=xim}; export GTK_IM_MODULE ;;
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 $1 in
--install-plugin)
echo "installing PDF plugin..."
echo "%%PREFIX%%/%%ACROBASE%%/${ADOBE_LANG}/Browser/intellinux/nppdf.so -> %%PREFIX%%/%%PLUGINDIR%%/nppdf.so"
echo "%%PREFIX%%/${ACROBASE}/${ADOBE_LANG}/Browser/intellinux/nppdf.so -> %%PREFIX%%/%%PLUGINDIR%%/nppdf.so"
mkdir -p /../%%PREFIX%%/%%PLUGINDIR%%
ln -s -f %%PREFIX%%/%%ACROBASE%%/${ADOBE_LANG}/Browser/intellinux/nppdf.so \
ln -s -f %%PREFIX%%/${ACROBASE}/${ADOBE_LANG}/Browser/intellinux/nppdf.so \
/../%%PREFIX%%/%%PLUGINDIR%%/nppdf.so
exit 0
;;
@ -72,13 +112,14 @@ case $1 in
esac
UNAME_s=Linux; export UNAME_s
if [ -x %%PREFIX%%/%%ACROBASE%%/${ADOBE_LANG}/bin/acroread ]; then
exec %%LINUXSH%% %%PREFIX%%/%%ACROBASE%%/${ADOBE_LANG}/bin/acroread "$@"
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/bin/acroread ]; then
if [ -x %%PREFIX%%/${ACROBASE}/ENU/${BINPREFIX}/acroread ]; then
echo "Trying to invoke English version..." 1>&2
exec %%LINUXSH%% %%PREFIX%%/%%ACROBASE%%/ENU/bin/acroread "$@"
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