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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Tue Jun 26 14:40:48 2012 UTC (2 years, 2 months ago) by jer
Branch: MAIN
http://my.opera.com/desktopteam/blog/2012/06/26/html5-dnd-fixes-for-12-01

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

  ViewVC Help
Powered by ViewVC 1.1.20