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

Contents of /www-client/opera-next/opera-next-12.00.1456.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Thu Jun 14 09:31:50 2012 UTC (11 months, 1 week ago) by jer
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +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-next/opera-next-12.00.1456.ebuild,v 1.2 2012/06/12 14:32:06 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 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="rc4_${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 kk ko lt me mk ms nb nl nn pa pl pt pt-BR ro ru sk sr
38 sv 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 x11-libs/gtk+:3 ) )
55 x11-libs/pango
56 x11-libs/pixman
57 "
58 KDERDEPEND="
59 kde-base/kdelibs
60 x11-libs/qt-core
61 x11-libs/qt-gui
62 "
63 GSTRDEPEND="
64 dev-libs/glib:2
65 dev-libs/libxml2
66 media-libs/gst-plugins-base
67 media-libs/gstreamer
68 media-plugins/gst-plugins-meta
69 "
70 RDEPEND="
71 media-libs/fontconfig
72 media-libs/freetype
73 sys-apps/util-linux
74 sys-libs/zlib
75 virtual/opengl
76 x11-libs/libICE
77 x11-libs/libSM
78 x11-libs/libX11
79 x11-libs/libXext
80 x11-libs/libXft
81 x11-libs/libXrender
82 x11-libs/libXt
83 gtk? ( ${GTKRDEPEND} )
84 kde? ( ${KDERDEPEND} )
85 gstreamer? ( ${GSTRDEPEND} )
86 "
87 src_unpack() {
88 unpack ${A}
89 mv -v ${PN}* "${S}" || die
90 }
91
92 src_prepare() {
93 local LNGDIR="share/${PN}/locale"
94
95 # Count linguas
96 count() { echo ${#}; }
97 local lingua_count=$(count ${O_LINGUAS} en)
98 local locale_count=$(count ${LNGDIR}/*)
99 [[ ${lingua_count} = ${locale_count} ]] \
100 || die "Number of LINGUAS does not match number of locales"
101 unset count
102
103 # Remove unwanted linguas
104 einfo "Keeping these locales (linguas): ${LINGUAS}."
105 for LINGUA in ${O_LINGUAS}; do
106 if ! use linguas_${LINGUA/-/_}; then
107 LINGUA=$(find "${LNGDIR}" -maxdepth 1 -type d -iname ${LINGUA/_/-})
108 rm -r "${LINGUA}" || die "The list of linguas needs to be fixed"
109 fi
110 done
111
112 # Remove doc directory but keep the LICENSE under another name (bug #315473)
113 mv share/doc/${PN}/LICENSE share/${PN}/defaults/license.txt
114 rm -rf share/doc
115 for locale in share/${PN}/locale/*; do
116 rm -f "${locale}/license.txt"
117 ln -sn /usr/share/${PN}/defaults/license.txt "${locale}/license.txt" \
118 || die
119 done
120
121 # Remove package directory
122 rm -rf share/${PN}/package
123
124 # Optional libraries
125 if ! use gtk; then
126 rm lib/${PN}/liboperagtk2.so || die
127 rm lib/${PN}/liboperagtk3.so || die
128 fi
129 if ! use kde; then
130 rm lib/${PN}/liboperakde4.so || die
131 fi
132 if ! use gstreamer; then
133 rm -r lib/${PN}/gstreamer || die
134 fi
135 if use amd64 && ! use multilib; then
136 rm lib/${PN}/pluginwrapper/operapluginwrapper-ia32-linux || die
137 fi
138
139 # Unzip the man pages before sedding
140 gunzip share/man/man1/* || die
141
142 local OPERA_SUFFIX= OPERA__SUFFIX= OPERAU_SUFFIX=
143 if [[ ${PN} = opera-next ]]; then
144 OPERA_SUFFIX="-next"
145 OPERA__SUFFIX=" Next"
146 OPERA_USUFFIX="-NEXT"
147 fi
148
149 # Replace PREFIX, SUFFIX and PN in various files
150 sed -i \
151 -e "s:@@{PREFIX}:/usr:g" \
152 -e "s:@@{SUFFIX}:${OPERA_SUFFIX}:g" \
153 -e "s:@@{_SUFFIX}:${OPERA__SUFFIX}:g" \
154 -e "s:@@{USUFFIX}:${OPERA_USUFFIX}:g" \
155 share/man/man1/* \
156 share/mime/packages/* \
157 share/applications/${PN}-*.desktop \
158 || die
159
160 # Create /usr/bin/opera wrapper
161 echo '#!/bin/sh' > ${PN}
162 echo 'export OPERA_DIR="/usr/share/'"${PN}"'"' >> ${PN}
163 echo 'export OPERA_PERSONALDIR=${OPERA_PERSONALDIR:-"${HOME}/.'${PN}'"}' \
164 >> ${PN}
165 echo 'exec '"${OPREFIX}/${PN}/${PN}"' "$@"' >> ${PN}
166
167 # Change libz.so.3 to libz.so.1 for gentoo/freebsd
168 if use elibc_FreeBSD; then
169 scanelf -qR -N libz.so.3 -F "#N" lib/${PN}/ | \
170 while read i; do
171 if [[ $(strings "$i" | fgrep -c libz.so.3) -ne 1 ]];
172 then
173 export SANITY_CHECK_LIBZ_FAILED=1
174 break
175 fi
176 sed -i \
177 "$i" \
178 -e 's/libz\.so\.3/libz.so.1/g'
179 done
180 [[ "$SANITY_CHECK_LIBZ_FAILED" = "1" ]] && die
181 fi
182 }
183
184 src_install() {
185 # We install into usr instead of opt as Opera does not support the latter
186 dodir /usr
187 mv lib/ "${D}/${OPREFIX}" || die
188 mv share/ "${D}/usr/" || die
189
190 # Install startup scripts
191 dobin ${PN}
192
193 # Stop revdep-rebuild from checking opera binaries
194 dodir /etc/revdep-rebuild
195 echo "SEARCH_DIRS_MASK=\"${OPREFIX}/${PN}\"" \
196 > "${D}"/etc/revdep-rebuild/90${PN}
197
198 # Set PaX markings for hardened/PaX (bug #344267)
199 pax-mark m "${D}"/${OPREFIX}/${PN}/opera*
200 }
201
202 pkg_preinst() {
203 gnome2_icon_savelist
204 }
205
206 pkg_postinst() {
207 if use elibc_FreeBSD; then
208 elog
209 elog "To improve shared memory usage please set:"
210 elog "$ sysctl kern.ipc.shm_allow_removed=1"
211 fi
212
213 # Update desktop file database and gtk icon cache (bug #334993)
214 gnome2_icon_cache_update
215 fdo-mime_desktop_database_update
216 }
217
218 pkg_postrm() {
219 # Update desktop file database and gtk icon cache (bug #334993)
220 gnome2_icon_cache_update
221 fdo-mime_desktop_database_update
222 }

  ViewVC Help
Powered by ViewVC 1.1.13