/[gentoo-x86]/app-text/acroread/acroread-9.5.1.ebuild
Gentoo

Contents of /app-text/acroread/acroread-9.5.1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (show annotations) (download)
Wed Dec 19 16:57:44 2012 UTC (20 months, 1 week ago) by tetromino
Branch: MAIN
Changes since 1.6: +3 -2 lines
Depend on pangox-compat if using pango-1.32.

(Portage version: 2.2.0_alpha149/cvs/Linux x86_64, signed Manifest commit with key CF0ADD61)

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

  ViewVC Help
Powered by ViewVC 1.1.20