| 1 |
# Copyright 1999-2012 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/app-text/acroread/acroread-9.5.1-r1.ebuild,v 1.6 2012/09/24 00:42:12 vapier Exp $
|
| 4 |
|
| 5 |
EAPI=4
|
| 6 |
|
| 7 |
inherit eutils gnome2-utils nsplugins
|
| 8 |
|
| 9 |
DESCRIPTION="Adobe's PDF reader"
|
| 10 |
HOMEPAGE="http://www.adobe.com/products/reader/"
|
| 11 |
IUSE="cups ldap minimal nsplugin"
|
| 12 |
|
| 13 |
SRC_HEAD="http://ardownload.adobe.com/pub/adobe/reader/unix/9.x/${PV}"
|
| 14 |
SRC_FOOT=".tar.bz2"
|
| 15 |
|
| 16 |
# languages not available yet: it:ita es:esp pt:ptb sv:sve zh_CN:chs zh_TW:cht fi:suo nb:nor nl:nld ko:kor da:dan de:deu fr:fra ja:jpn
|
| 17 |
# asian fonts are handled separately
|
| 18 |
LINGUA_LIST="en:enu"
|
| 19 |
DEFAULT_URI="${SRC_HEAD}/enu/AdbeRdr${PV}-1_i486linux_enu${SRC_FOOT}"
|
| 20 |
for ll in ${LINGUA_LIST} ; do
|
| 21 |
iuse_l="linguas_${ll/:*}"
|
| 22 |
src_l=${ll/*:}
|
| 23 |
IUSE="${IUSE} ${iuse_l}"
|
| 24 |
DEFAULT_URI="!${iuse_l}? ( ${DEFAULT_URI} )"
|
| 25 |
SRC_URI="${SRC_URI}
|
| 26 |
${iuse_l}? ( ${SRC_HEAD}/${src_l}/AdbeRdr${PV}-1_i486linux_${src_l}${SRC_FOOT} )"
|
| 27 |
done
|
| 28 |
|
| 29 |
# asian fonts from separate package:
|
| 30 |
IUSE="${IUSE} linguas_zh_CN linguas_zh_TW linguas_ja linguas_ko"
|
| 31 |
|
| 32 |
SRC_URI="${SRC_URI}
|
| 33 |
${DEFAULT_URI}"
|
| 34 |
|
| 35 |
LICENSE="Adobe"
|
| 36 |
SLOT="0"
|
| 37 |
KEYWORDS="-* amd64 x86 ~amd64-linux ~x86-linux"
|
| 38 |
RESTRICT="strip mirror"
|
| 39 |
|
| 40 |
DEPEND="dev-util/bsdiff"
|
| 41 |
|
| 42 |
# mozilla-firefox-bin won't work because it doesn't have gtkembedmoz.so
|
| 43 |
RDEPEND="media-libs/fontconfig
|
| 44 |
x86? ( =dev-libs/openssl-0.9.8* )
|
| 45 |
cups? ( net-print/cups )
|
| 46 |
x86? ( x11-libs/gtk+:2 x11-libs/pango[X] net-dns/libidn
|
| 47 |
|| ( x11-libs/pangox-compat <x11-libs/pango-1.31[X] )
|
| 48 |
ldap? ( net-nds/openldap )
|
| 49 |
!minimal? ( || ( www-client/firefox
|
| 50 |
www-client/firefox-bin
|
| 51 |
www-client/seamonkey ) ) )
|
| 52 |
amd64? ( app-emulation/emul-linux-x86-gtklibs app-emulation/emul-linux-x86-baselibs )
|
| 53 |
linguas_zh_CN? ( media-fonts/acroread-asianfonts[linguas_zh_CN] )
|
| 54 |
linguas_ja? ( media-fonts/acroread-asianfonts[linguas_ja] )
|
| 55 |
linguas_zh_TW? ( media-fonts/acroread-asianfonts[linguas_zh_TW] )
|
| 56 |
linguas_ko? ( media-fonts/acroread-asianfonts[linguas_ko] )"
|
| 57 |
|
| 58 |
QA_EXECSTACK="opt/Adobe/Reader9/Reader/intellinux/bin/acroread
|
| 59 |
opt/Adobe/Reader9/Reader/intellinux/lib/libauthplay.so.0.0.0
|
| 60 |
opt/Adobe/Reader9/Reader/intellinux/lib/libsccore.so
|
| 61 |
opt/Adobe/Reader9/Reader/intellinux/lib/libcrypto.so.0.9.8
|
| 62 |
opt/Adobe/Reader9/Reader/intellinux/plug_ins/PPKLite.api"
|
| 63 |
|
| 64 |
QA_FLAGS_IGNORED="opt/Adobe/Reader9/Reader/intellinux/plug_ins3d/.*.x3d
|
| 65 |
opt/Adobe/Reader9/Reader/intellinux/lib/lib.*
|
| 66 |
opt/Adobe/Reader9/Reader/intellinux/bin/SynchronizerApp-binary
|
| 67 |
opt/Adobe/Reader9/Reader/intellinux/bin/acroread
|
| 68 |
opt/Adobe/Reader9/Reader/intellinux/bin/xdg-user-dirs-update
|
| 69 |
opt/Adobe/Reader9/Reader/intellinux/SPPlugins/ADMPlugin.apl
|
| 70 |
opt/Adobe/Reader9/Reader/intellinux/plug_ins/AcroForm/PMP/.*.pmp
|
| 71 |
opt/Adobe/Reader9/Reader/intellinux/plug_ins/Multimedia/MPP/.*.mpp
|
| 72 |
opt/Adobe/Reader9/Reader/intellinux/plug_ins/.*.api
|
| 73 |
opt/Adobe/Reader9/Reader/intellinux/sidecars/.*.DEU
|
| 74 |
opt/Adobe/Reader9/Browser/intellinux/nppdf.so
|
| 75 |
opt/netscape/plugins/nppdf.so"
|
| 76 |
|
| 77 |
QA_TEXTRELS="opt/Adobe/Reader9/Reader/intellinux/lib/libsccore.so"
|
| 78 |
|
| 79 |
INSTALLDIR=/opt
|
| 80 |
|
| 81 |
S="${WORKDIR}/AdobeReader"
|
| 82 |
|
| 83 |
# Actually, ahv segfaults when run standalone so presumably
|
| 84 |
# it isn't intended for direct use - so the only launcher is
|
| 85 |
# acroread after all.
|
| 86 |
LAUNCHERS="Adobe/Reader9/bin/acroread"
|
| 87 |
# Adobe/HelpViewer/1.0/intellinux/bin/ahv"
|
| 88 |
|
| 89 |
# remove bundled libs to force use of system version, bug 340527
|
| 90 |
REMOVELIBS="libcrypto libssl"
|
| 91 |
|
| 92 |
pkg_setup() {
|
| 93 |
# x86 binary package, ABI=x86
|
| 94 |
has_multilib_profile && ABI="x86"
|
| 95 |
}
|
| 96 |
|
| 97 |
# Determine lingua from filename
|
| 98 |
acroread_get_ll() {
|
| 99 |
local f_src_l ll lingua src_l
|
| 100 |
f_src_l=${1/${SRC_FOOT}}
|
| 101 |
f_src_l=${f_src_l/*_}
|
| 102 |
for ll in ${LINGUA_LIST} ; do
|
| 103 |
lingua=${ll/:*}
|
| 104 |
src_l=${ll/*:}
|
| 105 |
if [[ ${src_l} == ${f_src_l} ]] ; then
|
| 106 |
echo ${lingua}
|
| 107 |
return
|
| 108 |
fi
|
| 109 |
done
|
| 110 |
die "Failed to match file $1 to a LINGUA; please report."
|
| 111 |
}
|
| 112 |
|
| 113 |
src_unpack() {
|
| 114 |
local ll linguas fl launcher
|
| 115 |
# Unpack all into the same place; overwrite common files.
|
| 116 |
fl=""
|
| 117 |
for pkg in ${A} ; do
|
| 118 |
cd "${WORKDIR}"
|
| 119 |
unpack ${pkg}
|
| 120 |
cd "${S}"
|
| 121 |
tar xf ILINXR.TAR || die "Failed to unpack ILINXR.TAR."
|
| 122 |
tar xf COMMON.TAR || die "Failed to unpack COMMON.TAR."
|
| 123 |
ll=$(acroread_get_ll ${pkg})
|
| 124 |
for launcher in ${LAUNCHERS} ; do
|
| 125 |
mv ${launcher} ${launcher}.${ll}
|
| 126 |
done
|
| 127 |
if [[ -z ${fl} ]] ; then
|
| 128 |
fl=${ll}
|
| 129 |
linguas="${ll}"
|
| 130 |
else
|
| 131 |
linguas="${linguas} ${ll}"
|
| 132 |
fi
|
| 133 |
done
|
| 134 |
if [[ ${linguas} == ${fl} ]] ; then
|
| 135 |
# Only one lingua selected - skip building the wrappers
|
| 136 |
for launcher in ${LAUNCHERS} ; do
|
| 137 |
mv ${launcher}.${fl} ${launcher} ||
|
| 138 |
die "Failed to put ${launcher}.${fl} back to ${launcher}; please report."
|
| 139 |
done
|
| 140 |
else
|
| 141 |
# Build wrappers. Launch the acroread for the environment variable
|
| 142 |
# LANG (matched with a trailing * so that for example 'de_DE' matches
|
| 143 |
# 'de', 'en_GB' matches 'en' etc).
|
| 144 |
#
|
| 145 |
# HelpViewer is new - We don't know if Adobe are likely to
|
| 146 |
# internationalize it or not.
|
| 147 |
for launcher in ${LAUNCHERS} ; do
|
| 148 |
cat > ${launcher} <<-EOF
|
| 149 |
#!/bin/bash
|
| 150 |
# Copyright 1999-2009 Gentoo Foundation
|
| 151 |
# Distributed under the terms of the GNU General Public License v2
|
| 152 |
#
|
| 153 |
# Automatically generated by ${CATEGORY}/${PF}
|
| 154 |
|
| 155 |
# Exec the acroread script for the language chosen in
|
| 156 |
# LC_ALL/LC_MESSAGES/LANG (first found takes precedence, as in glibc)
|
| 157 |
L=\${LC_ALL}
|
| 158 |
L=\${L:-\${LC_MESSAGES}}
|
| 159 |
L=\${L:-\${LANG}}
|
| 160 |
case \${L} in
|
| 161 |
EOF
|
| 162 |
for ll in ${linguas} ; do
|
| 163 |
echo "${ll}*) exec ${INSTALLDIR}/${launcher}.${ll} \"\$@\";;" >> ${launcher}
|
| 164 |
done
|
| 165 |
# default to English (in particular for LANG=C)
|
| 166 |
cat >> ${launcher} <<-EOF
|
| 167 |
*) exec ${INSTALLDIR}/${launcher}.${fl} "\$@";;
|
| 168 |
esac
|
| 169 |
EOF
|
| 170 |
chmod 755 ${launcher}
|
| 171 |
done
|
| 172 |
fi
|
| 173 |
|
| 174 |
# remove cruft
|
| 175 |
rm "${S}"/Adobe/Reader9/bin/UNINSTALL
|
| 176 |
rm "${S}"/Adobe/Reader9/Browser/install_browser_plugin
|
| 177 |
rm "${S}"/Adobe/Reader9/Resource/Support/vnd.*.desktop
|
| 178 |
|
| 179 |
# replace some configuration sections
|
| 180 |
for binfile in "${S}"/Adobe/Reader9/bin/* ; do
|
| 181 |
sed -i -e '/Font-config/,+9d' \
|
| 182 |
-e "/acrogre.conf/r ${FILESDIR}/gentoo_config" -e //N \
|
| 183 |
"${binfile}" || die "sed configuration settings failed."
|
| 184 |
done
|
| 185 |
|
| 186 |
# fix erroneous Exec entry in .desktop
|
| 187 |
sed -i -e 's/^Exec=acroread[[:space:]]*$/Exec=acroread %U/' \
|
| 188 |
"${S}"/Adobe/Reader9/Resource/Support/AdobeReader.desktop \
|
| 189 |
||die "sed .desktop fix failed"
|
| 190 |
|
| 191 |
# fix braindead error in nppdf.so (bug 412051)
|
| 192 |
base64 -d > "${WORKDIR}/nppdf.so.patch" << ENDOFFILE
|
| 193 |
QlNESUZGNDBIAAAAAAAAAC8AAAAAAAAAYL0CAAAAAABCWmg5MUFZJlNZFBL6EAAAFvBh+DwgDAgQ
|
| 194 |
QAAAEABAIAAgACICaGjJtQoaaYAFPzpGDIjiUXSFYEuGy1ix8XckU4UJAUEvoQBCWmg5MUFZJlNZ
|
| 195 |
jrYrlQABYGAAwAAIAAAIIAAwzAUppgKbECni7kinChIR1sVyoEJaaDkxQVkmU1kzGPRGAAAAEYAA
|
| 196 |
AIYFAwAgACIHqbUIYAdBF8XckU4UJAzGPRGA
|
| 197 |
ENDOFFILE
|
| 198 |
einfo "Patching nppdf.so"
|
| 199 |
mv Adobe/Reader9/Browser/intellinux/nppdf.so Adobe/Reader9/Browser/intellinux/nppdf.so.orig || die
|
| 200 |
bspatch Adobe/Reader9/Browser/intellinux/nppdf.so.orig Adobe/Reader9/Browser/intellinux/nppdf.so "${WORKDIR}/nppdf.so.patch" || die
|
| 201 |
rm Adobe/Reader9/Browser/intellinux/nppdf.so.orig || die
|
| 202 |
}
|
| 203 |
|
| 204 |
src_install() {
|
| 205 |
# Install desktop files
|
| 206 |
domenu Adobe/Reader9/Resource/Support/AdobeReader.desktop
|
| 207 |
|
| 208 |
# Install commonly used icon sizes
|
| 209 |
for res in 16x16 22x22 32x32 48x48 64x64 128x128 ; do
|
| 210 |
insinto /usr/share/icons/hicolor/${res}/apps
|
| 211 |
doins Adobe/Reader9/Resource/Icons/${res}/*
|
| 212 |
done
|
| 213 |
|
| 214 |
dodir /opt
|
| 215 |
chown -R --dereference -L root:0 Adobe
|
| 216 |
cp -dpR Adobe "${ED}"opt/ || die
|
| 217 |
|
| 218 |
# remove some bundled libs
|
| 219 |
for mylib in ${REMOVELIBS} ; do
|
| 220 |
einfo Removing bundled ${mylib}
|
| 221 |
rm -v "${ED}"/opt/Adobe/Reader9/Reader/intellinux/lib/${mylib}*
|
| 222 |
done
|
| 223 |
|
| 224 |
doman Adobe/Reader9/Resource/Shell/acroread.1.gz
|
| 225 |
|
| 226 |
if use nsplugin ; then
|
| 227 |
exeinto /opt/netscape/plugins
|
| 228 |
doexe Adobe/Reader9/Browser/intellinux/nppdf.so
|
| 229 |
inst_plugin /opt/netscape/plugins/nppdf.so
|
| 230 |
fi
|
| 231 |
|
| 232 |
dodir /opt/bin
|
| 233 |
for launcher in ${LAUNCHERS} ; do
|
| 234 |
dosym /opt/${launcher} /opt/bin/${launcher/*bin\/}
|
| 235 |
done
|
| 236 |
|
| 237 |
# We need to set a MOZILLA_COMP_PATH for seamonkey and firefox since
|
| 238 |
# they don't install a configuration file for libgtkembedmoz.so
|
| 239 |
# detection in /etc/gre.d/ like xulrunner did.
|
| 240 |
if ! use minimal ; then
|
| 241 |
if use x86 ; then
|
| 242 |
for lib in /opt/seamonkey /usr/lib/seamonkey /usr/lib/mozilla-firefox ; do
|
| 243 |
if [[ -f ${lib}/libgtkembedmoz.so ]] ; then
|
| 244 |
echo "MOZILLA_COMP_PATH=${lib}" >> "${ED}"${INSTALLDIR}/Adobe/Reader9/Reader/GlobalPrefs/mozilla_config
|
| 245 |
elog "Adobe Reader depends on libgtkembedmoz.so, which I've found on"
|
| 246 |
elog "your system in ${lib}, and configured in ${INSTALLDIR}/Adobe/Reader9/Reader/GlobalPrefs/mozilla_config."
|
| 247 |
break # don't search any more libraries
|
| 248 |
fi
|
| 249 |
done
|
| 250 |
fi
|
| 251 |
fi
|
| 252 |
}
|
| 253 |
|
| 254 |
pkg_preinst() {
|
| 255 |
gnome2_icon_savelist
|
| 256 |
}
|
| 257 |
|
| 258 |
pkg_postinst () {
|
| 259 |
local ll lc
|
| 260 |
lc=0
|
| 261 |
for ll in ${LINGUA_LIST} ; do
|
| 262 |
use linguas_${ll/:*} && (( lc = ${lc} + 1 ))
|
| 263 |
done
|
| 264 |
if [[ ${lc} > 1 ]] ; then
|
| 265 |
echo
|
| 266 |
elog "Multiple languages have been installed, selected via a wrapper script."
|
| 267 |
elog "The language is selected according to the LANG environment variable"
|
| 268 |
elog "(defaulting to English if LANG is not set, or no matching language"
|
| 269 |
elog "version is installed). Users may need to remove their preferences in"
|
| 270 |
elog "~/.adobe to switch languages."
|
| 271 |
echo
|
| 272 |
fi
|
| 273 |
|
| 274 |
if use minimal ; then
|
| 275 |
echo
|
| 276 |
ewarn "If you want html support and/or view the Adobe Reader help you have"
|
| 277 |
ewarn "to re-emerge acroread with USE=\"-minimal\"."
|
| 278 |
echo
|
| 279 |
fi
|
| 280 |
|
| 281 |
if use nsplugin ; then
|
| 282 |
echo
|
| 283 |
elog "If you're running a 64bit browser you may also want to install"
|
| 284 |
elog "\"www-plugins/nspluginwrapper\" to be able to use the Adobe Reader"
|
| 285 |
elog "browser plugin."
|
| 286 |
echo
|
| 287 |
fi
|
| 288 |
|
| 289 |
gnome2_icon_cache_update
|
| 290 |
}
|
| 291 |
|
| 292 |
pkg_postrm() {
|
| 293 |
gnome2_icon_cache_update
|
| 294 |
}
|