/[gentoo-x86]/www-client/opera/opera-12.00.1450.ebuild
Gentoo

Contents of /www-client/opera/opera-12.00.1450.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Thu Jun 14 09:30:56 2012 UTC (11 months ago) by jer
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
http://my.opera.com/desktopteam/blog/2012/06/14/twelve-under-the-hood-improvements-in-opera-12

(Portage version: 2.2.0_alpha110/cvs/Linux x86_64)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/www-client/opera/opera-12.00.1450.ebuild,v 1.1 2012/06/08 12:15:58 jer Exp $
4
5 EAPI="4"
6
7 inherit eutils fdo-mime gnome2-utils multilib pax-utils versionator
8
9 DESCRIPTION="A fast and secure web browser and Internet suite"
10 HOMEPAGE="http://www.opera.com/"
11
12 SLOT="0"
13 LICENSE="OPERA-11 LGPL-2 LGPL-3"
14 KEYWORDS="~amd64 ~x86 ~x86-fbsd"
15 IUSE="elibc_FreeBSD gtk gtk3 kde +gstreamer multilib"
16
17 O_V="$(get_version_component_range 1-2)" # Major version, i.e. 11.00
18 O_B="$(get_version_component_range 3)" # Build version, i.e. 1156
19
20 O_D="rc2_${O_V}-${O_B}"
21 O_P="${PN}-${O_V}-${O_B}"
22 O_U="http://snapshot.opera.com/unix/"
23
24 SRC_URI="
25 amd64? ( ${O_U}${O_D}/${O_P}.x86_64.linux.tar.xz )
26 x86? ( ${O_U}${O_D}/${O_P}.i386.linux.tar.xz )
27 x86-fbsd? ( ${O_U}${O_D}/${O_P}.i386.freebsd.tar.xz )
28 "
29
30 OPREFIX="/usr/$(get_libdir)"
31
32 QA_DT_HASH="${OPREFIX}/${PN}/.*"
33 QA_PRESTRIPPED="${OPREFIX}/${PN}/.*"
34
35 O_LINGUAS="
36 af ar az be bg bn cs da de el en-GB es-ES es-LA et fa fi fr fr-CA fy gd he
37 hi hr hu id it ja ka ko lt me mk ms nb nl nn pa pl pt pt-BR ro ru sk sr sv
38 sw ta te th tl tr uk ur uz vi zh-CN zh-TW zu
39 "
40
41 for O_LINGUA in ${O_LINGUAS}; do
42 IUSE="${IUSE} linguas_${O_LINGUA/-/_}"
43 done
44
45 DEPEND="
46 >=sys-apps/sed-4
47 app-arch/xz-utils
48 "
49 GTKRDEPEND="
50 dev-libs/atk
51 dev-libs/glib:2
52 x11-libs/cairo
53 x11-libs/gdk-pixbuf
54 gtk? ( x11-libs/gtk+:2 )
55 gtk3? ( x11-libs/gtk+:3 )
56 x11-libs/pango
57 x11-libs/pixman
58 "
59 KDERDEPEND="
60 kde-base/kdelibs
61 x11-libs/qt-core
62 x11-libs/qt-gui
63 "
64 GSTRDEPEND="
65 dev-libs/glib:2
66 dev-libs/libxml2
67 media-libs/gst-plugins-base
68 media-libs/gstreamer
69 media-plugins/gst-plugins-meta
70 "
71 RDEPEND="
72 media-libs/fontconfig
73 media-libs/freetype
74 sys-apps/util-linux
75 sys-libs/zlib
76 virtual/opengl
77 x11-libs/libICE
78 x11-libs/libSM
79 x11-libs/libX11
80 x11-libs/libXext
81 x11-libs/libXft
82 x11-libs/libXrender
83 x11-libs/libXt
84 gtk? ( ${GTKRDEPEND} )
85 gtk3? ( ${GTKRDEPEND} )
86 kde? ( ${KDERDEPEND} )
87 gstreamer? ( ${GSTRDEPEND} )
88 "
89 src_unpack() {
90 unpack ${A}
91 mv -v ${PN}* "${S}" || die
92 }
93
94 src_prepare() {
95 local LNGDIR="share/${PN}/locale"
96
97 # Count linguas
98 count() { echo ${#}; }
99 local lingua_count=$(count ${O_LINGUAS} en)
100 local locale_count=$(count ${LNGDIR}/*)
101 [[ ${lingua_count} = ${locale_count} ]] \
102 || die "Number of LINGUAS does not match number of locales"
103 unset count
104
105 # Remove unwanted linguas
106 einfo "Keeping these locales (linguas): ${LINGUAS}."
107 for LINGUA in ${O_LINGUAS}; do
108 if ! use linguas_${LINGUA/-/_}; then
109 LINGUA=$(find "${LNGDIR}" -maxdepth 1 -type d -iname ${LINGUA/_/-})
110 rm -r "${LINGUA}" || die "The list of linguas needs to be fixed"
111 fi
112 done
113
114 # Remove doc directory but keep the LICENSE under another name (bug #315473)
115 mv share/doc/${PN}/LICENSE share/${PN}/defaults/license.txt
116 rm -rf share/doc
117 for locale in share/${PN}/locale/*; do
118 rm -f "${locale}/license.txt"
119 ln -sn /usr/share/${PN}/defaults/license.txt "${locale}/license.txt" \
120 || die
121 done
122
123 # Remove package directory
124 rm -rf share/${PN}/package
125
126 # Optional libraries
127 if ! use gtk; then
128 rm lib/${PN}/liboperagtk2.so || die
129 fi
130 if ! use gtk3; then
131 rm lib/${PN}/liboperagtk3.so || die
132 fi
133 if ! use kde; then
134 rm lib/${PN}/liboperakde4.so || die
135 fi
136 if ! use gstreamer; then
137 rm -r lib/${PN}/gstreamer || die
138 fi
139 if use amd64 && ! use multilib; then
140 rm lib/${PN}/pluginwrapper/operapluginwrapper-ia32-linux || die
141 fi
142
143 # Unzip the man pages before sedding
144 gunzip share/man/man1/* || die
145
146 local OPERA_SUFFIX= OPERA__SUFFIX= OPERAU_SUFFIX=
147 if [[ ${PN} = opera-next ]]; then
148 OPERA_SUFFIX="-next"
149 OPERA__SUFFIX=" Next"
150 OPERA_USUFFIX="-NEXT"
151 fi
152
153 # Replace PREFIX, SUFFIX and PN in various files
154 sed -i \
155 -e "s:@@{PREFIX}:/usr:g" \
156 -e "s:@@{SUFFIX}:${OPERA_SUFFIX}:g" \
157 -e "s:@@{_SUFFIX}:${OPERA__SUFFIX}:g" \
158 -e "s:@@{USUFFIX}:${OPERA_USUFFIX}:g" \
159 share/man/man1/* \
160 share/mime/packages/* \
161 share/applications/${PN}-*.desktop \
162 || die
163
164 # Create /usr/bin/opera wrapper
165 echo '#!/bin/sh' > ${PN}
166 echo 'export OPERA_DIR="/usr/share/'"${PN}"'"' >> ${PN}
167 echo 'export OPERA_PERSONALDIR=${OPERA_PERSONALDIR:-"${HOME}/.'${PN}'"}' \
168 >> ${PN}
169 echo 'exec '"${OPREFIX}/${PN}/${PN}"' "$@"' >> ${PN}
170
171 # Change libz.so.3 to libz.so.1 for gentoo/freebsd
172 if use elibc_FreeBSD; then
173 scanelf -qR -N libz.so.3 -F "#N" lib/${PN}/ | \
174 while read i; do
175 if [[ $(strings "$i" | fgrep -c libz.so.3) -ne 1 ]];
176 then
177 export SANITY_CHECK_LIBZ_FAILED=1
178 break
179 fi
180 sed -i \
181 "$i" \
182 -e 's/libz\.so\.3/libz.so.1/g'
183 done
184 [[ "$SANITY_CHECK_LIBZ_FAILED" = "1" ]] && die
185 fi
186 }
187
188 src_install() {
189 # We install into usr instead of opt as Opera does not support the latter
190 dodir /usr
191 mv lib/ "${D}/${OPREFIX}" || die
192 mv share/ "${D}/usr/" || die
193
194 # Install startup scripts
195 dobin ${PN}
196
197 # Stop revdep-rebuild from checking opera binaries
198 dodir /etc/revdep-rebuild
199 echo "SEARCH_DIRS_MASK=\"${OPREFIX}/${PN}\"" \
200 > "${D}"/etc/revdep-rebuild/90${PN}
201
202 # Set PaX markings for hardened/PaX (bug #344267)
203 pax-mark m "${D}"/${OPREFIX}/${PN}/opera*
204 }
205
206 pkg_preinst() {
207 gnome2_icon_savelist
208 }
209
210 pkg_postinst() {
211 if use elibc_FreeBSD; then
212 elog
213 elog "To improve shared memory usage please set:"
214 elog "$ sysctl kern.ipc.shm_allow_removed=1"
215 fi
216
217 # Update desktop file database and gtk icon cache (bug #334993)
218 gnome2_icon_cache_update
219 fdo-mime_desktop_database_update
220 }
221
222 pkg_postrm() {
223 # Update desktop file database and gtk icon cache (bug #334993)
224 gnome2_icon_cache_update
225 fdo-mime_desktop_database_update
226 }

  ViewVC Help
Powered by ViewVC 1.1.13